Hi,
I’ve created a generic_thermostat to control my “dumb” air conditioner using a Zigbee2MQTT IR Blaster. My idea was to create an automation to send a IR command for each change in the thermostat (on, off, each target temperature).
Turning on and off works fine, but changing the target temperature is not triggering the automation, nor it shows in my logbook.
Here’s the configuration.yaml for the thermostat:
climate:
- platform: generic_thermostat
name: Living Room AC
unique_id: climate.living_room_ac_ir
heater: switch.living_room_ac
target_sensor: sensor.front_door_device_temperature
min_temp: 18
max_temp: 25
ac_mode: true
target_temp: 19
cold_tolerance: 3
hot_tolerance: 3
min_cycle_duration:
seconds: 5
initial_hvac_mode: "off"
precision: 1
The automation is a bit long as I used several triggers, but it is as follows.
alias: IR - Living Room Air Conditioner
description: ""
trigger:
- platform: state
entity_id:
- climate.living_room_ac_ir
to: cool
id: turn_on
- platform: state
entity_id:
- climate.living_room_ac_ir
to: "off"
id: turn_off
- platform: state
entity_id:
- climate.living_room_ac_ir
attribute: temperature
to: "18"
id: temp_18
- platform: state
entity_id:
- climate.living_room_ac_ir
attribute: temperature
to: "19"
id: temp_19
- platform: state
entity_id:
- climate.living_room_ac_ir
attribute: temperature
to: "20"
id: temp_20
- platform: state
entity_id:
- climate.living_room_ac_ir
attribute: temperature
to: "21"
id: temp_21
- platform: state
entity_id:
- climate.living_room_ac_ir
attribute: temperature
to: "22"
id: temp_22
- platform: state
entity_id:
- climate.living_room_ac_ir
attribute: temperature
to: "23"
id: temp_23
- platform: state
entity_id:
- climate.living_room_ac_ir
attribute: temperature
to: "24"
id: temp_24
- platform: state
entity_id:
- climate.living_room_ac_ir
attribute: temperature
to: "25"
id: temp_25
condition: []
action:
- if:
- condition: trigger
id:
- turn_on
then:
- service: mqtt.publish
data:
qos: 0
retain: false
topic: zigbee2mqtt/Linving Room IR Blaster/set
payload: >-
{"ir_code_to_send":
"AAAAAAA"}
- if:
- condition: trigger
id:
- turn_off
then:
- service: mqtt.publish
data:
qos: 0
retain: false
topic: zigbee2mqtt/Linving Room IR Blaster/set
payload: >-
{"ir_code_to_send":
"BBBBBB"}
- if:
- condition: trigger
id:
- temp_18
then:
- service: mqtt.publish
data:
qos: 0
retain: false
topic: zigbee2mqtt/Linving Room IR Blaster/set
payload: >-
{"ir_code_to_send":
"CCCCCCC"}
- if:
- condition: trigger
id:
- temp_19
then:
- service: mqtt.publish
data:
qos: 0
retain: false
topic: zigbee2mqtt/Linving Room IR Blaster/set
payload: >-
{"ir_code_to_send":
"DDDDDD"}
- if:
- condition: trigger
id:
- temp_20
then:
- service: mqtt.publish
data:
qos: 0
retain: false
topic: zigbee2mqtt/Linving Room IR Blaster/set
payload: >-
{"ir_code_to_send":
"EEEEEEE"}
- if:
- condition: trigger
id:
- temp_21
then:
- service: mqtt.publish
data:
qos: 0
retain: false
topic: zigbee2mqtt/Linving Room IR Blaster/set
payload: >-
{"ir_code_to_send":
"FFFFFF"}
- if:
- condition: trigger
id:
- temp_22
then:
- service: mqtt.publish
data:
qos: 0
retain: false
topic: zigbee2mqtt/Linving Room IR Blaster/set
payload: >-
{"ir_code_to_send":
"GGGGGG"}
- if:
- condition: trigger
id:
- temp_23
then:
- service: mqtt.publish
data:
qos: 0
retain: false
topic: zigbee2mqtt/Linving Room IR Blaster/set
payload: >-
{"ir_code_to_send":
"HHHHHH"}
- if:
- condition: trigger
id:
- temp_24
then:
- service: mqtt.publish
data:
qos: 0
retain: false
topic: zigbee2mqtt/Linving Room IR Blaster/set
payload: >-
{"ir_code_to_send":
"IIIIIII"}
- if:
- condition: trigger
id:
- temp_25
then:
- service: mqtt.publish
data:
qos: 0
retain: false
topic: zigbee2mqtt/Linving Room IR Blaster/set
payload: >-
{"ir_code_to_send":
"JJJJJJJ"}
mode: single
Thank you in advance!