Why no notifications on Wind speed for my blinds?


#5

I believe the 2nd block should NOT be async. Otherwise, it is looking for speed changes BEFORE the new variables are set. (so it will always be the same)


#6

I changed it to async for half an hour, just to test, it’s back as the original now. I was just trying unsuccessfully to get this working.


#8

Hey @jkp Thanks for the input, as you can see i made your changes (unless i’m missing something) the Wind is 5 MPH but i didn’t get a push notification!
not even from the 2 separate calls to a variable, “When true” … “If Wind speed is greater than 2”. i SHOULD be getting THREE push notifications, because i have a push notification on the THEN…
nothing. Is it because the variables are integers or something?

Here are the logs…

12/05/2018, 18:51:02 +194ms
+1ms ╔Received event [Home].time = 1526143863596 with a delay of -1402ms
+205ms ║RunTime Analysis CS > 40ms > PS > 74ms > PE > 91ms > CE
+209ms ║Runtime (47883 bytes) successfully initialized in 74ms (v0.3.104.20180323) (207ms)
+210ms ║╔Execution stage started
+619ms ║║Calculating (string) 5.0 + (string) MPH
+619ms ║║ >> (string) 5.0 MPH
+626ms ║║Executed virtual command [A Weather].setVariable (3ms)
+635ms ║║Executed virtual command [A Weather].setVariable (3ms)
+639ms ║║Comparison (integer) 5 changes = true (0ms)
+641ms ║║Cancelling condition #22’s schedules…
+641ms ║║Condition #22 evaluated true (3ms)
+642ms ║║Cancelling condition #18’s schedules…
+643ms ║║Condition group #18 evaluated true (state changed) (6ms)
+645ms ║║Cancelling statement #19’s schedules…
+648ms ║║Executed virtual command wait (0ms)
+649ms ║║Requesting a wake up for Sat, May 12 2018 @ 6:51:04 PM CEST (in 2.0s)
+655ms ║║Fast executing schedules, waiting for 1996ms to sync up
+2678ms ║║Calculating (string) — + (string) 18:51 >> (string) — 18:51
+2681ms ║║Calculating (string) — 18:51 + (string) on >> (string) — 18:51 on
+2684ms ║║Calculating (string) — 18:51 on + (string) 12 >> (string) — 18:51 on 12
+2686ms ║║Calculating (string) — 18:51 on 12 + (string) of >> (string) — 18:51 on 12 of
+2689ms ║║Calculating (string) — 18:51 on 12 of + (string) May >> (string) — 18:51 on 12 of May
+2691ms ║║Calculating (string) — 18:51 on 12 of May + (string) >> (string) — 18:51 on 12 of May
+2697ms ║║Calculating (string) Wind Speed + (string) 5 >> (string) Wind Speed 5
+2701ms ║║Calculating (string) Wind Speed 5 + (string) MPH and >> (string) Wind Speed 5 MPH and
+2704ms ║║Calculating (string) Wind Speed 5 MPH and + (string) 5 >> (string) Wind Speed 5 MPH and 5
+2707ms ║║Calculating (string) Wind Speed 5 MPH and 5 + (string) MPH >> (string) Wind Speed 5 MPH and 5 MPH
+2710ms ║║Calculating (string) Wind Speed 5 MPH and 5 MPH + (string) >> (string) Wind Speed 5 MPH and 5 MPH
+2713ms ║║Calculating (string) Wind Speed 5 MPH and 5 MPH + (string) — 18:51 on 12 of May >> (string) Wind Speed 5 MPH and 5 MPH — 18:51 on 12 of May
+2715ms ║║Calculating (string) Wind Speed 5 MPH and 5 MPH — 18:51 on 12 of May + (string) >> (string) Wind Speed 5 MPH and 5 MPH — 18:51 on 12 of May
+2718ms ║║Executed virtual command setState (0ms)
+2721ms ║╚Execution stage complete. (2512ms)
+2723ms ║Setting up scheduled job for Sat, May 12 2018 @ 6:53:00 PM CEST (in 115.567s)
+2780ms ╚Event processed successfully (2780ms)


#9

Your variable Wind_speed is something like:
4 MPH
so lines 50 & 64 can never be true. (Math can only be done on numbers, not text)

Can you add two lines below your set variables to something like this:
temp
We need to see what is being returned

Here are the expressions if you want to copy/paste:
"Wind Speed = "Wind_speed
"Speed from Weather = "Wind_speed_from_A_Weather


#10

Here are the changes and the logs, do you see something?

12/05/2018, 19:08:19 +256ms
+1ms ╔Received event [Home].time = 1526144900814 with a delay of -1558ms
+216ms ║RunTime Analysis CS > 37ms > PS > 60ms > PE > 119ms > CE
+219ms ║Runtime (49012 bytes) successfully initialized in 60ms (v0.3.104.20180323) (218ms)
+220ms ║╔Execution stage started
+619ms ║║Calculating (string) 5.0 + (string) MPH
+619ms ║║ >> (string) 5.0 MPH
+625ms ║║Executed virtual command [A Weather].setVariable (3ms)
+635ms ║║Executed virtual command [A Weather].setVariable (2ms)
+640ms ║║Calculating (string) Wind speed = + (string) 5 >> (string) Wind speed = 5
+644ms ║║Wind speed = 5
+645ms ║║Executed virtual command [A Weather].log (1ms)
+651ms ║║Calculating (string) Speed from Weather = + (string) 4 >> (string) Speed from Weather = 4
+654ms ║║Speed from Weather = 4
+655ms ║║Executed virtual command [A Weather].log (1ms)
+659ms ║║Comparison (integer) 5 changes = false (1ms)
+660ms ║║Condition #22 evaluated false (3ms)
+662ms ║║Comparison (integer) 4 changes = false (0ms)
+663ms ║║Condition #23 evaluated false (2ms)
+669ms ║║Condition #24 evaluated false (5ms)
+670ms ║║Condition group #18 evaluated false (state did not change) (12ms)
+673ms ║╚Execution stage complete. (453ms)
+674ms ║Setting up scheduled job for Sat, May 12 2018 @ 7:10:17 PM CEST (in 117.924s)
+683ms ╚Event processed successfully (682ms)


#11

These logs look more in depth…

12/05/2018, 19:10:19 +262ms
+0ms ╔Received event [Home].time = 1526145020836 with a delay of -1574ms
+231ms ║RunTime Analysis CS > 35ms > PS > 60ms > PE > 135ms > CE
+233ms ║Runtime (49012 bytes) successfully initialized in 60ms (v0.3.104.20180323) (232ms)
+234ms ║╔Execution stage started
+502ms ║║Calculating (string) 5.0 + (string) MPH
+502ms ║║ >> (string) 5.0 MPH
+509ms ║║Executed virtual command [A Weather].setVariable (4ms)
+523ms ║║Executed virtual command [A Weather].setVariable (4ms)
+529ms ║║Calculating (string) Wind speed = + (string) 5 >> (string) Wind speed = 5
+533ms ║║Wind speed = 5
+533ms ║║Executed virtual command [A Weather].log (1ms)
+539ms ║║Calculating (string) Speed from Weather = + (string) 5 >> (string) Speed from Weather = 5
+543ms ║║Speed from Weather = 5
+544ms ║║Executed virtual command [A Weather].log (1ms)
+548ms ║║Comparison (integer) 5 changes = false (1ms)
+549ms ║║Condition #22 evaluated false (3ms)
+551ms ║║Comparison (integer) 5 changes = true (0ms)
+553ms ║║Cancelling condition #23’s schedules…
+553ms ║║Condition #23 evaluated true (3ms)
+554ms ║║Cancelling condition #18’s schedules…
+555ms ║║Condition group #18 evaluated true (state changed) (9ms)
+557ms ║║Cancelling statement #19’s schedules…
+560ms ║║Executed virtual command wait (0ms)
+561ms ║║Requesting a wake up for Sat, May 12 2018 @ 7:10:21 PM CEST (in 2.0s)
+569ms ║║Fast executing schedules, waiting for 1995ms to sync up
+2599ms ║║Calculating (string) — + (string) 19:10 >> (string) — 19:10
+2602ms ║║Calculating (string) — 19:10 + (string) on >> (string) — 19:10 on
+2605ms ║║Calculating (string) — 19:10 on + (string) 12 >> (string) — 19:10 on 12
+2608ms ║║Calculating (string) — 19:10 on 12 + (string) of >> (string) — 19:10 on 12 of
+2611ms ║║Calculating (string) — 19:10 on 12 of + (string) May >> (string) — 19:10 on 12 of May
+2613ms ║║Calculating (string) — 19:10 on 12 of May + (string) >> (string) — 19:10 on 12 of May
+2619ms ║║Calculating (string) Wind Speed + (string) 5 >> (string) Wind Speed 5
+2623ms ║║Calculating (string) Wind Speed 5 + (string) MPH and >> (string) Wind Speed 5 MPH and
+2626ms ║║Calculating (string) Wind Speed 5 MPH and + (string) 5 >> (string) Wind Speed 5 MPH and 5
+2630ms ║║Calculating (string) Wind Speed 5 MPH and 5 + (string) MPH >> (string) Wind Speed 5 MPH and 5 MPH
+2633ms ║║Calculating (string) Wind Speed 5 MPH and 5 MPH + (string) >> (string) Wind Speed 5 MPH and 5 MPH
+2635ms ║║Calculating (string) Wind Speed 5 MPH and 5 MPH + (string) — 19:10 on 12 of May >> (string) Wind Speed 5 MPH and 5 MPH — 19:10 on 12 of May
+2637ms ║║Calculating (string) Wind Speed 5 MPH and 5 MPH — 19:10 on 12 of May + (string) >> (string) Wind Speed 5 MPH and 5 MPH — 19:10 on 12 of May
+2640ms ║║Executed virtual command setState (1ms)
+2644ms ║╚Execution stage complete. (2409ms)
+2645ms ║Setting up scheduled job for Sat, May 12 2018 @ 7:12:17 PM CEST (in 115.947s)
+2654ms ╚Event processed successfully (2654ms)


#12

Ahh, I see it now. At the top, you have Wind_speed as an integer, yet you are trying to write text (MPH) to it. Also note that current conditions is a decimal.

I would gather the data and set as a variable in decimal format. You can always make a second variable with MPH at the end, but you need the pure number to do math on.

EDIT to show examples
Here I changed the integers to decimals, and added a new variable for the string:

Here is the new code (notice the MPH and \n is removed for Wind_speed):
02

And here is the logs:
03

You will likely need to follow jkp’s advice below as well, just make sure all checks are on the Wind_speed, not the Wind_speed_info variable.


#14

(Edit, it’s WORKING, it probably just needed a few minutes to get webCoRE grinding properly.)
Edit number 2, i need to move my Push notifications further up, just below the set variables, because if nothing changes, the piston stops before the notifications…
@WCmore Can you kindly check that i copied your changes correctly please {or send me your version)? Because i’m still not getting notifications, and i’ve lowered my prerequisite to only 1 MPH. i added @jkp changes also, hopefully correctly.

12/05/2018, 20:26:50 +277ms
+0ms ╔Received event [Home].time = 1526149611835 with a delay of -1558ms
+249ms ║RunTime Analysis CS > 53ms > PS > 69ms > PE > 127ms > CE
+252ms ║Runtime (49466 bytes) successfully initialized in 69ms (v0.3.104.20180323) (251ms)
+253ms ║╔Execution stage started
+627ms ║║Executed virtual command [A Weather].setVariable (3ms)
+632ms ║║Calculating (string) 1.9 + (string) MPH
+632ms ║║ >> (string) 1.9 MPH
+636ms ║║Executed virtual command [A Weather].setVariable (3ms)
+645ms ║║Executed virtual command [A Weather].setVariable (2ms)
+650ms ║║Calculating (string) Wind speed = + (string) 1.9 >> (string) Wind speed = 1.9
+654ms ║║Wind speed = 1.9
+655ms ║║Executed virtual command [A Weather].log (1ms)
+660ms ║║Calculating (string) Speed from Weather = + (string) 1.9 >> (string) Speed from Weather = 1.9
+664ms ║║Speed from Weather = 1.9
+665ms ║║Executed virtual command [A Weather].log (1ms)
+671ms ║║Calculating (string) Wind Speed Info = + (string) 1.9 MPH
+671ms ║║ >> (string) Wind Speed Info = 1.9 MPH
+675ms ║║Wind Speed Info = 1.9 MPH
+675ms ║║Executed virtual command [A Weather].log (1ms)
+680ms ║║Comparison (decimal) 1.9 changes = false (0ms)
+681ms ║║Condition #22 evaluated false (3ms)
+683ms ║║Comparison (decimal) 1.9 changes = false (1ms)
+684ms ║║Condition #23 evaluated false (3ms)
+690ms ║║Condition #24 evaluated false (5ms)
+690ms ║║Condition group #18 evaluated false (state did not change) (12ms)
+693ms ║╚Execution stage complete. (440ms)
+695ms ║Setting up scheduled job for Sat, May 12 2018 @ 8:28:47 PM CEST (in 116.988s)
+702ms ╚Event processed successfully (702ms)


#15

It’s WORKING! HALLELUJAH!
HALLELUJAH!!
Thank you guys SO much! @WCmore if you were a girl I’d offer to give you babies! @jkp if you were a girl I’d probably just give you a quick kiss on the cheek.
Truly amazing, now I can adjust the notifications, and FINALLY be able to close my mosquito net when the wind goes above X. I’ve been on this 2 weeks!!


#16

Glad it is working for you… The 3 log lines are optional, and are not really needed for functionality. I often add lines like these when making new pistons so I see exactly what the device is returning. Once I am happy with my piston, I often delete/disable those log lines.

I would definitely delete line 48 in your last pic, since that is redundant.

After looking at your five embedded IF commands, I suspect that you will have problems. If line 53 is false, then none of the other variables will be checked. If it were me, I would condense the last four IF’s down to only one. (I realize you were trying many methods in your testing, but it is a good habit to consolidate and simplify before considering it completed)


#17

Hey @WCmore can you check what i have now? Does it look cleaner?
I added Wind direction which seems to be working fine, showing in piston state and in notifications.
I’m using to calls for wind, one from {$weather.conditions.current_observation.wind_mph}, the other from the Smart weather station tile, which are probably the same thing, I’m using two because i was occasionally getting “null” values from {$weather.conditions.current_observation.wind_mph} but i think we fixed that because it previously had and extra “MPH” on the end. so i may just go back to using ONE wind source.
Also i’m using {Wind_Speed_Info} for push notification, but think i’m getting the “\n” after the MPH so may go back to {Wind_Speed} and just add MPH.
By the way, just realised you’re responsible for that epic day length Solstice piston, gonna try that soon…


#18

It is looking better for sure! I do have a couple of observations though:

(1) From what I see, the variables are only written once per hour. If this is your intention, then be aware that lines 68-79 will also only trigger once per hour. (So if the bad wind starts at 5:26, your blinds will not change for 59 minutes) If you want quicker response on your blinds, you can change line 69 from “Variable” to “Physical device” and choose your “Temperature sensor 1” instead. Also, for line 69, if you want to use “is greater than”, then you need to manually subscribe to that line as well. (or changing it to a trigger will also work)

(2) Lines 46-50 looks like you will get a notification every single time this piston runs (since the wind is always changing). Might need to re-think that section…

(3) Yes, I get either 0 or null about once every 200-300 runs on ALL my reoccurring queries to WUnderground. Thankfully, I have never seen it spike up, so that part should work as intended. (Even if WUnderground sends bad data.)

(4) Guilty as charged for the Solstice piston creation. That one sure was a lot of fun, and a great learning experience for me! Once I get a new telescope, I hope to make more astronomical pistons.


#19

With regards (1) I changed to the ‘Physical Device’ of “Temperature sensor 1” and set “Wind”, but the only Triggers available from the drop down menu are “changes etc” and “stays etc”, it doesn’t have “Is greater than”. So it wouldn’t work, that’s why i had to use a Variable, any ideas?
I’ll try just using an Expression,
IF {$weather.conditions.current_observation.wind_mph}
is Greater than 17
Then…
But does that mean Webcore is continuously polling WUnderground, every second??
And regards the notifications, they are only being triggered on the “Is greater than” as it’s a “when true”, so not on “Wind changes”.


#20

I am a huge fan of using variables to prevent needless polling. I imported your last piston, and made a few adjustments to prevent that. You will notice there are two main blocks. The first block runs every 10 minutes, and all it does is get the current wind, and close the blinds if it is too windy. The second block runs once per hour, and only focuses on your notifications. I did clean up the extra commands a bit, and put two comments in there to point out where you can switch over to the other wind sensor if you wish.

Also note that since I don’t have the same devices as you, everywhere you see xxxx0 it is your temp sensor, and everywhere you see xxxx1 it is your blinds.

Line 70 should only notify you when the wind increases over 8. You won’t get a second notification unless the wind dies down, then increases again. I think this is what you want to happen.


#21

Wow, this looks extremely accomplished. I really appreciate you helping to get this done for me. If I could give you two “Solutions” I would, because you deserve it. One question, as the “set piston state” was left out by mistake, where would you recommend placing it, which line, OR should I create another block, IF Wind_speed changes Then set piston state… Because ideally I’d only want the piston state to update on a wind speed change, not every X minutes, that way by looking at the time stamp I can get a better feel for the weather. Edit, it’s there, just found it, just not updating if under 8 mph.


#22

Set piston state is still updated once per hour like in your previous piston, (line 74) but it only updates when the wind is over 8MPH. If you want the piston state updated more frequently, you can move it to line 39 after the Set variable. It will then update every ten minutes. (Little or no extra resources are used for updating the piston state)

EDIT
Just a heads up. Most sensors will show a wind change every few seconds. Perhaps limiting the check to every ten minutes like suggested above will be less of a resource hog than changing it whenever the wind changes. (because in all honesty, every time it is checked (unless it is 0) it will be different than the last time it was checked)


#23

Here is a tiny example showing how frequently the wind changes speed in my area.
(using the same command as you)
$weather.conditions.current_observation.wind_mph
This is a ten hour period, with the wind speed being stored every ten minutes

It literally goes up and down each and every time.

I made a few improvements, and now another data point is documenting the wind based on the average of the previous 4 readings (40 minutes). Even though the top number never reaches the real top number, I find it more useful for seeing patterns or trends. Here is the same time period with average wind speeds:

(Notice the 6 MPH is not shown here)

The code behind this is a bit complex, and I have not polished it up, but it has been working reliably for many months.


#24

Fascinating, i can see i’m going to have to change my thinking about the wind, because as you say, the wind does jump around alot, the chances of it being the same speed after 3/4 10 minute refreshe cycles are quite slim. So i could just include it in the 10 minute refresh, i’m just so used to seeing the pistons of things i’m tracking, like Rain, Doorbell, Arrival sensor RSSI, garden irrigation, going hours not updating, so i’m used to seeing the time stamp of when it last happened, but i guess with wind its going to be more continuous change. Which makes sense. So i may just take the time stamp off the piston state as i’ll know the wind was correct as of now or last 10 minutes. Anyway looking at your wind graph, the spike around sunset i usually see close to large bodies of water. But once i’ve got this new toy fully embedded, i’ll grab your Solstice piston as i see you’re finalizing the Day graph you’re happy with… Edit. Or I may just create my own Solstice piston to compete with yours :wink: :rofl:


#25

Well, the block that closes the blinds if the wind goes above x MPH should work as expected. Personally, I would not want to be notified whenever the wind changes speed, since the wind is regularly irregular, LOL

Writing the averages to a fuel stream seemed to be the solution for me. Out of sight unless I click a button. Although I did create a tile for quick info.

temp

(Current wind, average wind, and current gust)


#26

And just a note about my Solstice piston. It is not possible to import and run that piston. It won’t work. You can import it to save you most of the long typing parts, but the math is still required to be done once to make it work for your location. Let me know when the time comes and I will be glad to help.