Any good example of X-Mas lights ON/OFF... automation?

I looked for some example, but could not find fast solution… I have ‘Sonoff switch’ integrated with ‘ESPHome’
I need, example:

  • ON; work-days at 05:00AM
  • OFF; work-days at 06:30AM
  • ON; work-days at 04:00PM
  • OFF; work-days at 11:30PM
  • ON; weekend at 06:00AM
  • OFF; weekend at 07:00AM
  • ON; weekend at 03:00PM
  • OFF; weekend at 03:30AM

If possible to easy modify, not in the ‘.yaml’, but on the ‘card’ with mouse click, etc.

Not on the card, but you can use the automation editor.

Well, yes… But maybe someone already did something more sophisticated,…
And can share the settings/code…

Just turning a switch on or off at a time, can’t make it more sophisticated

- id: '1570596979101'
  alias: xmas_lights_on_workdays_morning
  trigger:
  - at: '05:00'
    platform: time
  condition:
    condition: time
    weekday:
    - mon
    - tue
    - wed
    - thu
    - fri
  action:
  - data:
      entity_id: switch.name_of_your_sonoff
    service: switch.turn_on

Yes, but this is fixed and running all the time… If you want to modify (because of party or friends coming,…), you must go to the automation and make changes… Right?

No you don’t. You just on the switch in the frontend.

Yes, you can manually ON/OFF.
But if you would like to change from ‘04:00PM’ till ‘04:30PM’ and forget; then you must go to ‘automation’. And make changes…
My question was: if someone invented ‘code’ to do the changes in the ‘card’…?

wall

If you want to be able to change times easier replace your time trigger with an ‘input_datetime:’

input_datetime:
  open_curtains_time_early:
    has_date: false
    has_time: true
- alias: Open Curtains Early
  trigger:
    - platform: template
      value_template: "{{ states('sensor.time') == (states.input_datetime.open_curtains_time_early.attributes.timestamp | int | timestamp_custom('%H:%M', False)) }}"

That’s how I do it for my curtains.

Have a look in my GitHub for the full setup. curtains_blinds.yaml
Also if you look in the heating one you can see how to have conditions for specific days of the week. Or even use Google calendar etc.

Yes, this is close that what I wanted… I’ll look. Thx…