Hello, I am having trouble finding an error inside an automation. I am using an IKEA remote to control a cwww light and I want to use the left and right buttons to change the temperature. I am using a blueprint and adding the automation manually. The weird thing is that the right button works and increases the temperature, while the left one doesn’t. If I check the trace I see that the service is called but the temperature doesn’t change, while with the right one it does, even though it doesn’t increment by 10, which is also weird.
This is the code in the automation:
alias: ZHA automazione telecomando ikea
description: ""
use_blueprint:
path: Malte/zha-ikea-four-button-remote-styrbar-for-lights-e2001-e2002.yaml
input:
remote: 54a4f5a4cf9c85e0c989f555e18e4999
light:
entity_id: light.led_mansarda
button_left_long:
- repeat:
count: 300
sequence:
- service: light.turn_on
data:
transition: 0.1
color_temp_kelvin: >-
{{ state_attr('light.led_mansarda','color_temp_kelvin')|int -
10 }}
target:
entity_id: light.led_mansarda
- delay: 0.1
button_right_long:
- repeat:
count: 300
sequence:
- service: light.turn_on
data:
transition: 0.1
color_temp_kelvin: >-
{{ state_attr('light.led_mansarda','color_temp_kelvin')|int +
10 }}
target:
entity_id: light.led_mansarda
- delay: 0.1
while this is what I get in the traces:
Iteration 1
Executed: 22 novembre 2022 15:36:55
Result:
params:
domain: light
service: turn_on
service_data:
transition: 0.1
color_temp_kelvin: 4494
entity_id:
- light.led_mansarda
target:
entity_id:
- light.led_mansarda
running_script: false
limit: 10
Iteration 2
Executed: 22 novembre 2022 15:36:56
Result:
params:
domain: light
service: turn_on
service_data:
transition: 0.1
color_temp_kelvin: 4494
entity_id:
- light.led_mansarda
target:
entity_id:
- light.led_mansarda
running_script: false
limit: 10
Iteration 3
Executed: 22 novembre 2022 15:36:56
Result:
params:
domain: light
service: turn_on
service_data:
transition: 0.1
color_temp_kelvin: 4494
entity_id:
- light.led_mansarda
target:
entity_id:
- light.led_mansarda
running_script: false
limit: 10
If instead I use the right arrow this is what I get:
Iteration 1
Executed: 22 novembre 2022 15:41:01
Result:
params:
domain: light
service: turn_on
service_data:
transition: 0.1
color_temp_kelvin: 4514
entity_id:
- light.led_mansarda
target:
entity_id:
- light.led_mansarda
running_script: false
limit: 10
Iteration 2
Executed: 22 novembre 2022 15:41:01
Result:
params:
domain: light
service: turn_on
service_data:
transition: 0.1
color_temp_kelvin: 4534
entity_id:
- light.led_mansarda
target:
entity_id:
- light.led_mansarda
running_script: false
limit: 10
Iteration 3
Executed: 22 novembre 2022 15:41:01
Result:
params:
domain: light
service: turn_on
service_data:
transition: 0.1
color_temp_kelvin: 4555
entity_id:
- light.led_mansarda
target:
entity_id:
- light.led_mansarda
running_script: false
limit: 10
The color temperature doesn’t increase by 10 but it works and the temperature increases.