webCoRE for Hubitat Updates

can you show the full logs for this running?

I just ran my test programs for these values and they passed.

Thanks for the confirmation that it works. I had to uninstall/reinstall Pushover, not sure what happened. It was receiving the push messages as I saw it in the pushover history, it just wasn't popping up the notification on my phone.

@nh.schottfam

I have recently noticed some strange behavior with some of my pistons. These pistons have been running on my hub for many months with no problems. Now I am seeing pistons executing twice when triggered by an event. For example, I have a piston that turns on a light at a fixed time before sunset. What I am seeing is the piston is executing twice within a minute for the same event (time before sunset) instead of once as would be expected. I am noticing this strange behavior on many similar pistons. The behavior seems to have started with one of the latest updates, but I am not sure which one. Attach is the piston and its log. Thanks for you help in advance.


It would be good to show medium or full logs and an image showing the subscriptions

Here is a full log for the piston. I will post another full log after it executes this evening.

Here is the full log from the last piston execution. Interestingly none of my pistons have exhibited the strange behavior of executing twice since I set them to full logging. I will continue to monitor them and will post the logs if see this behavior occur again.

@nh.schottfam

This evening all of my piston that reference sunset as a trigger executed twice. Here is the detailed log for one of them. I am not sure how to capture a complete log as the log fields on the dashboard have a limited number of lines.

12/28/2020, 4:59:59 PM +817ms
+3ms ╔Received event [Hubitat Hub].time = 1609196400000 with a delay of -183ms, canQueue: true, calledMyself: false
+27ms ║RunTime initialize > 26 LockT > 1ms > rtDT > 2ms > pistonT > 1ms (first state access 23 4 22)
+30ms ║Runtime (8155 bytes) successfully initialized in 2ms (v0.3.110.20201015_HE)
+33ms ║Synchronizing scheduled event, waiting for 150ms
+185ms ║╔Execution stage started
+192ms ║║Comparison (string) :7c76bcf13f4437d56396ddf04776b595: is_not (string) :5fd38bb05278864e858c60e0d78f1eb4: = true (1ms)
+193ms ║║Condition #22 evaluated true (7ms)
+199ms ║║Comparison (time) 61200000 happens_daily_at (time) 63000000 = true (0ms)
+200ms ║║Time restriction check passed
+203ms ║║Condition #7 evaluated true (7ms)
+204ms ║║Cancelling statement #7's schedules...
+212ms ║║Requesting time schedule wake up at Tue, Dec 29 2020 @ 5:00:00 PM CST
+214ms ║║Condition group #1 evaluated true (state did not change) (19ms)
+216ms ║║Cancelling statement #2's schedules...
+232ms ║║Skipped execution of physical command [Hallway Light].on([]) because it would make no change to the device. (13ms)
+233ms ║║Executed [Hallway Light].on (15ms)
+238ms ║║Hallway Light Turned On By Schedule
+241ms ║║Executed virtual command [Hallway Light].log (3ms)
+249ms ║║Calculating (string) On @ + (string)Mon, 12/28 5:00 PM >> (string) On @ Mon, 12/28 5:00 PM
+251ms ║║Calculating (string) On @ Mon, 12/28 5:00 PM + (string) >> (string) On @ Mon, 12/28 5:00 PM
+254ms ║║Executed virtual command [Hallway Light].setState (0ms)
+264ms ║║Comparison (time) 61200000 happens_daily_at (time) 80220000 = false (0ms)
+267ms ║║Condition #17 evaluated false (8ms)
+268ms ║║Cancelling statement #17's schedules...
+286ms ║║Requesting time schedule wake up at Mon, Dec 28 2020 @ 10:20:00 PM CST
+289ms ║║Condition group #16 evaluated false (state did not change) (31ms)
+295ms ║╚Execution stage complete. (110ms)
+334ms ║Setting up scheduled job for Mon, Dec 28 2020 @ 10:20:00 PM CST (in 19200s), with 1 more job pending
+336ms ╚Event processed successfully (335ms)

12/28/2020, 4:59:00 PM +527ms
+7ms ╔Received event [Hubitat Hub].time = 1609196340000 with a delay of 527ms, canQueue: true, calledMyself: false
+79ms ║RunTime initialize > 77 LockT > 2ms > rtDT > 48ms > pistonT > 48ms (first state access 27 9 68)
+82ms ║Runtime (8087 bytes) successfully initialized in 48ms (v0.3.110.20201015_HE)
+86ms ║╔Execution stage started
+93ms ║║Comparison (string) :7c76bcf13f4437d56396ddf04776b595: is_not (string) :5fd38bb05278864e858c60e0d78f1eb4: = true (2ms)
+94ms ║║Condition #22 evaluated true (6ms)
+100ms ║║Comparison (time) 61140000 happens_daily_at (time) 63000000 = true (0ms)
+101ms ║║Time restriction check passed
+102ms ║║Cancelling condition #7's schedules...
+104ms ║║Condition #7 evaluated true (7ms)
+105ms ║║Cancelling statement #7's schedules...
+111ms ║║Requesting time schedule wake up at Mon, Dec 28 2020 @ 5:00:00 PM CST
+112ms ║║Cancelling condition #1's schedules...
+115ms ║║Condition group #1 evaluated true (state changed) (19ms)
+116ms ║║Cancelling statement #2's schedules...
+133ms ║║Executed physical command [Hallway Light].on() (13ms)
+134ms ║║Executed [Hallway Light].on (16ms)
+139ms ║║Hallway Light Turned On By Schedule
+142ms ║║Executed virtual command [Hallway Light].log (3ms)
+150ms ║║Calculating (string) On @ + (string)Mon, 12/28 4:59 PM >> (string) On @ Mon, 12/28 4:59 PM

Here are logs that show my piston executing twice. This piston subscribes to the time of sunset with an offset of 30 minutes. It is not clear to me why it is executing twice.

Could it be that it runs in less than half a second? Maybe it can trigger again at 30 minutes to sunset. Try adding a delay and see what that does.

Just a guess.

You could try using the timer function rather than an if statement for daily tasks. For example:
webcore timer

Also, it might be helpful to split the on and off functions into 2 separate pistons.

Edit: I just noticed you have "Hallway Light's switch is on" as part of the turn off if statement. Since the piston will subscribe to that event, when the light gets turned on, the piston will run, possibly fast enough to trigger the on event again. To prevent the switch's state from causing the piston to run, use it as a precondition instead.

webcore precondition

Also, worth noting, since you appear to have command optimization turned on, that check to see if the switch is already off is redundant. The piston will not send the off command if the switch is already off.

Sorry for the scatter brained replies. I haven't had my coffee yet.

Thanks for everyone's reply. I will give your suggestions a try and see what happens. All of these pistons where migrated from ST and I noticed that on HE they execute much faster (ms vs. sec). The strange thing is that for the last several months I have not see this behavior and now I am seeing it. Not sure what might have changed. Will let you know the results after further testing.

Here is an update on what I discovered and the solution to the problem of the pistons executing twice. Apparently Hubitat updates the sunset and sunrise variables just after midnight. So if a piston runs daily and uses sunset or sunrise as a event trigger, it will reschedule itself to run at the current sunset or sunrise time 24 hours later rather than at the next sunset or sunrise time. So this time of the year when days are getting longer and these pistons execute they see that it is still not sunset time and reschedule to execute again at sunset time. This is why I am seeing double executions. My solution is to create a piston to run at 3:01am and execute each of these pistons. This will cause the pistons to reschedule to execute at sunset time.

1/12/2021, 10:50:05 AM +620ms
+80ms	║Next Sunrise: Wed, Jan 13 2021 @ 7:57:00 AM EST,
+80ms	║Next Sunset: Tue, Jan 12 2021 @ 5:37:00 PM EST,
+80ms	║Sunrise: Tue, Jan 12 2021 @ 7:57:00 AM EST,
+80ms	║Sunset: Tue, Jan 12 2021 @ 5:37:00 PM EST

That is correct - HE uses course updates for sunrise/sunset, but they do change.

The scheduling challenge for next sunrise is it may move (later).

By having the checks for time (or time with offset) that use sunrise and sunset as first level if statements, you can then put an if statement at the end of the piston

Every day at "3:01" (or some time after daylight savings time change) will cause the piston to use the newer value of sunrise. (just to update the timers)

if Time happens daily at 3:01 AM
then
endif

I have a Webcore piston that is supposed to switch on a virtual switch when the humidity from either one of my aeotec Multisensor 6 sensors that for what ever reason won't work unless I run it manually (Test run piston) is there any one that can help?

Set the trigger as:

If
any of devices humidity changes
and
any of devices humidity is greater or equal to 65
and
Location mode is.....
and
Switch is.....

Thank you!! I will change that part of the piston.

Yes, you weren't subscribing to any events in the first IF

Is it possible to extend the length of the piston logs? It would be nice to be able to go back further when issues occur, especially when I have it on full.