Node red - struggling to replicate an automation

Anyone give me an idea on how to replicate this automation?

My specific problem is getting the lights to come on at either sunrise -1hr or 05:45, but never before 05:45am.

Here is my yaml automation:

- id: 'outside_on_am'
  alias: Outside AM on
  initial_state: true
  trigger:
    - platform: sun
      event: sunrise
      offset: '-01:00:00'
    - platform: time
      at: '05:46:00'
  condition:
    - condition: time
      after: '05:45:00'
      before: '09:30:00'
    - condition: state
      entity_id: group.outside
      state: 'off'
  action:
    - service: light.turn_on
      entity_id: light.outside_back_lights
    - service: light.turn_on
      entity_id: light.outside_front_lights
    - service: notify.gmail_notify
      data:
        title: 'Outside lights switched on'
        message: 'the outside lights are now on'

Probably there is more than 1 way to do it, but you can use schedex and time-range-switch nodes for that. if you can’t find them in the pallette, you need to install. good thing is you can also schedex to program the off time as well. it sends 2 messages, at “on time” and “off time”

image

[{"id":"970bd842.b0c4d8","type":"schedex","z":"294e4f5f.46b07","name":"","suspended":false,"lat":"51.16569","lon":"10.45153","ontime":"sunrise","ontopic":"","onpayload":"","onoffset":"-60","onrandomoffset":0,"offtime":"sunset","offtopic":"","offpayload":"","offoffset":0,"offrandomoffset":0,"mon":true,"tue":true,"wed":true,"thu":true,"fri":true,"sat":true,"sun":true,"x":880,"y":600,"wires":[["9d019284.3b919"]]},{"id":"dd63a6cf.3c5b98","type":"api-call-service","z":"294e4f5f.46b07","name":"","server":"e447d17a.16a64","version":1,"service_domain":"light","service":"turn_on","entityId":"group.all_lights","data":"","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":1330,"y":580,"wires":[[]]},{"id":"9d019284.3b919","type":"time-range-switch","z":"294e4f5f.46b07","name":"","lat":"51.16569","lon":"10.45153","startTime":"05:45","endTime":"09:30","startOffset":0,"endOffset":0,"x":1090,"y":580,"wires":[["dd63a6cf.3c5b98"],[]]},{"id":"e447d17a.16a64","type":"server","z":"","name":"Home Assistant","legacy":false,"hassio":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":false}]

Thanks for the tips!

So I think I may have done it.

I used the eztimer node for the trigger times. As you can see I have two of these nodes, one to turn the lights on at 05:45am and the other one acts as a kinda failsafe to tunrn the lights off at the latest time on 9am.

I have also set up a sunlight on/off to turn the lights on if the sunlight is below a certain point at a certain time.

This is all as yet untested, so I’ll report back on it.

[{"id":"b5b1e98c.3cfd88","type":"tab","label":"Outside lights","disabled":false,"info":""},{"id":"3bb804a6.a4f57c","type":"eztimer","z":"b5b1e98c.3cfd88","name":"","autoname":"05:45:00 - sunriseEnd","tag":"eztimer","suspended":false,"sendEventsOnSuspend":false,"lat":"53.00462","lon":"-1.46901","timerType":"1","startupMessage":true,"ontype":"2","ontimesun":"dawn","ontimetod":"05:45:00","onproperty":"payload","onvaluetype":"str","onvalue":"ON","onoffset":0,"onrandomoffset":0,"onsuppressrepeats":false,"offtype":"1","offtimesun":"sunriseEnd","offtimetod":"09:58:00","offduration":"00:01:00","offproperty":"payload","offvaluetype":"str","offvalue":"OFF","offoffset":"30","offrandomoffset":0,"offsuppressrepeats":false,"mon":true,"tue":true,"wed":true,"thu":true,"fri":true,"sat":true,"sun":true,"x":100,"y":60,"wires":[["8245b5b6.172368"]]},{"id":"c8ee648e.422e48","type":"switch","z":"b5b1e98c.3cfd88","name":"","property":"payload","propertyType":"msg","rules":[{"t":"lte","v":"4","vt":"num"},{"t":"gt","v":"4","vt":"num"}],"checkall":"true","repair":false,"outputs":2,"x":430,"y":380,"wires":[["5ec03f09.88fee"],["cc302f5d.131fb"]]},{"id":"8941b781.44adf8","type":"server-state-changed","z":"b5b1e98c.3cfd88","name":"","server":"cfa79f02.db9d4","version":1,"entityidfilter":"sensor.sunlight_pct","entityidfiltertype":"exact","outputinitially":true,"state_type":"str","haltifstate":"","halt_if_type":"str","halt_if_compare":"is","outputs":1,"output_only_on_state_change":true,"x":140,"y":400,"wires":[["c8ee648e.422e48"]]},{"id":"5ec03f09.88fee","type":"change","z":"b5b1e98c.3cfd88","name":"On","rules":[{"t":"set","p":"payload","pt":"msg","to":"On","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":570,"y":300,"wires":[["38216ea5.555c62","9dbf47c1.2aaa28"]]},{"id":"cc302f5d.131fb","type":"change","z":"b5b1e98c.3cfd88","name":"Off","rules":[{"t":"set","p":"payload","pt":"msg","to":"Off","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":570,"y":480,"wires":[["b6abc17c.5a533","8cb4d7b3.9040e8"]]},{"id":"cb31c03.3b4244","type":"eztimer","z":"b5b1e98c.3cfd88","name":"","autoname":"dawn - 09:00:00","tag":"eztimer","suspended":false,"sendEventsOnSuspend":false,"lat":"53.00462","lon":"-1.46901","timerType":"1","startupMessage":true,"ontype":"1","ontimesun":"dawn","ontimetod":"09:57:00","onproperty":"payload","onvaluetype":"str","onvalue":"ON","onoffset":0,"onrandomoffset":0,"onsuppressrepeats":false,"offtype":"2","offtimesun":"dusk","offtimetod":"09:00:00","offduration":"00:01:00","offproperty":"payload","offvaluetype":"str","offvalue":"OFF","offoffset":0,"offrandomoffset":0,"offsuppressrepeats":false,"mon":true,"tue":true,"wed":true,"thu":true,"fri":true,"sat":true,"sun":true,"x":80,"y":120,"wires":[["8245b5b6.172368"]]},{"id":"8245b5b6.172368","type":"switch","z":"b5b1e98c.3cfd88","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"On","vt":"str"},{"t":"eq","v":"Off","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":450,"y":140,"wires":[["e299232.83179e"],["d041f490.0cc618"]]},{"id":"d71ceff5.5d82b","type":"api-call-service","z":"b5b1e98c.3cfd88","name":"Outside lights on","server":"cfa79f02.db9d4","version":1,"service_domain":"light","service":"turn_on","entityId":"group.outside","data":"","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":750,"y":100,"wires":[["37926ec.c807e92"]]},{"id":"a18032f5.85a0d","type":"api-call-service","z":"b5b1e98c.3cfd88","name":"Outside lights off","server":"cfa79f02.db9d4","version":1,"service_domain":"light","service":"turn_off","entityId":"group.outside","data":"","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":750,"y":160,"wires":[["29dc6917.207c76"]]},{"id":"37926ec.c807e92","type":"api-call-service","z":"b5b1e98c.3cfd88","name":"","server":"cfa79f02.db9d4","version":1,"service_domain":"notify","service":"gmail_notify","entityId":"","data":"{\"title\":\"Outside Lights\",\"message\":\"Outside Lights have been switched on\"}","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":967.5000076293945,"y":101.2500114440918,"wires":[["3e969229.28fa7e"]]},{"id":"29dc6917.207c76","type":"api-call-service","z":"b5b1e98c.3cfd88","name":"","server":"cfa79f02.db9d4","version":1,"service_domain":"notify","service":"gmail_notify","entityId":"","data":"{\"title\":\"Outside Lights\",\"message\":\"Outside Lights have been switched off\"}","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":967.5000076293945,"y":161.2500114440918,"wires":[["3e969229.28fa7e"]]},{"id":"3e969229.28fa7e","type":"debug","z":"b5b1e98c.3cfd88","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":1237.5000076293945,"y":121.2500114440918,"wires":[]},{"id":"9dbf47c1.2aaa28","type":"time-range-switch","z":"b5b1e98c.3cfd88","name":"","lat":"53.00462","lon":"-1.46901","startTime":"15:00","endTime":"01:00","startOffset":0,"endOffset":0,"x":770,"y":340,"wires":[["e299232.83179e"],[]]},{"id":"38216ea5.555c62","type":"time-range-switch","z":"b5b1e98c.3cfd88","name":"","lat":"53.00462","lon":"-1.46901","startTime":"05:40","endTime":"09:30","startOffset":0,"endOffset":0,"x":770,"y":280,"wires":[["e299232.83179e"],[]]},{"id":"b6abc17c.5a533","type":"time-range-switch","z":"b5b1e98c.3cfd88","name":"","lat":"53.00462","lon":"-1.46901","startTime":"05:40","endTime":"09:30","startOffset":0,"endOffset":0,"x":770,"y":460,"wires":[["d041f490.0cc618"],[]]},{"id":"8cb4d7b3.9040e8","type":"time-range-switch","z":"b5b1e98c.3cfd88","name":"","lat":"53.00462","lon":"-1.46901","startTime":"15:00","endTime":"01:00","startOffset":0,"endOffset":0,"x":770,"y":520,"wires":[["d041f490.0cc618"],[]]},{"id":"c4ef867a.d3cc38","type":"eztimer","z":"b5b1e98c.3cfd88","name":"","autoname":"sunsetStart - 23:45:00","tag":"eztimer","suspended":false,"sendEventsOnSuspend":false,"lat":"53.00462","lon":"-1.46901","timerType":"1","startupMessage":true,"ontype":"1","ontimesun":"sunsetStart","ontimetod":"05:45:00","onproperty":"payload","onvaluetype":"str","onvalue":"On","onoffset":"-45","onrandomoffset":0,"onsuppressrepeats":false,"offtype":"2","offtimesun":"sunriseEnd","offtimetod":"23:45:00","offduration":"00:01:00","offproperty":"payload","offvaluetype":"str","offvalue":"Off","offoffset":"30","offrandomoffset":true,"offsuppressrepeats":false,"mon":true,"tue":true,"wed":true,"thu":true,"fri":true,"sat":true,"sun":true,"x":100,"y":240,"wires":[["8245b5b6.172368"]]},{"id":"af111b09.53a228","type":"comment","z":"b5b1e98c.3cfd88","name":"Dawn","info":"","x":50,"y":20,"wires":[]},{"id":"9e94dc5e.ef6d9","type":"comment","z":"b5b1e98c.3cfd88","name":"Dusk","info":"","x":50,"y":200,"wires":[]},{"id":"e299232.83179e","type":"api-current-state","z":"b5b1e98c.3cfd88","name":"Already On?","server":"cfa79f02.db9d4","version":1,"outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","override_topic":true,"entity_id":"group.outside","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":570,"y":40,"wires":[[],["d71ceff5.5d82b"]]},{"id":"d041f490.0cc618","type":"api-current-state","z":"b5b1e98c.3cfd88","name":"Already Off?","server":"cfa79f02.db9d4","version":1,"outputs":2,"halt_if":"off","halt_if_type":"str","halt_if_compare":"is","override_topic":true,"entity_id":"group.outside","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":570,"y":220,"wires":[[],["a18032f5.85a0d"]]},{"id":"e6748691.2ec998","type":"inject","z":"b5b1e98c.3cfd88","name":"","topic":"","payload":"On","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":150,"y":660,"wires":[["8245b5b6.172368"]]},{"id":"9672e581.bcd118","type":"inject","z":"b5b1e98c.3cfd88","name":"","topic":"","payload":"Off","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":150,"y":720,"wires":[["8245b5b6.172368"]]},{"id":"79e0c2fc.e76f1c","type":"inject","z":"b5b1e98c.3cfd88","name":"","topic":"","payload":"2","payloadType":"num","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":410,"y":700,"wires":[["c8ee648e.422e48"]]},{"id":"cfa79f02.db9d4","type":"server","z":"","name":"Home Assistant","legacy":false,"hassio":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":false}]

Would you mind sharing the code for this? I can’t really work out what you are doing here!

I’m using schedex to specify a time for lights to come on, based on sunset/sunrise, or just time of day. The master bedroom - evening flow section is just my hack ass way of slowly bringing the lights up as the sun goes down.

Each schedex sends out an on/off topic and on/off payload:

Those payloads just feed straight into the call service:

You could stick a time range node in between, to make sure it’s not before/after a certain time.

1 Like

Ah I see - I love how deferent people have totally different ways of doing things! I’ll have a play with that way on my next flow!

On the same topic - If I wanted to have a light come on at sunrise, however, never before 08:00am, how could I achieve this? The problem with this, as I see it, is that when the sunrise ‘on’ message has been blocked by the time node, the sunrise node does not know to fire the message again as it was previously blocked by the time node.

Is this a case where I would use a pause or delay or something??

It will fire the message again at the next sunrise. It doesn’t know that it got blocked.

Exactly - so (image for example)

I want the light to come on either at sunrise or at 08:00am, but not at sunrise if it is before 08:00am.

Does that make sense?

It makes sense, but you have 2 triggers. 8:00 AM OR sunrise

So make a start to the flow be sunrise, run through the time range node to make sure it is after 8, then to the service call
Then make another start to the flow, and set the time to trigger to be 8, and feed that directly to the service call

1 Like

So my earlier post didn’t work. I was just not getting anything turning on in the morning for some reason. My only guess is that having two dawn light timers were fighting against each other??

As such, I have simplified it a little by adding a repeat trigger.

[{"id":"b5b1e98c.3cfd88","type":"tab","label":"Outside lights","disabled":false,"info":""},{"id":"c8ee648e.422e48","type":"switch","z":"b5b1e98c.3cfd88","name":"","property":"payload","propertyType":"msg","rules":[{"t":"lte","v":"7","vt":"num"},{"t":"gt","v":"7","vt":"num"}],"checkall":"true","repair":false,"outputs":2,"x":430,"y":380,"wires":[["5ec03f09.88fee"],["cc302f5d.131fb"]]},{"id":"8941b781.44adf8","type":"server-state-changed","z":"b5b1e98c.3cfd88","name":"","server":"cfa79f02.db9d4","version":1,"entityidfilter":"sensor.sunlight_pct","entityidfiltertype":"exact","outputinitially":true,"state_type":"str","haltifstate":"","halt_if_type":"str","halt_if_compare":"is","outputs":1,"output_only_on_state_change":true,"x":140,"y":480,"wires":[[]]},{"id":"5ec03f09.88fee","type":"change","z":"b5b1e98c.3cfd88","name":"On","rules":[{"t":"set","p":"payload","pt":"msg","to":"On","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":570,"y":300,"wires":[["38216ea5.555c62","9dbf47c1.2aaa28","3e57e63b.76c7ca"]]},{"id":"cc302f5d.131fb","type":"change","z":"b5b1e98c.3cfd88","name":"Off","rules":[{"t":"set","p":"payload","pt":"msg","to":"Off","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":570,"y":480,"wires":[["b6abc17c.5a533","8cb4d7b3.9040e8","3e57e63b.76c7ca"]]},{"id":"cb31c03.3b4244","type":"eztimer","z":"b5b1e98c.3cfd88","name":"","autoname":"dawn - sunriseEnd","tag":"eztimer","suspended":false,"sendEventsOnSuspend":false,"lat":"53.00462","lon":"-1.46901","timerType":"1","startupMessage":true,"ontype":"1","ontimesun":"dawn","ontimetod":"09:57:00","onproperty":"payload","onvaluetype":"str","onvalue":"ON","onoffset":"-30","onrandomoffset":0,"onsuppressrepeats":false,"offtype":"1","offtimesun":"sunriseEnd","offtimetod":"09:00:00","offduration":"00:01:00","offproperty":"payload","offvaluetype":"str","offvalue":"OFF","offoffset":"45","offrandomoffset":true,"offsuppressrepeats":false,"mon":true,"tue":true,"wed":true,"thu":true,"fri":true,"sat":true,"sun":true,"x":90,"y":160,"wires":[["8245b5b6.172368"]]},{"id":"8245b5b6.172368","type":"switch","z":"b5b1e98c.3cfd88","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"On","vt":"str"},{"t":"eq","v":"Off","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":450,"y":140,"wires":[["e299232.83179e"],["d041f490.0cc618"]]},{"id":"d71ceff5.5d82b","type":"api-call-service","z":"b5b1e98c.3cfd88","name":"Outside lights on","server":"cfa79f02.db9d4","version":1,"service_domain":"light","service":"turn_on","entityId":"group.outside","data":"","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":910,"y":80,"wires":[["37926ec.c807e92"]]},{"id":"a18032f5.85a0d","type":"api-call-service","z":"b5b1e98c.3cfd88","name":"Outside lights off","server":"cfa79f02.db9d4","version":1,"service_domain":"light","service":"turn_off","entityId":"group.outside","data":"","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":910,"y":140,"wires":[["51d9bf7c.ac92c"]]},{"id":"37926ec.c807e92","type":"api-call-service","z":"b5b1e98c.3cfd88","name":"","server":"cfa79f02.db9d4","version":1,"service_domain":"notify","service":"gmail_notify","entityId":"","data":"{\"title\":\"Outside Lights\",\"message\":\"Outside Lights have been switched on\"}","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":1127.5000076293945,"y":81.2500114440918,"wires":[["3e969229.28fa7e"]]},{"id":"3e969229.28fa7e","type":"debug","z":"b5b1e98c.3cfd88","name":"final output","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":1397.5000076293945,"y":101.2500114440918,"wires":[]},{"id":"9dbf47c1.2aaa28","type":"time-range-switch","z":"b5b1e98c.3cfd88","name":"","lat":"53.00462","lon":"-1.46901","startTime":"15:00","endTime":"01:00","startOffset":0,"endOffset":0,"x":770,"y":340,"wires":[["287b2791.182db8"],[]]},{"id":"38216ea5.555c62","type":"time-range-switch","z":"b5b1e98c.3cfd88","name":"","lat":"53.00462","lon":"-1.46901","startTime":"05:40","endTime":"09:30","startOffset":0,"endOffset":0,"x":770,"y":280,"wires":[["287b2791.182db8"],[]]},{"id":"b6abc17c.5a533","type":"time-range-switch","z":"b5b1e98c.3cfd88","name":"","lat":"53.00462","lon":"-1.46901","startTime":"05:40","endTime":"09:30","startOffset":0,"endOffset":0,"x":770,"y":460,"wires":[["c4eb0aab.9cea68"],[]]},{"id":"8cb4d7b3.9040e8","type":"time-range-switch","z":"b5b1e98c.3cfd88","name":"","lat":"53.00462","lon":"-1.46901","startTime":"15:00","endTime":"01:00","startOffset":0,"endOffset":0,"x":770,"y":520,"wires":[["c4eb0aab.9cea68"],[]]},{"id":"af111b09.53a228","type":"comment","z":"b5b1e98c.3cfd88","name":"Dawn","info":"","x":50,"y":20,"wires":[]},{"id":"e299232.83179e","type":"api-current-state","z":"b5b1e98c.3cfd88","name":"Already On?","server":"cfa79f02.db9d4","version":1,"outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","override_topic":true,"entity_id":"group.outside","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":630,"y":80,"wires":[[],["d71ceff5.5d82b"]]},{"id":"d041f490.0cc618","type":"api-current-state","z":"b5b1e98c.3cfd88","name":"Already Off?","server":"cfa79f02.db9d4","version":1,"outputs":2,"halt_if":"off","halt_if_type":"str","halt_if_compare":"is","override_topic":true,"entity_id":"group.outside","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":630,"y":140,"wires":[[],["a18032f5.85a0d"]]},{"id":"79e0c2fc.e76f1c","type":"inject","z":"b5b1e98c.3cfd88","name":"","topic":"","payload":"15","payloadType":"num","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":270,"y":320,"wires":[["c8ee648e.422e48"]]},{"id":"11c4cea.ee6ef31","type":"comment","z":"b5b1e98c.3cfd88","name":"Sunlight","info":"","x":60,"y":360,"wires":[]},{"id":"9362be9a.b6c98","type":"time-range-switch","z":"b5b1e98c.3cfd88","name":"","lat":"","lon":"","startTime":"sunset","endTime":"sunrise","startOffset":"","endOffset":0,"x":340,"y":840,"wires":[["da7a36e0.7a3358","57d553be.db9f2c"],[]]},{"id":"1485a15c.65c99f","type":"delay","z":"b5b1e98c.3cfd88","name":"","pauseType":"delay","timeout":"5","timeoutUnits":"minutes","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":740,"y":840,"wires":[["8174b7f6.9340a8"]]},{"id":"bed59472.a6bae8","type":"server-state-changed","z":"b5b1e98c.3cfd88","name":"Martin Home","server":"cfa79f02.db9d4","version":1,"entityidfilter":"group.tracker_martin","entityidfiltertype":"substring","outputinitially":false,"state_type":"str","haltifstate":"home","halt_if_type":"str","halt_if_compare":"is_not","outputs":2,"output_only_on_state_change":false,"x":70,"y":820,"wires":[[],["9362be9a.b6c98"]]},{"id":"da7a36e0.7a3358","type":"time-range-switch","z":"b5b1e98c.3cfd88","name":"","lat":"","lon":"","startTime":"00:00","endTime":"04:00","startOffset":"","endOffset":0,"x":590,"y":840,"wires":[["1485a15c.65c99f"],[]]},{"id":"5a6a747e.315e9c","type":"server-state-changed","z":"b5b1e98c.3cfd88","name":"Clare Home","server":"cfa79f02.db9d4","version":1,"entityidfilter":"group.tracker_clare","entityidfiltertype":"substring","outputinitially":false,"state_type":"str","haltifstate":"home","halt_if_type":"str","halt_if_compare":"is_not","outputs":2,"output_only_on_state_change":false,"x":70,"y":860,"wires":[["9362be9a.b6c98"],[]]},{"id":"7c0a93a.b077b6c","type":"debug","z":"b5b1e98c.3cfd88","name":"direct from sunlight","active":true,"tosidebar":true,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","x":690,"y":660,"wires":[]},{"id":"3e57e63b.76c7ca","type":"debug","z":"b5b1e98c.3cfd88","name":"after switching","active":true,"tosidebar":true,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","x":920,"y":620,"wires":[]},{"id":"c6f4bd71.e70f3","type":"poll-state","z":"b5b1e98c.3cfd88","name":"","server":"cfa79f02.db9d4","version":1,"updateinterval":"10","updateIntervalUnits":"minutes","outputinitially":false,"outputonchanged":false,"entity_id":"sensor.sunlight_pct","state_type":"str","halt_if":"7","halt_if_type":"num","halt_if_compare":"lte","outputs":2,"x":120,"y":400,"wires":[["c2ddb137.540ca","c8ee648e.422e48","7c0a93a.b077b6c"],[]]},{"id":"c2ddb137.540ca","type":"debug","z":"b5b1e98c.3cfd88","name":"test","active":true,"tosidebar":true,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","x":350,"y":560,"wires":[]},{"id":"ac632342.04cf7","type":"switch","z":"b5b1e98c.3cfd88","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"On","vt":"str"},{"t":"eq","v":"Off","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":410,"y":1160,"wires":[["57d553be.db9f2c"],["8174b7f6.9340a8"]]},{"id":"608765e7.6af41c","type":"api-call-service","z":"b5b1e98c.3cfd88","name":"Outside lights on","server":"cfa79f02.db9d4","version":1,"service_domain":"light","service":"turn_on","entityId":"group.outside","data":"","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":910,"y":1100,"wires":[["7cbb800d.afcb2"]]},{"id":"1aaa9bad.82cc24","type":"api-call-service","z":"b5b1e98c.3cfd88","name":"Outside lights off","server":"cfa79f02.db9d4","version":1,"service_domain":"light","service":"turn_off","entityId":"group.outside","data":"","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":910,"y":1160,"wires":[["e7dc8d03.b36ed"]]},{"id":"7cbb800d.afcb2","type":"api-call-service","z":"b5b1e98c.3cfd88","name":"","server":"cfa79f02.db9d4","version":"1","service_domain":"notify","service":"gmail_notify","entityId":"","data":"{\"title\":\"Outside Lights\",\"message\":\"Outside Lights have been switched on\"}","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":1127.5000076293945,"y":1101.2500114440918,"wires":[["e46bd6fe.34c118"]]},{"id":"e7dc8d03.b36ed","type":"api-call-service","z":"b5b1e98c.3cfd88","name":"","server":"cfa79f02.db9d4","version":1,"service_domain":"notify","service":"gmail_notify","entityId":"","data":"{\"title\":\"Outside Lights\",\"message\":\"Outside Lights have been switched off\"}","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":1127.5000076293945,"y":1161.2500114440918,"wires":[["e46bd6fe.34c118"]]},{"id":"e46bd6fe.34c118","type":"debug","z":"b5b1e98c.3cfd88","name":"Dusk final output","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":1417.5000076293945,"y":1121.2500114440918,"wires":[]},{"id":"a5672e47.ea773","type":"eztimer","z":"b5b1e98c.3cfd88","name":"","autoname":"sunsetStart - 23:45:00","tag":"eztimer","suspended":false,"sendEventsOnSuspend":false,"lat":"53.00462","lon":"-1.46901","timerType":"1","startupMessage":true,"ontype":"1","ontimesun":"sunsetStart","ontimetod":"05:45:00","onproperty":"payload","onvaluetype":"str","onvalue":"On","onoffset":"-45","onrandomoffset":0,"onsuppressrepeats":false,"offtype":"2","offtimesun":"sunriseEnd","offtimetod":"23:45:00","offduration":"00:01:00","offproperty":"payload","offvaluetype":"str","offvalue":"Off","offoffset":"30","offrandomoffset":true,"offsuppressrepeats":false,"mon":true,"tue":true,"wed":true,"thu":true,"fri":true,"sat":true,"sun":true,"x":100,"y":1160,"wires":[["ac632342.04cf7"]]},{"id":"2dab83d4.e189cc","type":"comment","z":"b5b1e98c.3cfd88","name":"Dusk","info":"","x":50,"y":1120,"wires":[]},{"id":"57d553be.db9f2c","type":"api-current-state","z":"b5b1e98c.3cfd88","name":"Already On?","server":"cfa79f02.db9d4","version":1,"outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","override_topic":true,"entity_id":"group.outside","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":630,"y":1100,"wires":[[],["608765e7.6af41c"]]},{"id":"8174b7f6.9340a8","type":"api-current-state","z":"b5b1e98c.3cfd88","name":"Already Off?","server":"cfa79f02.db9d4","version":1,"outputs":2,"halt_if":"off","halt_if_type":"str","halt_if_compare":"is","override_topic":true,"entity_id":"group.outside","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":630,"y":1160,"wires":[[],["1aaa9bad.82cc24"]]},{"id":"597b8cc6.8acbf4","type":"api-call-service","z":"b5b1e98c.3cfd88","name":"Outside lights on","server":"cfa79f02.db9d4","version":1,"service_domain":"light","service":"turn_on","entityId":"group.outside","data":"","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":1330,"y":340,"wires":[[]]},{"id":"b9208f20.ce9f5","type":"api-call-service","z":"b5b1e98c.3cfd88","name":"Outside lights off","server":"cfa79f02.db9d4","version":1,"service_domain":"light","service":"turn_off","entityId":"group.outside","data":"","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":1330,"y":400,"wires":[[]]},{"id":"287b2791.182db8","type":"api-current-state","z":"b5b1e98c.3cfd88","name":"Already On?","server":"cfa79f02.db9d4","version":1,"outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","override_topic":true,"entity_id":"group.outside","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":1050,"y":340,"wires":[[],["597b8cc6.8acbf4"]]},{"id":"c4eb0aab.9cea68","type":"api-current-state","z":"b5b1e98c.3cfd88","name":"Already Off?","server":"cfa79f02.db9d4","version":1,"outputs":2,"halt_if":"off","halt_if_type":"str","halt_if_compare":"is","override_topic":true,"entity_id":"group.outside","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":1050,"y":400,"wires":[[],["b9208f20.ce9f5"]]},{"id":"7e9ce215.cbd58c","type":"inject","z":"b5b1e98c.3cfd88","name":"On at 05:45 - Weekday","topic":"","payload":"On","payloadType":"str","repeat":"","crontab":"45 05 * * 1,2,3,4,5","once":false,"onceDelay":0.1,"x":130,"y":80,"wires":[["8245b5b6.172368"]]},{"id":"51d9bf7c.ac92c","type":"api-call-service","z":"b5b1e98c.3cfd88","name":"","server":"cfa79f02.db9d4","version":1,"service_domain":"notify","service":"gmail_notify","entityId":"","data":"{\"title\":\"Outside Lights\",\"message\":\"Outside Lights have been switched on\"}","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":1140,"y":140,"wires":[["3e969229.28fa7e"]]},{"id":"709d0b63.8f5b84","type":"inject","z":"b5b1e98c.3cfd88","name":"Off failsafe","topic":"","payload":"Off","payloadType":"str","repeat":"","crontab":"15 09 * * *","once":false,"onceDelay":0.1,"x":90,"y":120,"wires":[["8245b5b6.172368"]]},{"id":"6a75050.696b2fc","type":"comment","z":"b5b1e98c.3cfd88","name":"Night arrival","info":"","x":70,"y":760,"wires":[]},{"id":"cfa79f02.db9d4","type":"server","z":"","name":"Home Assistant","legacy":false,"hassio":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":false}]

Where did you have 2 dawn light timers?

I told you exactly what you needed.

The first image is what I had, the second is what I now have (untested).


You have me confused now, because I don’t see anywhere in there that you have your conditions set like you specified earlier in the conversation. Not to mention it seems like an overly complicated flow for no reason.