Turn heat for an hour at a time at different times of night


#1

1) Give a description of the problem
I’m clearly terrible at trying to create pistons from scratch. Could somebody help fix this for me and explain why it’s not working like I’m expecting.

2) What is the expected behavior?
At 8pm, 11pm, 2am, and 3am, I’d like to check the temperature sensors in the kids bedrooms. If any sensor is less than 63F, then the heaters should turn on, run for an hour and turn off.

3) What is happening/not happening?
The heater seem to be turning on at random times throughout the day.

**4) Post a Green Snapshot of the piston![image|45x37]


#2

Instead of using time is between there is an option of happens daily at. Use this since you are not looking for a range of time.

Can’t comment in much else without the logs.


#3

Here’s the Log, I turned the heaters off at 8:01, at 8:03 they turned themselves back on and have been on ever since:

dc2ea03e-a5fe-4822-9c66-bc34defa0876 8:03:02 PM: debug Updating Controller State: switch -> [on, on]
dc2ea03e-a5fe-4822-9c66-bc34defa0876 8:03:02 PM: debug getChildDevices(false), children=1
dc2ea03e-a5fe-4822-9c66-bc34defa0876 8:03:01 PM: debug Device state change: Tori’s Outlet -> switch = on
dc2ea03e-a5fe-4822-9c66-bc34defa0876 8:03:01 PM: debug Device state change: Jacks Heater -> switch = on
dc2ea03e-a5fe-4822-9c66-bc34defa0876 8:03:00 PM: debug Running command ‘on’ with arguments [] on [Jacks Heater, Tori’s Outlet]…
dc2ea03e-a5fe-4822-9c66-bc34defa0876 8:01:09 PM: debug Device state change: Tori’s Outlet -> switch = off
dc2ea03e-a5fe-4822-9c66-bc34defa0876 8:01:08 PM: debug Updating Controller State: switch -> [off, on]
dc2ea03e-a5fe-4822-9c66-bc34defa0876 8:01:08 PM: debug getChildDevices(false), children=1
dc2ea03e-a5fe-4822-9c66-bc34defa0876 8:01:07 PM: debug Device state change: Jacks Heater -> switch = off
dc2ea03e-a5fe-4822-9c66-bc34defa0876 8:01:06 PM: debug Running command ‘off’ with arguments [] on [Jacks Heater, Tori’s Outlet]…


#4

Check this out for how to get logs


#5


#6

So I changed my original piston to happens daily at instead of the between times and it worked perfect last night. I guess saying time between 8:00pm and 8:00pm confuses the system, maybe it makes it think it should be running all day.


#7

Glad you got it. To shorten up the code for easy future changes you can set it up like @Baz2473 did above. Helps cut down on repetitive actions