First piston - looking for advice


#1

1) Give a description of the problem
Don’t know if i have a problem - just want a sanity check

2) What is the expected behavior?
I have a lwrf socket with a fan heater plugged in. Haven’t integrated ST and LWRF so i’m triggering this on a sim switch using ifttt.
I have a work schedule that means sometimes i’m on earlies and sometimes on lates, unless asked to switch to cover someone else. I also generally work mon,wed,fri at home. If i’m due to work from home then i want the fan heater on for 30 mins before i start.

I’ve chosen to use a sim switch to indicate my shift to ST. Earlies can be switched on or off (via alexa, which makes it easier)

So basically, if i’m on earlies, the fan heater should come on at 5:30, if i’m on lates then 9:30

3) What is happening/not happening?
as this is my first piston, i just want some advice - does it look right? Are there smarter/better ways of doing when i’m doing? Can’t really use modes to decide whether i’m working from home or not, but have used them to ( i think) ensure it won’t fire if i’m away from home

4) Post a Green Snapshot of the pistonimage
(UPLOAD YOUR IMAGE HERE)

5) Attach any logs (From ST IDE and by turning logging level to Full)
(PASTE YOUR LOGS HERE BETWEEN THE MARKS THEN HIGHLIGHT ALL OF THE LOGS SND CLICK ON THE </> ICON TO FORMAT THEM)
No logs collected as yet


#2

switch 6 - fan heater.
switch 1 - ‘earlies’


#3

Looks right to me… you can also just break it down into 2 separate Ifs just for easy reading.

if
  time happens at 05:00
  and switch 1 is on
then
  action
end if

if
  time happens at 09:30
  and switch 1 is off
then
  action
end if