Melotron
(Magnus Svensson)
December 6, 2022, 3:17pm
1
Hello.
Iam trying to get a IKEA E2001 to dim a lamp. But its not stopping when it get the “brightness_stop” command.
At the moment so am I dimming a helper to avoid making my wife to annoyed on the lamps.
alias: IKEA-T
description: ""
trigger:
- platform: state
entity_id:
- sensor.k001_ikea_s1_action
to: brightness_move_up
id: Up
- platform: state
entity_id:
- sensor.k001_ikea_s1_action
to: brightness_move_down
id: Down
condition: []
action:
- choose:
- conditions:
- condition: trigger
id: Up
sequence:
- repeat:
until:
- condition: state
entity_id: sensor.k001_ikea_s1_action
state: brightness_stop
sequence:
- service: input_number.increment
data: {}
target:
entity_id: input_number.dimmer_test
- delay:
hours: 0
minutes: 0
seconds: 0
milliseconds: 100
- conditions:
- condition: trigger
id: Down
sequence:
- repeat:
until:
- condition: state
entity_id: sensor.k001_ikea_s1_action
state: brightness_stop
sequence:
- service: input_number.decrement
data: {}
target:
entity_id: input_number.dimmer_test
- delay:
hours: 0
minutes: 0
seconds: 0
milliseconds: 100
mode: restart
If anyone can point me in the right direction on how to get the automation stop dimming the helper or lamp when i release the button.
kolia
December 7, 2022, 8:41am
2
What are the states of sensor.k001_ikea_s1_action when button is pushed and then released?
Melotron
(Magnus Svensson)
December 7, 2022, 1:03pm
3
It’s working when I starts to dim up or down.
But it’s not stopping when I release the button.
info 2022-12-07 13:53:55MQTT publish: topic 'zigbee2mqtt/K001-IKEA-S1', payload '{"action":"brightness_move_up","action_rate":83,"battery":100,"linkquality":176,"update":{"installed_version":"1.0.024","state":null},"update_available":null}'
info 2022-12-07 13:53:55MQTT publish: topic 'zigbee2mqtt/K001-IKEA-S1', payload '{"action":"","battery":100,"linkquality":176,"update":{"installed_version":"1.0.024","state":null},"update_available":null}'
info 2022-12-07 13:53:55MQTT publish: topic 'zigbee2mqtt/K001-IKEA-S1/action', payload 'brightness_move_up'
info 2022-12-07 13:53:55MQTT publish: topic 'zigbee2mqtt/K001-IKEA-S1', payload '{"action":"brightness_stop","battery":100,"linkquality":172,"update":{"installed_version":"1.0.024","state":null},"update_available":null}'
info 2022-12-07 13:53:55MQTT publish: topic 'zigbee2mqtt/K001-IKEA-S1', payload '{"action":"","battery":100,"linkquality":172,"update":{"installed_version":"1.0.024","state":null},"update_available":null}'
info 2022-12-07 13:53:55MQTT publish: topic 'zigbee2mqtt/K001-IKEA-S1/action', payload 'brightness_stop'
I use the “repeat while” on my dimmers, works the way you described you want. You could try that.
condition: []
action:
- choose:
- conditions:
- condition: trigger
id: dim-up-l1
sequence:
- repeat:
while:
- condition: trigger
id: dim-up-l1
sequence:
- service: light.turn_on
data:
brightness_step: 5
target:
entity_id: light.dimmer_spisestue
- delay:
hours: 0
minutes: 0
seconds: 0
milliseconds: 200
- conditions:
- condition: trigger
id: dim-down-l1
sequence:
- repeat:
while:
- condition: trigger
id: dim-down-l1
sequence:
- service: light.turn_on
data:
brightness_step: -5
target:
entity_id: light.dimmer_spisestue
- delay:
hours: 0
minutes: 0
seconds: 0
milliseconds: 200
mode: restart
Melotron
(Magnus Svensson)
December 7, 2022, 1:28pm
5
Thanks, but m2q only send the command once for me so it dosent dim the light at all.
Executed: December 7, 2022 at 2:23:20 PM
repeat
Executed: December 7, 2022 at 2:23:20 PM
Result:
result: false
repeat/while/0
Executed: December 7, 2022 at 2:23:20 PM
Result:
result: false
repeat/while/0/entity_id/0
Executed: December 7, 2022 at 2:23:20 PM
Result:
result: false
state: None
wanted_state: brightness_move_up
action:
- choose:
- conditions:
- condition: trigger
id: Up
sequence:
- repeat:
while:
- condition: state
entity_id: sensor.k004_ikea_t1_action
state: brightness_move_up
sequence:
- service: light.turn_on
data:
brightness_pct: 10
brightness_step_pct: 5
target:
entity_id: light.sovrum_edlyn
- delay:
hours: 0
minutes: 0
seconds: 0
milliseconds: 100
- conditions:
- condition: trigger
id: Down
sequence:
- repeat:
while:
- condition: state
entity_id: sensor.k001_ikea_s1_action
state: brightness_move_down
sequence:
- service: light.turn_on
data:
brightness_step_pct: -5
target:
entity_id: light.sovrum_edlyn
- delay:
hours: 0
minutes: 0
seconds: 0
milliseconds: 100
mode: restart
kolia
December 7, 2022, 2:28pm
6
I repeat my question. Could you report in dev tools/states the state of sensor.k001_ikea_s1_action when the light is dimmed up, down and stopped. Just to make sure that when it is stopped, I guess whenever the dim button is released, the state is brightness_stop
Melotron
(Magnus Svensson)
December 7, 2022, 2:35pm
7
info 2022-12-07 13:53:55MQTT publish: topic 'zigbee2mqtt/K001-IKEA-S1', payload '{"action":"brightness_move_up","action_rate":83,"battery":100,"linkquality":176,"update":{"installed_version":"1.0.024","state":null},"update_available":null}'
info 2022-12-07 13:53:55MQTT publish: topic 'zigbee2mqtt/K001-IKEA-S1', payload '{"action":"","battery":100,"linkquality":176,"update":{"installed_version":"1.0.024","state":null},"update_available":null}'
info 2022-12-07 13:53:55MQTT publish: topic 'zigbee2mqtt/K001-IKEA-S1/action', payload 'brightness_move_up'
info 2022-12-07 13:53:55MQTT publish: topic 'zigbee2mqtt/K001-IKEA-S1', payload '{"action":"brightness_stop","battery":100,"linkquality":172,"update":{"installed_version":"1.0.024","state":null},"update_available":null}'
info 2022-12-07 13:53:55MQTT publish: topic 'zigbee2mqtt/K001-IKEA-S1', payload '{"action":"","battery":100,"linkquality":172,"update":{"installed_version":"1.0.024","state":null},"update_available":null}'
info 2022-12-07 13:53:55MQTT publish: topic 'zigbee2mqtt/K001-IKEA-S1/action', payload 'brightness_stop'
Thats from m2q, Iam running HA in container. So I dont have the any other view of the states that I know off.
kolia
December 7, 2022, 2:43pm
8
In HA, go to developer tools / states and filter to the entity sensor.k004_ikea_t1_action
Melotron
(Magnus Svensson)
December 7, 2022, 2:51pm
9
Is there any way to get it to pause after it receives the command ?
Its flashing really fast.
action:
battery: 100
linkquality: 168
update:
installed_version: 1.0.024
state: null
update_available: null
icon: mdi:gesture-double-tap
friendly_name: K001-IKEA-S1 action
kolia
December 7, 2022, 3:04pm
10
As you see, it does not report any state, which is weird. Whatever it is it should report a state. This may be the reason why it does not stop dimming.
You could go to the trace of this automation in order to check various information. Go to settings then automation filter with the name of the automation, select trace.
Melotron
(Magnus Svensson)
December 7, 2022, 3:23pm
11
It flashes by really fast. But I managed to get a screenshoot from vlc with it.
But it seems as not every command are coming thru, or its going so fast that I cant detect it on the screen.
https://streamable.com/2tbko7
Here are a link to a few sec of screen recordings.
Melotron
(Magnus Svensson)
December 7, 2022, 3:28pm
12
On the trace, its still running.
So its getting the command, really fast. But it dont want to read the stop command.