#How to use brightness_move_up in Z2M to increase brightness from holding a button?
1 messages · Page 1 of 1 (latest)
Is this the way? trigger: mqtt topic: zigbee2mqtt/Reading lamp switch id: MQTT
And
target:
entity_id: light.bedroom_reading_lamp
data:
brightness: "{{ trigger.payload_json.brightness }}"```
It's at least not ideal. When I restarted z2m addon it changed the lights.
Some ChatGPT-harassment got me this: action: light.turn_on target: entity_id: light.soverom_1_taklampe data: brightness: > {% set current_brightness = state_attr('light.soverom_1_taklampe', 'brightness') %} {% set delta = trigger.payload_json.action_brightness_delta | default(0) %} {% set new_brightness = ((current_brightness if current_brightness is not none else 0) | int) + delta %} {{ [0, [new_brightness, 255] | min] | max }} Is there a simpler way?
Oh, I also had to do condition: template value_template: "{{ trigger.payload_json.action_brightness_delta is not none }}"To make sure it skipped the payload that is sent when HA addon is restarted.
Bump
Hello, hello?
You set the automation mode to restart and start an infinite loop of making the lamp brighter.
On brightness_stop you do "stop" which cancels the previous infinite loop.
Is that by using the simulated brightness as instructed in z2m docs? ```simulated_brightness:
delta: 20 # delta per interval, default = 20
interval: 200 # interval in milliseconds, default = 200
Integrate your IKEA E1744 via Zigbee2MQTT with whatever smart home infrastructure you are using without the vendor's bridge or gateway.
- condition: trigger
id:
- brightness_up
sequence:
- repeat:
sequence:
- metadata: {}
data:
brightness: >-
{{
state_attr(states('input_select.testdropdown'),'brightness')
+5 }}
target:
entity_id: "{{ states('input_select.testdropdown') }}"
action: light.turn_on
- delay:
hours: 0
minutes: 0
seconds: 0
milliseconds: 100
while: []
That's for brightness up
- condition: trigger
id:
- brightness_stop
sequence:
- stop: ""
That's for stopping to make it brighter
The brightness_stop event triggers on releasing the button
Should it also work for a rotary button like E1744?
Yes it should according to the documentation