Triggering from weather conditions


#1

There are two weather programs I currently have running, Weather Underground and Open Weather.
Open Weather it appears has more triggering options but I’m at a loss as to how to use them from either.
Many I’m sure use the temperature to trigger things for my self I’m more interested in watching high wind speeds.
Can any one supply an example for any condition, for either weather program?


#2

You’ll need something like JavaScript to achieve that. Drill down through this contribution http://old.homegenie.club:8080/www.homegenie.it/forum/indexa5ec.html?topic=124.0 It looks like something similar you are trying to achieve.


#3

Nope that’s of no help it is about creating a program widget from my understanding. Thanks any ways.

I don’t believe java script is needed for what I wish to do. I basically wish to create a macro that is triggered when a specific weather condition value is more then a specific value.


#4

JavaScript or C# so. For C# David_Wallis is your man.


#5

Actualy you dont need Java or C# to create a simple macro. You can use the wizard.
You need to use one of the other programing languages when you wish to make a conditional macro (if this or that then this) from my understanding.

I’ve made a few macros the wizard mode and now made a couple using weather condition triggers.
How well this work or if Ive done them corectly remains to be seen. Running them from programing mode works but that ignors the trigger which i won’t know if I’ve entered corectly untill the condition is updated and changes.

I had hoped someone here had something triggering from weather conditions. Once I determine my simple weather triggered macro works Ill post it here.
Hopefully someone will post a sample that works before that.


#6

OK I managed to get a simple temperature trigger to work with the info from both WU & OW.
This is really is so simple to do I think what was messing me up was the value required. You just need to input the just numerical value not the units designation(metric or imperial)
The real issue for this is the time limitations on pulls, this can be over come by using two or more weather programs. you may also be able to use more then one API key for OW. I’ll experiment with that approach in the future.
For now here’s the how to:
1: in HG click on configure then programs then weather and environment.
2: from actions select add new program in the window that pops up enter a name and click OK.
3:keep the program type set as wizard script and enter a description to help you identify it later.
4:in program code click add command and find what device you wish to turn on or off once selected it will display a number of actions on, off…
select the option then done
5: in trigger code click add condition
6: click programs then scroll to your desired weather program since I use WU and OW it clicked WU
7: scroll down to the item you wish to trigger with in WU to use metric temperature use Condition.TemperatureC
8: now select greater then less than or equals in the value window type the numerical number only! and then click done.
9: if you wish to trigger using another weather program as well repeat steps 5 to 8
10: select trigger then the when to trigger.
11: click actions the save the click back button to exit

Now ever time the weather program refreshes this macro will be checked and run if the condition is met or at least it has for me so far.


#7

Yes but your post indicated that you wanted to trigger an event based on the wind speed reaching a particular level which of course would be conditional hence me suggesting C# or JavaScript


#8

Yes, and it should still be able to be done this way as wind speed is an option as is greater then in the trigger options.
Using one of the other languages should allow you to combine the on/off action into one macro like
“IF greater then 50 turn x on else turn x off”
I may be wrong with this assumption.


#9

As promised here is an example. 1009-Temperature_trigger.hgx (1.6 KB)
this turns on a X10 module (F1) when condition of temperature is greater then 14C and the status switches to true from false.
it also uses both the WU and OW you will need an API key for both or if you only have it for one delete the other from the trigger code.