LZW31-SN Dimmer - Red Series Hold Button to Dim on Home Assistant

You could do something like this:

alias: Office Brightness
description: Set brightness on Smart bulbs when Switch is updated
trigger:
  - platform: state
    entity_id: light.office_light
condition: []
action:
  - service: light.turn_on
    target:
      entity_id:
        - light.office_rgb1
        - light.office_rgb2
    data:
      brightness: >-
        {% if state_attr('light.office_light', 'brightness')
        %}{{state_attr('light.office_light', 'brightness') }}{% else %}0{% endif
        %}
mode: single
2 Likes
alias: LZW31-SN Dimmer Match
description: ''
mode: single
trigger:
  - platform: numeric_state
    entity_id: light.living_room_hallway_dimmer_current_value
    attribute: brightness
action:
  - service: light.turn_on
    target:
      entity_id: light.downstairs_hallway_lights
    data:
      brightness: >-
        {% if state_attr('light.living_room_hallway_dimmer_current_value', 'brightness')
        %}{{state_attr('light.living_room_hallway_dimmer_current_value', 'brightness') }}{% else %}0{% endif
        %}

Trigger on numeric state of the brightness attribute of the dimmer entity changing, then match the lights to that same level.

2 Likes

Lol beat me to it but we came up with the same thing lol.

I believe the numeric_state platform requires you to specify a threshold to trigger off of (either an above or below value). If that is the case, it might be better to just trigger using the state platform.

Would state trigger though if it remains on? I’m thinking dimming and raising brightness wouldn’t trigger a state change so the automation wouldn’t fire.

Above 0 and below 101 lol?

Yep, state will still trigger even though it is still on.

Fires when the state of any of given entities changes. If only entity_id is given, the trigger will fire for all state changes, even if only state attributes change. (source)

2 Likes

Awesome, had no idea. Today I learned…

Based on that yes I would trigger on state.

That did the trick! Thank you so much @kreene1987 & @jtronicus. Your help was greatly appreciated. Here was the solution!

 alias: Mirror3
  description: ''
  trigger:
  - platform: state
    entity_id: light.node_7
  condition: []
  action:
  - service: light.turn_on
    target:
      entity_id:
      - light.living_room_sconce_1
      - light.living_room_sconce_2
    data:
      brightness: >-
        {% if state_attr('light.node_7', 'brightness')
        %}{{state_attr('light.node_7', 'brightness') }}{% else %}0{% endif
        %}
  mode: single
1 Like

@mit3gt check this out: Yet another dimmer/scene switch blueprint - Blueprints Exchange - Home Assistant Community

My switch is in Smart Bulb mode, controlling a Home Assistant light group (not a zigbee light group) of 4x Osram/Sylvania Lightify BR30’s that are controlled locally from Home Assistant to the Osram / Sylvania Lightify hub.

This is what my automation looks like, utilizing the above blueprint:

alias: TEST-03_Z-WaveJS dimmer switch
description: ''
use_blueprint:
  path: moshess/zwavejs-dimmer-switch.yaml
  input:
    zwavejs_device_id: f21267e7e3b0c823109d935ce513a1f9
    key_up:
      - service: light.turn_on
        target:
          entity_id: light.office_lights
        data:
          transition: 1
    key_down:
      - service: light.turn_off
        data:
          transition: 1
        target:
          entity_id: light.office_lights
    key_up_held:
      - service: light.turn_on
        target:
          entity_id: light.office_lights
        data:
          brightness_step_pct: 2
    is_loop_for_key_up_held: true
    key_down_held:
      - service: light.turn_on
        target:
          entity_id: light.office_lights
        data:
          brightness_step_pct: -2
    is_loop_for_key_down_held: true

Works surprisingly well. If I turn them off, single click to turn back on resumes last brightness. The blueprint is very flexible and allows you to do similar things for scene (?) multi-taps. I’ll likely try adding lighting colors to that.

But doesn’t disabling the local relay also disable the ability to set a brightness level at the switch?

The latest beta firmware addresses that. With the beta firmware, you would leave the relay enables and turn on smart bulb mode. Smart bulb mode forces the load to always output 100% regardless of the brightness (it basically simulates a dimmer but always outputs 100%).

Yeah. With the latest beta firmware these switches are nearly perfect for use with smart lights. With that said, @jtronicus I am in the google home ecosystem. Whenever I dim my smart bulbs using the google home interface the led level does not reflect the latest dim state. To remedy this I took your original solution and kind of reversed it so the switch would update on a smart light action. Works pretty well with a slight delay. I am mostly happy with it. Seems to go haywire every now and then for reasons I can’t explain. Maybe someone can share a better approach to this? I am not using groups or light groups. Maybe I should? Here is my current config for keeping the switch led in sync on a google home trigger:

 alias: Living Room Sync Notification with smart light 1
  description: ''
  trigger:
  - platform: state
    entity_id: light.living_room_sconce_smart_light
  condition: []
  action:
  - service: light.turn_on
    target:
      entity_id: light.inovelli_switch
    data:
      brightness: '{% if state_attr(''light.living_room_sconce_smart_light'', ''brightness'') %}{{state_attr(''light.living_room_sconce_smart_light'', 
        ''brightness'') }}{% else %}0{%
        endif %}'
  mode: single

@jonathanweinberg Thanks for sharing. I will check this out.

1 Like

Ahh, sweet! I’ll need to upgrade! Thanks!

you might be able to do something like this:

alias: Office Brightness
description: Set brightness on Smart bulbs when Switch is updated
trigger:
  - platform: state
    entity_id: light.office_light,light.office_rgb1,light.office_rgb2
condition: []
action:
  - service: light.turn_on
    target:
      entity_id:
        - light.office_rgb1
        - light.office_rgb2
        - light.office_light
    data:
      brightness: >-
        {% if trigger.to_state.attributes.brightness is defined %}
        {{trigger.to_state.attributes.brightness }}{% else %}0{% endif %}
  - delay:
      hours: 0
      minutes: 0
      seconds: 0
      milliseconds: 250
mode: single

I havent done a lot of testing with it, but whenever any of 3 devices (2 smart bulbs and 1 dimmer switch) is updated, it will update all 3 devices to the same brightness. A 250ms delay is added at the end to help prevent the automation from firing multiple times. It seems to work so far.

To alleviate confusion, I moved everything to light groups and am now controlling those. Local scene turns on and off the group. I never change the dimmer itself or the bulbs, I do all at the same time via one entity.

I still control the LED bar colors though.

Does that dim the device being controlled while the paddle is help?

I’m curious about this as well. Is it possible to set up smart bulb mode so the lights actually change brightness as the paddle is held? (versus the current solution, where the lights only change brightness after you release the paddle).

I had some ESPhome lights setup using a version of the simpler automations listed here. It kind of worked, but the switch to HA updates are a little slow so it more randomly stepped brightness then ramped brightness. If you used long dimming/ramp times in the dimmer, like 5 to 10 seconds, it would likely work fairly smoothly.

I think the script would work better because when held the dim percentage would keep changing 2% over and over so that should be smoother.

Are your bulbs zwave, zigbee, wifi? Zwave should track the dimmer if set via associations. If zigbee I’d recommend a blue switch when they come out. Wifi :man_shrugging: