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.
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)
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:
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.
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
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’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