GE In-Wall sensor automations

Hi. Newbie to HA, but not newbie to scripting, coding, etc. Just trying to figure out automations with zwave switches and lights. So here it goes. I have a GE 14294 in wall smart dimmer and it is great. It is hooked to the Z-Wave controller, and works great when I use it on the wall. When I paired it with HA, a light card appeared with the dimmer instead of the switch. It can turn the lights on and off, and can even dim them when I click the card and have the dimming option. So everything works. I just can’t figure out how to get the lights turned on in an automation. I have the option zwave.kitchen_dimmer entity to use and the light.kitchen_dimmer_level entity. Which one is best to use? Both? How do you call them from within an automation? I attached some code below and I’m just not seeing this. Thanks.

   - alias: "Sunset, kitchen lights on"
    trigger:
      platform: sun
      event: sunset
      offset: "-00:10:00"
    action:
      - service: switch.turn_on
         entity_id: zwave.kitchen_dimmer
      - service: light.turn_on
        entity_id: light.kitchen_dimmer_level
        brightness: 3

In HA dimmers are modelled as lights because the light platform allows for dimming whereas a switch does not (only off/on). So you should use the light that is created, don’t worry about the Zwave entity.

Your automation seems to have some weird spacing. Try this:

- alias: "Sunset, kitchen lights on"
  trigger:
    - platform: sun
      event: sunset
      offset: "-00:10:00"
  action:
    - service: light.turn_on
      data:
        entity_id: light.kitchen_dimmer_level
        brightness_pct: 30

I like to use brightness_pct, I find it more intuitive.

1 Like

Holy awesome sauce on top of a huge heap of pork fried snap! Thank you so much! This is exactly what I was looking for. And yes, weird spacing indeed. Still trying to figure out the whole yaml spacing stuff. By the way, how do you get your code colored in the fourm? Mine comes out all black and white boring. Thanks again!\

Preface your code block with three backticks and the word yaml, just like on GitHub.