Hello everyone, if somebody can help me i am very apricated. I’m fighting with this proble almost five days. Here is the idea; I am making a thermostat with ESP8266 and Nextion display. I have two buttons (up and down) for changing the target temperature of the thermostat. I managed to print the thermostat target value on the screen, but I could not manage to change this value both on the screen and in the thermostat setting with the up and down buttons. Although many methods I tried compiles the codes without errors but they do not make any changes to the screen or the thermostat. The codes are as follows. I really need help.
Thank you.
sensor:
- platform: dallas
address: 0xc2000000285c2628
id: oda_sicakligi
name: "Livingroom Temperature"
- platform: homeassistant
id: target_temp
entity_id: climate.kombi_thermostat
attribute: temperature
binary_sensor:
- platform: nextion
page_id: 0
component_id: 6
filters:
- delayed_on: 30ms
- delayed_off: 30ms
id: target_up
on_press:
then:
- homeassistant.service:
service: climate.set_temperature
data:
entity_id: climate.kombi_thermostat
lambda: |-
id(target_temp).state = id(target_temp).state + '0.1';
if id(target_temp).state > '30.0' { id(target_temp).state = '30.0'; }
it.set_component_text_printf("page0.target_up", "%.1f", id(target_temp).state);
call(climate.set_temperature);
temperature: !lambda "return id(target_temp).state;
- logger.log: "Button up pressed"
- platform: nextion
page_id: 0
component_id: 7
filters:
- delayed_on: 30ms
- delayed_off: 30ms
id: target_down
on_press:
then:
- homeassistant.service:
service: climate.set_temperature
data:
entity_id: climate.kombi_thermostat
lambda: |-
id(target_temp).state = id(target_temp).state - 0.1;
if id(target_temp).state < 5 { id(target_temp).state = 5; }
it.set_component_text_printf("page0.target_down", "%.1f", id(target_temp).state);
call(climate.set_temperature);
temperature: !lambda "return id(target_temp).state;"
- logger.log: "Button down pressed"
Note: When I press the up and down buttons on the screen, “Button up pressed” and “Button down pressed” messages appear on the log screen.