[Solved] Automation Editor: Simple Turn On Switch?

I have 2 basic Z-Wave wall-switches that I want to turn on at 10:00PM. This seems pretty straightforward, but I can’t make any headway. Here’s my “Actions”

But nothing happens. I suspect the “entity_id” is wrong, but I’m not sure. I say that because of what Developer Tools > dev-state is showing me…

[switch.ge_14291_inwall_smart_switch_switch] off value_id: 72057594076282880 value_instance: 1 value_index: 0 friendly_name: outside_house_left node_id: 2

First off, it seems I can’t really set the entity id to “outside_house_left” But, as you can see, even if I use the other id, nothing happens. Can anyone spot what I’m doing wrong?

The entity_id is definitely switch.ge_14291_inwall_smart_switch_switch. outside_house_left is just as it says, a friendly name. You need to use the entity_id in automations.

Since you’re only showing part of the automation, it’s kind of hard to say what might be wrong. In fact, I think most people don’t use the automation editor and just edit yaml files directly. It would be a lot easier to help you if you could post what’s in your yaml file (and make sure to use the formatting instructions at the top of the page.)

Thanks! Annoying that I can’t set entity_id to something more friendly.

   - id: '1536979650570'
   alias: Lights On
   trigger:
   - at: 22:00
     platform: time
   condition: []
   action:
   - data:
       entity_id: switch.ge_14291_inwall_smart_switch_switch
       service: switch.turn_on

First, the spacing in this automation is wrong. YAML is very particular about that. Hopefully it’s just a copy and paste error. But it should be:

 - id: '1536979650570'
   alias: Lights On
   trigger:
   - at: 22:00
     platform: time
   condition: []
   action:
   - data:
       entity_id: switch.ge_14291_inwall_smart_switch_switch
     service: switch.turn_on

Regarding the entity_id, that can be changed. You used to be able to edit entity_registry.yaml, but they’ve moved the data to a hidden file now, but there should be a new UI component to let you rename the switch entity_id. I haven’t used it so I can’t help there. But I think I’ve seen plenty of topics where people were asking about it so a simple search should find some useful info about how to do that.

OK, thanks. There were multiple issues. I’ve fixed all but one. 1. Vivaldi (web browser w/ Chromium engine) doesn’t seem supported. I couldn’t rename entities because a lot of features don’t work in Vivaldi. I switched to Safari and things got much simpler. 2. YAML syntax: I wasn’t aware of the syntactical importance and had messed with the file in nano; I fixed that. 3. Possibly the time format. Looking around I see examples of the time as “HH:MM:SS” so I’ve updated the time format to reflect that. 4. The entity_id was ridiculous. I finally was able to change it using Safari. 5. Changing an automation requires a reload via “Configuration > General > Reload Automation” 6. The automation simply isn’t triggering.

#6 is what I can’t puzzle out. Just now I set the automation to trigger at “18:00:00” (I started 5:58pm) and I waited 3 minutes to see what would happened. Logbook is showing nothing is happening at 6:00. My gut says there’s an issue with the YAML? Also, if I manually trigger the automation, it works just fine. Here a copy/paste from nano into this post

- id: '1536979650570'
  alias: Lights On
  trigger:
  - at: '18:00:00'
    platform: time
  condition: []
  action:
  - data:
      entity_id: switch.outside_house_left
    service: switch.turn_on

You’ll notice the are single quotes around the time now. That is how other people seem to be specifying a time.

This probably means the timezone set in HA and the timezone set in the OS don’t agree. You have to make sure both HA and the underlying OS are set to the same (correct) timezone. If not, this can cause time-based triggers not to trigger at the right time.

That’s exactly what was wrong. Working now. That you very much for your help!

1 Like