X10 Community Forum

🔌General Home Automation => Automating Your House => Topic started by: LostDog88 on March 22, 2019, 12:53:43 PM

Title: Controlling a module based on Weather
Post by: LostDog88 on March 22, 2019, 12:53:43 PM
I have a heat lamp for my barn cats. Sometimes it gets cold at night. I want to be able to control this based on the weather underground module. I have a key and get weather updates to HG (RPI).

I want to make that light come on when the temp gets low and go off when the temp is warm. Night or day.

Is there a way to do this?
Title: Re: Controlling a module based on Weather
Post by: Tuicemen on March 22, 2019, 01:57:43 PM
Yes! however with weather underground now not handing out free api keys Gene removed weather underground from HG so newer versions will not have WU.
I created a HG app (program/script) using info from open weather which Gene now includes, or you can get it from the package manager
You can create a wizard script or use the wizard script I posted I believe it was for temperature but you can change the values.
The script and directions for setup can be found in the User created HG Scripts (programs) section (http://forums.x10.com/index.php?board=172.0)
Title: Re: Controlling a module based on Weather
Post by: LostDog88 on March 22, 2019, 05:24:26 PM
Thanks a zillion.

I will work on this over the weekend! I'm excited and my cats will be happy and warm!

Cheers!

 >! >!
Title: Re: Controlling a module based on Weather
Post by: Tuicemen on March 22, 2019, 05:49:06 PM
I use simular scripts to keep my Koi pond open during freezing temperatures, as well I lock my solar tracker during windy times to prevent damage. ;)
Title: Re: Controlling a module based on Weather
Post by: LostDog88 on March 23, 2019, 07:17:40 PM
I got it to update the OW module.

There are so many choices for the trigger. I just want a simple if/then:

If temp is under XX turn on light.
If temp is over XX turn off light.

I don't seem to be able to make this happen. The light is off and should be turning on at each update of OW? Right?
Title: Re: Controlling a module based on Weather
Post by: Tuicemen on March 23, 2019, 08:22:37 PM
Did you download the weather triggers and install them from http://forums.x10.com/index.php?topic=30857.0
They are set to turn a x10 device On and a specified temp and the other turns it Off when the value is greater then a specified temperature
you merly need to change the module and temperature values in each program
Title: Re: Controlling a module based on Weather
Post by: LostDog88 on March 24, 2019, 10:40:44 AM
I did now! LOL.

Sorry didn't see those I tried to write my own.

I also noticed that they are in Celcius. Is there a way to change the values in your script to Imperial?
Title: Re: Controlling a module based on Weather
Post by: Tuicemen on March 24, 2019, 10:45:37 AM
I believe so it has been a while since creating them you just need to play with the options
Title: Re: Controlling a module based on Weather
Post by: LostDog88 on March 24, 2019, 10:57:14 AM
I didn't see any options in your script. I imported them and set them to Imperial temps.

As soon as I enabled them the light came on as OW was reporting less than 65 degrees.

We shall see if it goes off later this afternoon as we are expecting warmer temps.

Now to go fix that carb on my boat so we can get out crab fishing this summer!
Title: Re: Controlling a module based on Weather
Post by: Tuicemen on March 24, 2019, 12:54:24 PM
I didn't see any options in your script. I imported them and set them to Imperial temps.

As soon as I enabled them the light came on as OW was reporting less than 65 degrees.

We shall see if it goes off later this afternoon as we are expecting warmer temps.

Now to go fix that carb on my boat so we can get out crab fishing this summer!
The weather trigger programs don't have options as they were wizard scripts so they must be manually edited to change values.
I may at some point create a universal program that adds the options directly to the modules like the HG Smart E-mailer does.
However I'm waiting for the new OW program Gene has included in the new HG builds to get more reliable.
Title: Re: Controlling a module based on Weather
Post by: LostDog88 on March 25, 2019, 04:04:23 PM
Sorry man. I am still struggling with this.

I have imported your less than temp script. I set the temp to 55 degrees to turn on C10.

when I enable the program it goes to idle (yellow button).

Yet it never activates when the temp goes below the agreed upon degrees. :-(
Title: Re: Controlling a module based on Weather
Post by: Tuicemen on March 25, 2019, 04:16:19 PM
If you add it to the layout where the C10 module is, then click on it does it activate C10? ???
Title: Re: Controlling a module based on Weather
Post by: LostDog88 on March 25, 2019, 05:02:25 PM
If you add it to the layout where the C10 module is, then click on it does it activate C10? ???

Do you mean add it like a module on the home page?
Title: Re: Controlling a module based on Weather
Post by: Tuicemen on March 25, 2019, 05:38:32 PM
If you add it to the layout where the C10 module is, then click on it does it activate C10? ???

Do you mean add it like a module on the home page?
Yes if that is the same page you have the c10 module configured so you can see if clicking the temperature app triggers the C10 module
Title: Re: Controlling a module based on Weather
Post by: LostDog88 on March 25, 2019, 06:27:00 PM
If you add it to the layout where the C10 module is, then click on it does it activate C10? ???

Do you mean add it like a module on the home page?
Yes if that is the same page you have the c10 module configured so you can see if clicking the temperature app triggers the C10 module

Okay. Added it to the home page. It has a yellow button showing it is idle.
When I clicked the box the button stayed yellow and the barn cats light came on! To answer your question. Yes. Now to just trigger it based on temp.
Title: Re: Controlling a module based on Weather
Post by: Tuicemen on March 25, 2019, 06:37:37 PM
Ok so the basics are working I'm not sure if that has to remain on the homepage to work. It shouldn't but that's where mine is  ::) :'

I started to work on a program for weather triggering which will be accessible from each module today.
I'm a far cry from having anything working yet just getting the options to show for each module was  a chore till I figured I had a Typo in the code B:( I can't spend as much time on this as I'd like right now so this HG app will be slow coming.
Title: Re: Controlling a module based on Weather
Post by: LostDog88 on March 28, 2019, 10:36:15 AM
This has been working now flawlessly for a week. My cats tell me they are happy!  rofl rofl Ok. Ok. My cats don't talk to me. But the dog does translate for me. She talks all the time.  ;D

I have not updated my HG as of yet because I am scared. I did update/upgrade the Pi. But I am still afraid to upgrade the actual HG software as my experiences have been, well, problematic with each upgrade. While I have been able to fix the problems I just don't want any issues right now.

In other words. It ain't broke and it all works.

Thanks for the help!
Title: Re: Controlling a module based on Weather
Post by: Tuicemen on March 28, 2019, 01:58:01 PM
There realy is no need to be afraid of a HG Update. Make a backup of your SD card and  back up of your HG.
That way you have two fall back options.
The reason for staying relatively up todate with HG is to take advantage of any new apps created.
I managed to add some code to the OpenWeatherMap today to allow for it to fetch the humidity value I also created a simple app to display that info or any weather value for that matter.