I am using the built-in MQTT broker and Tasmota is configured with the Home Assistant address. I've added a dedicated user name and password for Tasmota devices via the MQTT configuration.
The first section is relatively straightforward and configures the climate control with the available functions and where to get the temperature data. The second section was more difficult to work out because I had to try and associate the actions from the control with the IRhvac function of Tasmota. I try not to use custom controls where possible to avoid upgrade problems in the future. I initially struggled to find something that would work with the built-in Home Assistant functions but did get some inspiration from the Home Assistant forum.
Adding the climate control to Home Assistant is relatively easy, although it's not automatically discovered as it is with other ESP8266 firmware projects. To add the climate component manually edit the configuration.yaml file and add:
climate:- platform: mqttcurrent_temperature_topic: "tele/tasmota_xxx/SENSOR"current_temperature_template: "{{ value_json['BME280']['Temperature'] }}"temperature_unit: "C"name: Conservatorymodes:- "off"- "cool"- "heat"- "dry"swing_modes:- "on"- "off"fan_modes:- "high"- "medium"- "low"min_temp: 16max_temp: 31initial: 18power_command_topic: "cmnd/conservatoryac"mode_command_topic: "cmnd/conservatoryac"temperature_command_topic: "cmnd/conservatoryac"fan_mode_command_topic: "cmnd/conservatoryac"swing_mode_command_topic: "cmnd/conservatoryac"precision: 1.0
What seems to work quite well is having the climate control publish to a temporary topic in MQTT and then using that to trigger an automation using automations.yaml. I need to finish off passing through the swing modes to IRhvav but I don't often use that setting.
- id: ac-controlalias: AC Controltrigger:platform: mqtttopic: cmnd/conservatoryacaction:- service: mqtt.publishdata_template:topic: cmnd/tasmota_888715/IRhvacpayload: >{% set pwr = 'on' if states.climate.conservatory.state != 'off' else 'off' %}{% set mitmode = 'cool' if states.climate.conservatory.state == 'off' else states.climate.conservatory.state %}{"Vendor":"MITSUBISHI112","Power":"{{pwr}}","Mode":"{{mitmode}}","FanSpeed":"{{state_attr('climate.conservatory', 'fan_mode')}}","Temp":{{state_attr('climate.conservatory', 'temperature')}},"SwingH":"Off","SwingV":"middle"}mode: single
Putting it all together, the card looks nice on the dashboard and is easy to use. Extra options are available from the ⁝ icon.
Pushing one of the icons on the climate controls results in a "beep" from the A/C and a log entry in the Tasmota cosole.
No comments:
Post a Comment