Piston only firing twice a day. want it to fire everytime the weather changes


#1

1) Give a description of the problem
Have piston condition set for between sunrise and sunset but its only fires at sunrise and at sunset

2) What is the expected behavior?
(PUT YOUR INFO HERE)

3) What is happening/not happening?
(PUT YOUR INFO HERE)

Received event [Home].test = 1556144383726 with a delay of 0ms
+153ms ║RunTime Analysis CS > 24ms > PS > 78ms > PE > 51ms > CE
+157ms ║Runtime (54777 bytes) successfully initialized in 78ms (v0.3.10a.20190223) (154ms)
+159ms ║╔Execution stage started
+217ms ║║Comparison (time) 65983896 is_after (time) 1556100900000 = true (15ms)
+219ms ║║Time restriction check passed
+222ms ║║Condition #3 evaluated true (53ms)
+225ms ║║Cancelling statement #3’s schedules…
+238ms ║║Requesting time schedule wake up at Thu, Apr 25 2019 @ 12:00:00 AM EDT
+400ms ║║Comparison (dynamic) 30 is_equal_to (integer) 3 = false (4ms)
+403ms ║║Condition #18 evaluated false (158ms)
+415ms ║║Comparison (dynamic) 30 is_equal_to (integer) 4 = false (4ms)
+418ms ║║Condition #19 evaluated false (13ms)
+431ms ║║Comparison (dynamic) 30 is_equal_to (integer) 5 = false (3ms)
+434ms ║║Condition #20 evaluated false (14ms)
+447ms ║║Comparison (dynamic) 30 is_equal_to (integer) 6 = false (3ms)
+450ms ║║Condition #21 evaluated false (13ms)
+462ms ║║Comparison (dynamic) 30 is_equal_to (integer) 7 = false (3ms)
+465ms ║║Condition #22 evaluated false (13ms)
+477ms ║║Comparison (dynamic) 30 is_equal_to (integer) 8 = false (3ms)
+480ms ║║Condition #23 evaluated false (12ms)
+492ms ║║Comparison (dynamic) 30 is_equal_to (integer) 9 = false (3ms)
+495ms ║║Condition #24 evaluated false (13ms)
+506ms ║║Comparison (dynamic) 30 is_equal_to (integer) 10 = false (4ms)
+510ms ║║Condition #25 evaluated false (12ms)
+522ms ║║Comparison (dynamic) 30 is_equal_to (integer) 11 = false (3ms)
+526ms ║║Condition #26 evaluated false (13ms)
+537ms ║║Comparison (dynamic) 30 is_equal_to (integer) 12 = false (3ms)
+540ms ║║Condition #27 evaluated false (11ms)
+551ms ║║Comparison (dynamic) 30 is_equal_to (integer) 13 = false (3ms)
+554ms ║║Condition #28 evaluated false (12ms)
+565ms ║║Comparison (dynamic) 30 is_equal_to (integer) 14 = false (3ms)
+568ms ║║Condition #29 evaluated false (12ms)
+579ms ║║Comparison (dynamic) 30 is_equal_to (integer) 15 = false (3ms)
+582ms ║║Condition #30 evaluated false (13ms)
+594ms ║║Comparison (dynamic) 30 is_equal_to (integer) 16 = false (4ms)
+597ms ║║Condition #31 evaluated false (12ms)
+608ms ║║Comparison (dynamic) 30 is_equal_to (integer) 17 = false (3ms)
+611ms ║║Condition #32 evaluated false (13ms)
+622ms ║║Comparison (dynamic) 30 is_equal_to (integer) 18 = false (3ms)
+625ms ║║Condition #33 evaluated false (11ms)
+636ms ║║Comparison (dynamic) 30 is_equal_to (integer) 37 = false (3ms)
+639ms ║║Condition #34 evaluated false (12ms)
+650ms ║║Comparison (dynamic) 30 is_equal_to (integer) 38 = false (2ms)
+653ms ║║Condition #35 evaluated false (12ms)
+664ms ║║Comparison (dynamic) 30 is_equal_to (integer) 39 = false (3ms)
+667ms ║║Condition #36 evaluated false (12ms)
+679ms ║║Comparison (dynamic) 30 is_equal_to (integer) 40 = false (3ms)
+682ms ║║Condition #37 evaluated false (13ms)
+694ms ║║Comparison (dynamic) 30 is_equal_to (integer) 41 = false (3ms)
+697ms ║║Condition #38 evaluated false (12ms)
+708ms ║║Comparison (dynamic) 30 is_equal_to (integer) 42 = false (4ms)
+711ms ║║Condition #39 evaluated false (13ms)
+723ms ║║Comparison (dynamic) 30 is_equal_to (integer) 43 = false (4ms)
+726ms ║║Condition #40 evaluated false (13ms)
+738ms ║║Comparison (dynamic) 30 is_equal_to (integer) 45 = false (3ms)
+741ms ║║Condition #41 evaluated false (12ms)
+752ms ║║Comparison (dynamic) 30 is_equal_to (integer) 26 = false (3ms)
+755ms ║║Condition #42 evaluated false (13ms)
+767ms ║║Comparison (dynamic) 30 is_equal_to (integer) 27 = false (3ms)
+857ms ║║Condition #43 evaluated false (100ms)
+871ms ║║Comparison (dynamic) 30 is_equal_to (integer) 28 = false (4ms)
+874ms ║║Condition #44 evaluated false (14ms)
+876ms ║║Condition group #6 evaluated false (state did not change) (632ms)
+878ms ║║Condition group #2 evaluated false (state did not change) (709ms)
+883ms ║║Cancelling statement #15’s schedules…
+894ms ║║Skipped execution of physical command [Kitchen Virtual Switch].off([]) because it would make no change to the device. (4ms)
+896ms ║║Executed [Kitchen Virtual Switch].off (8ms)
+904ms ║║Condition group #47 evaluated true (state did not change) (1ms)
+915ms ║╚Execution stage complete. (757ms)
+918ms ║Setting up scheduled job for Thu, Apr 25 2019 @ 12:00:00 AM EDT (in 20415.356s)
+933ms ╚Event processed successfully (932ms)


#2

As far as I know, $twcweather cannot be used as a trigger.
You have to actually make a query to know the current iconCode.


#3

can you recommend any other ways of designing this piston?


#4

I use Accu weather to get the Cloud cover value and turn on lights based on that. I store the value in a global variable that updates every 30 mins between certain hours.


#5

I used to make a query every 30 minutes with Weather Underground, but the new $twcweather is soooo ss-ll-oo-ww to update, I’m thinking every hour or two is better.

This is likely the structure I would start off with:

Note:
The TEST button will not do anything with this piston. You have to import it and wait an hour to see it in action.


#6

Thank you soooo much you rock!


#7

I was just working on a similar piston and found this one works pretty well.

I will most likely change the timer to every hour but for now it seems to work correctly.

One thing I did notice yesterday is that $twcweather intermittently reported cloud cover as Partly Cloudy while it was dumping down rain. This may simply be that my reporting station is far enough away that there was a momentary break in the clouds.

I also added a daylight checker so the lights wouldn’t come on in the middle of the night and I already control lights in the morning and evening via ST.

For now it seems to be doing what I want.