Control light with temp sensor


#1

I have a motion sensor with temperature, a light and a switch
Using the motion sensor’s temperature I want to turn the light on and off
When switch is off and
If temp is less than 63 - switch on
If Temp greater than 64 - switch off
If
Switch is on
If temp is less than 68 - switch on
if temp is greater than 70 - switch off

With switch off and temp below 63 the switch comes on
but will not turn off when temp comes back up past 64


#2

I would start with pulling all the nested “IF”'s out from the first one. So line 25 & 34 & 44 should not be part of the first line 17 IF block.


#3

Thanks
Does this look better


#4

Yes! This should trigger correctly. What’s left is the line 47 ELSE IF, I would move everything from that LINE 47 down into its own IF as well. After that you should be able to test and see if this all works correctly for you.


#5

Thanks for your help seems to be working great