Help with integration or custom component

Hi,

first of all I would thank everyone for this great software and the contribution.

I’m using home assistant for a while, now. And what should I say: it’s awesome.

Now I’m trying to write my first integration or custom component for a heating system which is only accessable through web interface. The communication seems to work from the python module but I have some questions regarding integration in home assistant.

I have started with the sensor platform example and this is more or less clear for me. I’m struggling with some of the options of the heating system some options can be set e.g. to ON, OFF or AUTO. So at least 3 possibilities here. To my understanding I cannot use a switch for that, right?

So in home assistant I would implement such a thing with an input_select. But how to provide such thing from my integration side and react on changes?

Do you have a hint to get me started? Thank you very much for your help.

Br, kutzi

I’d take a look at some of the existing integrations that deal with climate to give you a better idea of how you might implement that. For example this somfy integration.

For a more general introduction I wrote a tutorial on creating a fully working custom component with CI, unit tests, config-flow and options-flow that you read here: Building a Home Assistant Custom Component Part 1: Project Structure and Basics - Automate The Things

Hi Aaron,

thanks for the hints and the quick response. I will definitely look into that. The somfy integration is giving a good idea how to implement such a thing for a climate. If I understand this right the way to go is with the presets, right?

Is there a way to implement something like a switch but with multiple states?

By the way, very interesting tutorial. I will also have a look into this direction. Thanks for the support.

Br, kutzi

If I understand this right the way to go is with the presets, right?

If your integration is going to control a climate device it probably makes sense to start with a ClimateEntity as a base and use the climate platform instead of a sensor. This will give you integration access to all of the climate services that you decide to implement in your entity.

Is there a way to implement something like a switch but with multiple states?

This would just be a sensor if you didn’t decide to use the climate platform. You can expose service calls that some one who would use your integration could use to control the entity. See the developer docs for more information on services.