So what I am trying to do is automate my lights when it rains (or is about to rain) based upon actual rain and/or brightness.
[{"id":"b0ac56a3.14b0b","type":"group","z":"7a0ffcea.de3a54","style":{"stroke":"#999999","stroke-opacity":"1","fill":"none","fill-opacity":"1","label":true,"label-position":"nw","color":"#a4a4a4"},"nodes":["e3dbcb57.687d4","b8a8c403.b87ee","85f3e449.3eb898","e0d34db1.f54e5","7223ec83.b63cb4","9837e699.7d213","712792f3.d207ec","f95af390.d0c938","93afa541.6d713","b049579d.629cb","f468af3f.2d87e","da60540e.42544","c85c8b8.147c9f8","4ae9b03f.9fc628","d0017bdb.924aa","654c3d9f.be8ee4","856a4490.691c78","fd1439f1.5b89e","f5101082.61de8","56a2793a.b5a8e","940abb03.495378"],"x":4,"y":2939,"w":1022,"h":462},{"id":"e3dbcb57.687d4","type":"comment","z":"7a0ffcea.de3a54","g":"b0ac56a3.14b0b","name":"Rain Automations","info":"","x":150,"y":2980,"wires":[]},{"id":"b8a8c403.b87ee","type":"server-state-changed","z":"7a0ffcea.de3a54","g":"b0ac56a3.14b0b","name":"Rain?","server":"8efa78ba.f10338","version":3,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"binary_sensor.smartweather_raining","entityidfiltertype":"exact","outputinitially":false,"state_type":"str","haltifstate":"","halt_if_type":"str","halt_if_compare":"is","outputs":1,"output_only_on_state_change":true,"for":0,"forType":"num","forUnits":"minutes","ignorePrevStateNull":false,"ignorePrevStateUnknown":false,"ignorePrevStateUnavailable":false,"ignoreCurrentStateUnknown":false,"ignoreCurrentStateUnavailable":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"eventData"},{"property":"topic","propertyType":"msg","value":"","valueType":"triggerId"}],"x":80,"y":3060,"wires":[["e0d34db1.f54e5"]]},{"id":"85f3e449.3eb898","type":"server-state-changed","z":"7a0ffcea.de3a54","g":"b0ac56a3.14b0b","name":"Outdoor Lux","server":"8efa78ba.f10338","version":3,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"sensor.smartweather_brightness","entityidfiltertype":"exact","outputinitially":false,"state_type":"str","haltifstate":"","halt_if_type":"str","halt_if_compare":"is","outputs":1,"output_only_on_state_change":true,"for":0,"forType":"num","forUnits":"minutes","ignorePrevStateNull":false,"ignorePrevStateUnknown":false,"ignorePrevStateUnavailable":false,"ignoreCurrentStateUnknown":false,"ignoreCurrentStateUnavailable":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"eventData"},{"property":"topic","propertyType":"msg","value":"","valueType":"triggerId"}],"x":100,"y":3140,"wires":[["7223ec83.b63cb4"]]},{"id":"e0d34db1.f54e5","type":"switch","z":"7a0ffcea.de3a54","g":"b0ac56a3.14b0b","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"None","vt":"str"},{"t":"else"}],"checkall":"true","repair":false,"outputs":2,"x":250,"y":3060,"wires":[["712792f3.d207ec"],["9837e699.7d213"]]},{"id":"7223ec83.b63cb4","type":"switch","z":"7a0ffcea.de3a54","g":"b0ac56a3.14b0b","name":"","property":"payload","propertyType":"msg","rules":[{"t":"lt","v":"10000","vt":"str"},{"t":"gt","v":"30000","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":250,"y":3140,"wires":[["9837e699.7d213"],["d0017bdb.924aa","856a4490.691c78","fd1439f1.5b89e"]]},{"id":"9837e699.7d213","type":"time-range-switch","z":"7a0ffcea.de3a54","g":"b0ac56a3.14b0b","name":"","lat":"","lon":"","startTime":"10:00","endTime":"dusk","startOffset":0,"endOffset":"-30","x":420,"y":3140,"wires":[["f95af390.d0c938","f468af3f.2d87e","c85c8b8.147c9f8"],[]]},{"id":"712792f3.d207ec","type":"api-current-state","z":"7a0ffcea.de3a54","g":"b0ac56a3.14b0b","name":"Outdoor Lux","server":"8efa78ba.f10338","version":2,"outputs":1,"halt_if":"","halt_if_type":"str","halt_if_compare":"is","entity_id":"sensor.smartweather_brightness","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":490,"y":3000,"wires":[["7223ec83.b63cb4"]]},{"id":"f95af390.d0c938","type":"api-current-state","z":"7a0ffcea.de3a54","g":"b0ac56a3.14b0b","name":"Mode","server":"8efa78ba.f10338","version":2,"outputs":1,"halt_if":"","halt_if_type":"str","halt_if_compare":"is","entity_id":"input_select.ha_modes","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":540,"y":3100,"wires":[["93afa541.6d713"]]},{"id":"93afa541.6d713","type":"switch","z":"7a0ffcea.de3a54","g":"b0ac56a3.14b0b","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"Day","vt":"str"},{"t":"eq","v":"Guest","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":660,"y":3100,"wires":[["b049579d.629cb"],["b049579d.629cb"]]},{"id":"b049579d.629cb","type":"api-call-service","z":"7a0ffcea.de3a54","g":"b0ac56a3.14b0b","name":"Inside Lights","server":"8efa78ba.f10338","version":3,"debugenabled":false,"service_domain":"light","service":"","entityId":"light.bar_light, light.dining_room_light, light.entryway_lower_chandelier, light.entryway_stairway_lights, light.entryway_upper_chandelier, light.family_room_bookcase, light.family_room_christmas_tree, light.family_room_christmas_tree, light.family_room_hallway1, light.family_room_hallway_2, light.family_room_lights, light.living_room_main_lights, light.living_room_sconces, light.living_room_single_light, light.upstairs_hallway_1, light.upstairs_hallway_2","data":"{\"brightness\":\"100\"}","dataType":"json","mergecontext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":810,"y":3100,"wires":[[]]},{"id":"f468af3f.2d87e","type":"change","z":"7a0ffcea.de3a54","g":"b0ac56a3.14b0b","name":"Hue Rain Scene","rules":[{"t":"set","p":"payload","pt":"msg","to":"{\"status\":1}","tot":"json"}],"action":"","property":"","from":"","to":"","reg":false,"x":610,"y":3160,"wires":[["da60540e.42544"]]},{"id":"da60540e.42544","type":"http request","z":"7a0ffcea.de3a54","g":"b0ac56a3.14b0b","name":"","method":"PUT","ret":"txt","paytoqs":"ignore","url":"http://192.168.7.92/api/xW5t9wkluWOq5pLawpAEuK-r7CVyk8ha6GDoeOXF/sensors/44/state/1:80","tls":"","persist":false,"proxy":"","authType":"","x":800,"y":3160,"wires":[[]]},{"id":"c85c8b8.147c9f8","type":"api-call-service","z":"7a0ffcea.de3a54","g":"b0ac56a3.14b0b","name":"Outdoor Lights (non-hue)","server":"8efa78ba.f10338","version":3,"debugenabled":false,"service_domain":"light","service":"turn_on","entityId":"light.frontgate","data":"{\"brightness\":\"100\"}","dataType":"json","mergecontext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":640,"y":3200,"wires":[["56a2793a.b5a8e"]]},{"id":"4ae9b03f.9fc628","type":"api-call-service","z":"7a0ffcea.de3a54","g":"b0ac56a3.14b0b","name":"Inside Lights","server":"8efa78ba.f10338","version":3,"debugenabled":false,"service_domain":"light","service":"turn_off","entityId":"light.bar_light, light.dining_room_light, light.entryway_lower_chandelier, light.entryway_stairway_lights, light.entryway_upper_chandelier, light.family_room_bookcase, light.family_room_christmas_tree, light.family_room_christmas_tree, light.family_room_hallway1, light.family_room_hallway_2, light.family_room_lights, light.living_room_main_lights, light.living_room_sconces, light.living_room_single_light, light.upstairs_hallway_1, light.upstairs_hallway_2","data":"","dataType":"json","mergecontext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":670,"y":3260,"wires":[[]]},{"id":"d0017bdb.924aa","type":"change","z":"7a0ffcea.de3a54","g":"b0ac56a3.14b0b","name":"Hue Rain Scene","rules":[{"t":"set","p":"payload","pt":"msg","to":"{\"status\":0}","tot":"json"}],"action":"","property":"","from":"","to":"","reg":false,"x":610,"y":3320,"wires":[["654c3d9f.be8ee4"]]},{"id":"654c3d9f.be8ee4","type":"http request","z":"7a0ffcea.de3a54","g":"b0ac56a3.14b0b","name":"","method":"PUT","ret":"txt","paytoqs":"ignore","url":"http://192.168.7.92/api/xW5t9wkluWOq5pLawpAEuK-r7CVyk8ha6GDoeOXF/sensors/44/state:80","tls":"","persist":false,"proxy":"","authType":"","x":800,"y":3320,"wires":[[]]},{"id":"856a4490.691c78","type":"api-call-service","z":"7a0ffcea.de3a54","g":"b0ac56a3.14b0b","name":"Outdoor Lights (non-hue)","server":"8efa78ba.f10338","version":3,"debugenabled":false,"service_domain":"light","service":"turn_off","entityId":"light.frontgate","data":"","dataType":"json","mergecontext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":640,"y":3360,"wires":[["940abb03.495378"]]},{"id":"fd1439f1.5b89e","type":"api-current-state","z":"7a0ffcea.de3a54","g":"b0ac56a3.14b0b","name":"Mode","server":"8efa78ba.f10338","version":2,"outputs":1,"halt_if":"","halt_if_type":"str","halt_if_compare":"is","entity_id":"input_select.ha_modes","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":420,"y":3200,"wires":[["f5101082.61de8"]]},{"id":"f5101082.61de8","type":"switch","z":"7a0ffcea.de3a54","g":"b0ac56a3.14b0b","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"Day","vt":"str"},{"t":"eq","v":"Guest","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":500,"y":3240,"wires":[["4ae9b03f.9fc628"],["4ae9b03f.9fc628"]]},{"id":"56a2793a.b5a8e","type":"api-call-service","z":"7a0ffcea.de3a54","g":"b0ac56a3.14b0b","name":"Outdoor Lights (non-hue)","server":"8efa78ba.f10338","version":3,"debugenabled":false,"service_domain":"light","service":"turn_on","entityId":"light.front_yard_garage_lights, light.front_yard_pathway_lights","data":"{\"brightness\":\"100\"}","dataType":"json","mergecontext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":890,"y":3200,"wires":[[]]},{"id":"940abb03.495378","type":"api-call-service","z":"7a0ffcea.de3a54","g":"b0ac56a3.14b0b","name":"Outdoor Lights (non-hue)","server":"8efa78ba.f10338","version":3,"debugenabled":false,"service_domain":"light","service":"turn_off","entityId":"light.front_yard_garage_lights, light.front_yard_pathway_lights, light.frontgate","data":"","dataType":"json","mergecontext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":890,"y":3360,"wires":[[]]},{"id":"8efa78ba.f10338","type":"server","name":"Home Assistant","version":1,"legacy":false,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true}]
Excuse the organization or general confusion created by the various nodes as I am hardly any kind of programmer.
Anyway, this is the logic that I need help with.
I clearly do not want the lights coming on in the morning (when the brightness is low) thus the time restriction beginning at 10:00 a.m.). However, the result of the flow is that the lights now periodically go on/off throughout the day because the lux is < 10000 or > 30000 and this is not the intended result.
I am trying to define a logical way to only turn on the lights WHEN I go below 10000 and turn off the lights when I go ABOVE 30000.
I was thinking about a global.no_rain variable but am running into logical and technical difficulty on how to implement.