Hello All,
I’m having an issue with the configuration of my ESP32 connected to a nextion display that should be used as HMI for air-conditioning control.
In the interface there’s the possibility to change the setpoint via two different buttons: each button procedure an own action in esphome.
The problem is that it works only for the first call. All other calls are ignored.
Please find below the extract of esphome configuration:
uart:
rx_pin: 16
tx_pin: 17
baud_rate: 9600
binary_sensor:
- platform: ble_presence
mac_address: 88:11:96:55:C3:2D
name: "HUAWEI Band 3 Pro"
- platform: nextion
id: climate_living_increase
page_id: 1
component_id: 6
on_press:
- homeassistant.service:
service: climate.set_temperature
data:
entity_id: "climate.living"
data_template:
temperature: |
{{ state_attr("climate.living", "temperature") + 0.5 }}
- platform: nextion
id: climate_living_decrease
page_id: 1
component_id: 7
on_release:
- then:
- homeassistant.service:
service: climate.set_temperature
data:
entity_id: "climate.living"
data_template:
temperature: |
{{ state_attr("climate.living", "temperature") - 0.5 }}
sensor:
- platform: xiaomi_lywsdcgq
mac_address: 58:2D:34:31:AC:9F
temperature:
name: "Temperatura Living"
id: temp_living
humidity:
name: "Umidità Living"
id: hum_living
battery_level:
name: "Batteria termometro living"
- platform: xiaomi_lywsdcgq
mac_address: 4C:65:A8:DD:D4:4C
temperature:
name: "Temperatura Camera"
id: temp_camera
humidity:
name: "Umidità Camera"
id: hum_camera
battery_level:
name: "Batteria termometro camera"
- platform: homeassistant
entity_id: sensor.climate_setpoint_living
id: setpoint_living
on_value:
then:
- lambda: 'id(hmi).set_component_value("living.target", int(id(setpoint_living).state * 10));'
display:
- platform: nextion
id: hmi
lambda: |-
it.set_component_value("living.temperature", int(id(temp_living).state*10));
it.set_component_value("living.target", int(id(setpoint_living).state*10));
it.set_component_value("living.humidity", int(id(hum_living).state*10));
it.set_component_value("bed.temperature", int(id(temp_camera).state*10));
it.set_component_value("bed.humidity", int(id(hum_camera).state*10));
Thanks in advance for helping.
Salvo