Automations with zwave

Changing out the zwave to use switch.${entity} fixed the issue I was running into. Here’s the end result in case anyone finds a similar problem.

- alias: Turn on the Outside Garage Lights when the sun sets
  initial_state: true
  hide_entity: false
  trigger:
    platform: sun
    event: sunset
    offset: '-00:15:00'
  action:
    service: switch.turn_on
    entity_id: switch.jasco_products_12727_in_wall_smart_switch_toggle_switch
- alias: Turn off the Outside Garage Lights when the sun rises
  initial_state: true
  hide_entity: false
  trigger:
    platform: sun
    event: sunrise
    offset: '00:15:00'
  action:
    service: switch.turn_off
    entity_id: switch.jasco_products_12727_in_wall_smart_switch_toggle_switch

I thought homeassistant.turn_on etc. were for groups. I would try switch.turn_on since your entity, I assume, is a switch.

Thanks bosborne, I’ll give that one a try and see if I have any luck.

You need to use the entity in the switch domain, not the one in the zwave domain. I.e., there should be an entity named switch.yyy that corresponds to each zwave.xxx. Use the switch.yyy entity_id in the service. (And you can use either homeassistant.turn_xx or switch.turn_xx – it doesn’t matter.)

2 Likes

Thanks pnbruckner, let me give that one a shot… I’ll keep you posted.

entity_id: switch.jasco_products_12727_in_wall_smart_switch_toggle_switch