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.


#10

@Tuicemen - I have HG up and running on a Pi3B+. But I want to use OW because WU is no longer allowing access. What would be the easiest way to make the widget?

Copy the WU widget and change the info to OW? I’m lucky I can write in English, never mind C so a wizard interests me.

BTW, I do have the Aeotec Z-Stick connected to the Pi3B+ and HG sees it just fine. Now to play some more. I might even buy a CM15 :smiley:


#11

Change the url that calls WU info to whatever url OW uses.


#12

Alternatively there’s an OW .hgx in the HG GitHub. Haven’t tried it but you can download it and import it into HG and try it yourself.


#13

Go to maintenance then package manager and find open weather and install it.


#14

OK, I went to Maintenance > Package Manager > Weather and Environment > OpenWeatherData.hgx.

I entered my data where applicable but had no place to enter state or country. Anyways, upon trying to run I get an update of data failed. Help please.

Wait, somehow I have data updated. Yeah! Now how do I get the OpenWeather widget on the main screen?


#15

yes it take a bit for the key to activate go bottom left of screen to actions click configure group then when the screen displays go to add module find openweather and click the + to add.


#16

Hmm, I’ve got the widget on the screen displaying data. Too bad the data doesn’t look anything like what’s outside the window.

I emailed openweathermap and we’ll see how long it takes to show that it’s a bright sunny day.:grin:


#17

Have you set your location in HG and in the pi raspi-config. If not maybe that is throghing things off


#18

Well I made enough of a mess that I decided to start from scratch. Now world weather doesn’t even show up in the program list.

Very frustrating.


#19

If you’ve made HG backups you can restore to a time when things worked or at least to when you had everything.


#20

Yup, got it back, now to get it to work.