MQTT air-condition

Hi
I’m using esp8266+MQTT to control just about everything and was wondering if I can control my AC.
I can transmit IR and assuming I know how to build my tx code, how can I integrate it into HA?
Thanks,

Adding AC would indeed require a new AC component with a MQTT platform

I just recently installed home assistant and I’m also looking into controlling airconditioner by automation :slight_smile: I got my heatpump ir codes (Fujitsu) more or less figured out and I’m also leaning to mqtt for my script to listen and then control the airconditioner.

Any pointers into creating a new component are welcome. Specially all the examples and demo systems seem to have only on/off type of switches. I’d like to have an ac component that would display the temperature, but you could also set values for different parameters:
For example:
Mode (Heat, Cool, Fan, etc.)
Fan_mode(High, Med, Low, Quiet)
Sensor(on/off)
Temp(16-30C)
etc.

How can I create a multiple choice selection in homeassistant?
If it’s not possible, I guess I could initially get away by just setting the temperature by home assistant and then use the aircon remote to set the mode, fan speed etc, but ultimately I’d like to be able to control all of them from home assistant.

Have a look at the thermostat component: github.com/balloob/home-assista … init_.py

Adding a new component will require a component, a demo platform, an actual platform (duh) and frontend integration. But the component part can go in without proper frontend integration, that come later.

I’ll try to look into that, although I’m not so proficient with Python yet that I’m not sure I’ll be able to do that, but I’ll give it a shot. If nothing else, I’ll probably learn more python even if I can’t get it to work :astonished:

For now I got my own python script to listen to a mqtt topic, and if the topic receives a new value (temperature) it sends the proper commands to the airconditioner. So initially it’d be enough if I can just send a temperature value from HA to a mqtt topic and have the frontend temperature component for setting the temp value.

[quote=“balloob”]Have a look at the thermostat component: github.com/balloob/home-assista … init_.py

Adding a new component will require a component, a demo platform, an actual platform (duh) and frontend integration. But the component part can go in without proper frontend integration, that come later.[/quote]

I saw the thermostat component but I could not understant how to use it, in my case.
I would like to integrate a GUI that can set something like heat/cool/fan, temperature, on, off.
I didn’t see anything like that and I think I’ll have to create it myself. and guidelines on how to create such component?

[quote=“balloob”]Have a look at the thermostat component: github.com/balloob/home-assista … init_.py

Adding a new component will require a component, a demo platform, an actual platform (duh) and frontend integration. But the component part can go in without proper frontend integration, that come later.[/quote]

I think I’m getting there, but I have a few questions:

  1. how do I add a new, custom component? where should I put the custom_components(github.com/balloob/home-assista … components) directory?
    2.I’m not sure I fully understand what you stated regarding the req. of a new component. Doest the .py file in the custum_components folder defines the usage and the GUI

Thanks,
CT

I know I’m bumping this one but I was browsing through the heat control component source and apparently it includes an undocumented ac_mode bool switch which basically makes the component work as AC instead of a heater. I don’t see an option to run one as both though - it will still require a new (or edited) component I believe.

OP, have you resolved your issue?

BUMP

I too have a simple esp8266 with an IR emitter, with simple HEAT COOL OFF options.

Doesn’t seem to be a right way to configure this to hook it into the UI.

Were any conclusions found?

I managed to create a custom ‘climate’ component that sends mqtt messages (mode, temp, swing, fan, etc). I then have a custom script that listens to the mqtt topics and when a message is received it sends the proper IR signals to the heatpump. Works well enough for my purposes although the code is ugly :slight_smile:

Would love to see a screenshot and the sample code!!!

I’m not happy with what I have - very lacklustre.

Can you post your code? Maybe users here can help streamline it. Looking for the same thing MQTT - IR control. Not sure if i could integrate it via mysensors

This is Excellent!
@balloob, can we integrate it in next version?

Here’s a screenshot. Still trying to understand how to add additional items. For example my code that controls the heatpump has an option for having a motion sensor (integrated in the pump) on or off. I’d like to add that to the frontend. Also the code should be modified to read and add device data from the config file so I’d easily add several pumps. As you can see from the code, the hass custom component is almost straight copy of the climate demo component :slight_smile:

The code is available from here:

The heatpump is a Fujitsu model.

This first preview of the code is interesting. I propose to modify the communication protocol to JSON to send all the informations from HASS to the external device throw mqtt like the AC remote do.

Something like the following example would be nice:
{ “targetTemperature”:21, “masterMode”:“Heat”, “fanMode”:“Auto”,“swingMode”:“Off”,“awayMode”:false }

I am looking to use an ESP8266 with IRremoteESP8266 and HeatpumpIR

Can I ask, is a “heatpump” another name for reverse cycle airconditioning? Sounds like a silly question, but I just want to be clear!

It’s the same thing.

Bump
Any chance to see integration of the above code in future releases?

I’d like to see this also, some details about my current setup here: