Simple time based Automation

Hi, i’'m after some info on how to setup a simple automation to switch off a switch @ xx:xx:xx time. I have tried numerous ways and either i get no errors but the automation does not work OR i get errors.

I have a switch called switch.computer_room, i want to have this switch off at 10pm (22:00:00) using service switch.turn_off which works if i do it manually. I’ve spent HOURS trying to get this work, if any one can assist that would be appreciated.

Give this a try:

- alias: Computer Room Lights Off
  trigger:
    platform: time
    at: '22:00:00'
  action:
    - service: homeassistant.turn_off
      entity_id: switch.computer_room

Add this to your automation.yaml file…

I’ve been told you need to restart Home Assistant after creating or modifying an automation, this was not obvious to me…

1 Like

You don’t need to restart Home Assistant. Simply reload your automations from the config panel. (Configuration->General->Reload Automation)

grafik

However, adding or removing components requires a restart of hass.

Thanks very much to you all, i wasn’t aware of the reload as i was restarting HASS. Managed to get the automation to work so big thanks.

does this work with input boolean??