liaan / broadlink_ac_mqtt

Broadlink Air Conditioners to mqtt

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Feature Request: Add temperature_unit to AcToMqtt.py

LordDethman opened this issue · comments

I ran into some issues with Home Assistant because the unit is not defined. I added it to the AcToMqtt.py file and now everything works, with the exception of the Unit Its Self displaying in C instead of F after a change is made.

device_array = { "name": str(name.decode("utf-8")) #,"power_command_topic" : self.config["mqtt_topic_prefix"]+ device.status["macaddress"]+"/power/set" ,"mode_command_topic" : self.config["mqtt_topic_prefix"]+ device.status["macaddress"]+"/mode_homeassistant/set" ,"temperature_command_topic" : self.config["mqtt_topic_prefix"] + device.status["macaddress"]+"/temp/set" ,"fan_mode_command_topic" : self.config["mqtt_topic_prefix"] + device.status["macaddress"]+"/fanspeed_homeassistant/set" ,"action_topic" : self.config["mqtt_topic_prefix"] + device.status["macaddress"]+"/homeassistant/set" ##Read values ,"current_temperature_topic" : self.config["mqtt_topic_prefix"] + device.status["macaddress"]+"/ambient_temp/value" ,"mode_state_topic" : self.config["mqtt_topic_prefix"] + device.status["macaddress"]+"/mode_homeassistant/value" ,"temperature_state_topic" : self.config["mqtt_topic_prefix"] + device.status["macaddress"]+"/temp/value" ,"fan_mode_state_topic" : self.config["mqtt_topic_prefix"] + device.status["macaddress"]+"/fanspeed_homeassistant/value" ,"fan_modes": ["Auto","Low","Medium", "High","Turbo","Mute"] ,"modes": ['off',"cool","heat","fan_only","dry"] ,"max_temp":32.0 ,"min_temp":16.0 ,"temperature_unit":"C" ,"precision": 0.5 ,"temp_step": 0.5 ## @Anonym-tsk ,"unique_id": device.status["macaddress"] ,"device" : {"ids":device.status["macaddress"],"name":str(name.decode("utf-8")),"model":'Aircon',"mf":"Broadlink","sw":broadlink.version} ,"pl_avail":"online" ,"pl_not_avail":"offline" ,"availability_topic": self.config["mqtt_topic_prefix"] +"LWT" }

the device works in C ,so guess one will have to update the update part to convert the values to F each time it sends it over mqtt.

as per all my other anwers, I simply don't have time to work on this project at moment, Soon as workload is less I will try and implement this.

It not so much that it reports in C. Its that at least for home assistant if you dont send temperature_unit : C in the MQTT Payload then HA assumes whatever is being sent is in the units HA is setup for. In my case it assumed °F. Now I was able to edit the AcToMqtt.py file myself.

If you send the °C designator to HA, HA will automagically convert the °C to °F on the Web GUI.

So no rush and maybe not even something that needs to be changed. Maybe just an update to the readme instructions for those of us in the US.