Help fixing Weather lighting piston


#1

First part of piston is working but second (else) does nothing. Please help

4/22/2019, 5:40:28 PM +150ms
+1ms ╔Received event [Home].test = 1555969228150 with a delay of 0ms
+119ms ║RunTime Analysis CS > 19ms > PS > 64ms > PE > 35ms > CE
+123ms ║Runtime (39288 bytes) successfully initialized in 64ms (v0.3.10a.20190223) (120ms)
+125ms ║╔Execution stage started
+181ms ║║Comparison (time) 63628285 is_between (time) 1555928280000 … (time) 1555905600000 = true (17ms)
+183ms ║║Time restriction check passed
+186ms ║║Condition #3 evaluated true (52ms)
+191ms ║║Cancelling statement #3’s schedules…
+212ms ║║Requesting time schedule wake up at Tue, Apr 23 2019 @ 12:00:00 AM EDT
+335ms ║║Comparison (dynamic) Partly Cloudy is_not (string) '“clear”, “partly cloudy” = true (3ms)
+338ms ║║Condition #4 evaluated true (118ms)
+340ms ║║Condition group #2 evaluated true (state did not change) (206ms)
+344ms ║║Cancelling statement #10’s schedules…
+356ms ║║Skipped execution of physical command [Kitchen Virtual Switch].on([]) because it would make no change to the device. (4ms)
+358ms ║║Executed [Kitchen Virtual Switch].on (8ms)
+397ms ║╚Execution stage complete. (273ms)
+402ms ║Setting up scheduled job for Tue, Apr 23 2019 @ 12:00:00 AM EDT (in 22771.449s), with 1 more job pending
+416ms ╚Event processed successfully (415ms)


#2

I believe this will help. Remove your " " from your IF line 20 and 31


#3

I think you can only compare the $twcweather.conditions.cloudCoverPhrase to one string at a time. If you want the switch on when the CoverPhrase is “clear” or “partly Cloudy”, use two if statements with an OR between them. You also do not need the second if statement at all, just use the else statement and turn the switch off with it.
If CoverPhrase = “Clear”
or
if CoverPhrase = “partly cloudy”
Then do
Turn On
Else
Turn Off


#4

I believe @PhilR is correct. I cannot get it to work with “Clear, Partly Cloudy”


#6

Everything’s working perfectly now, thank you for all your help.