General introduction to teddycloud <> MQTT (with HA)

I am sorry to have to ask this, but unfortunately I was not able to find a post here explaining the first steps in connecting teddycloud with a MQTT broker in order to use it with home assistant.
I found the vid on YouTube and I found some docker references in the forums but any preparations needed for maybe MQTT to allow teddycloud to connect seem to be hidden for me. Same goes for the wiki.
Does anyone have a small tutorial? Thank you in advance.

Setup your MQTT Broker, connect HASS to it and also connect teddyCloud to it by configuring the mqtt settings. Then it should show up unter MQTT in HASS

image

Hey there,

thank you for reminding me of the topic. I have solved this thanks to @ruN and instantly forgot about that topic like almost all forums are whenever you look up anything.
That is why I want to provide the steps myself so anyone else being as curious as I was can find the solution here.

If you want to have teddycloud available in Home Assistant you will have to perform a few steps to do so.

First of all a running instance of teddycloud is required which is done by steps described in the wiki and the forums thorougly.

Next is the creation of MQTT credentials so teddycloud is eglible to submit its data. What I was not aware of is that Home Assistant not only uses MQTT but instead it manages the MQTT server using its MQTT broker addon. So in order to create credentials you will have to use Home Assistant itself. The generic documentation can be found here: HA MQTT User Creation
In our case we will have to go to Configuration → Users → Users. You should see these already here: Home Assistant Content, Supervisor and yourself as an administrator.
Create another user for instance teddycloud. Set a password, set him to active and in my case I have chosen for the user to be a local user (e.g. use your private LAN). Once saved I have decided to restart my whole home assistant (device) to be sure changes are applied however this might have been unneccessary.

Third:
Important! Do not check “Enable MQTT” at the beginning. Settings are applied immediately so before you have entered credentials and so on leave the switch be in order to avoid failed login attempts and stuff.
I recommend to press each field’s save button once the details are entered correctly.
MQTT hostname: hostname of your MQTT server (in most cases the same server hosting your HA instance - especially if you are using HASSIO)
MQTT port: 1883 is fine for now
Username & Password: the ones set in Home Assistant for the new users. Beware password is not hidden!
Client identification: could be anything you want if you want to run different instances of teddycloud this is for you to identify each’s logging.
Topic prefix: internal handling again, leave it as it is or adjust in case of multiple teddycloud instances.
QoS level: 0 is fine
One more thing: under Category Core .server set Host URL to your teddycloud’s URL, e.g. http://tc.fritz.box
It is said in the forums this might be needed to have it running properly. Nothing lost if it set correctly anyways.
Press save on the text field. Now reload the whole page and ensure all settings are entered correctly and if not repeat.
Once all is correct even after reload of the page, toggle the switch “Enable MQTT” to have teddycloud inform MQTT about all devices and entities. After about 10-20 seconds refresh the page again to see if “Enable MQTT” still is on. If the connection fails or settings are incorrect teddycloud will disable MQTT by itself after a few tries thus checking here will get you an idea if everything went well.

If MQTT connection is working properly you will find the devices and entities in the developer tools of Home Assistant. If “Enable MQTT” has switched back to off you can check the MQTT logs in Home Assistant: go to Configuration → Addons → MQTT Broker → Logs

On your server running the teddycloud docker you can run:

docker container logs $(docker container ls -a | grep teddycloud | cut -d ’ ’ -f 1) --follow

Once you can see the logs reenable MQTT in teddycloud and check for the logs popping up.