Tutorial on how to create own integrations in python

Hello everybody,
i am new to home assistant and since i have a little bit of coding experience i wanted to create my own integrations, with devices i have such as myPV (i know theres already one github). But i can’t really seem to find a great tutorial on how to do so. Because there are functions i need such as async_setup_entry and i don’t seem to find a great tutorial on what i really need to write in to it and such. And i looked at different github projects but there are also very different to each other. Please help

There’s this:

Exactly the reason i wrote these.

2 Likes

Yeaaaah… OP was asking for a “great tutorial”… While the docs are pretty… let’s call it “lacking”.

You just start reading and it’s WTF after WTF:

  1. What is the “domain”? Why/how do I need to define it?
  2. What is “async” component? Why/when would I “prefer it”?
  3. What are the hass and config vars?

Good docs don’t use words/concepts that weren’t introduced earlier (or at least it links to the broader explanations of them).

I didn’t claim it was great, just pointed them to the official docs.

I started creating my integrations using this GitHub blueprint, it provides all the basics to get you started.
Just press the Use Template button and it will create a repo with a VS Code dev container and basic integration ready for you to rename and run.