Question About Sunset and Z-Wave Switch/Automation

Ok - New user, but making headway. This one has me stumped…

Here’s the code -

  • alias: Turn On Living Room Light 1 Hour Before Sunset
    trigger:
    platform: sun
    event: sunset
    offset: “-01:00:00”
    action:
    service: homeassistant.turn_on
    entity_id: switch.switch.ge_unknown_type5052_id3031_switch_2

Here’s the error in bootup -
Invalid config for [automation]: Entity ID switch.switch.ge_unknown_type5052_id3031_switch_2 is an invalid entity id for dictionary value @ data[‘action’][0][‘entity_id’]. Got None (See /home/pi/.homeassistant/configuration.yaml:86)

WHY? All the examples look like this. I’m truly puzzled after 2 hours of working on it.

Also - when you set the state in the dev tools, shouldn’t that trigger the automation? Just checking. Need a way to test this stuff.

Any help much appreciated!!

Try using the switch.turn_on instead of home assistant.turn_on.

1 Like

Thanks for the response! I’ll give it a shot! I’ll see how it goes this evening.

Also - anyone have any input on the testing part of the question?

Thanks!! That worked!! :slight_smile: