Integrating with Home Assistant?

I didn’t implement an option for providing a broker password so you would need to add it directly to the code here like so:

const client  = mqtt.connect(`mqtt://${host}:${port}`, {
  keepalive: 60,
  connectTimeout: 60000,
  password: 'password123'
})

The client broker options can be found in the api documentation for the mqtt client. Hope this helps.

1 Like

Thanks for both responses. I like the bridge idea better as well. I think i’ll go that route.

Thanks!

OK, bridge is setup, and I see my topics populated from the hestia to my HA broker.

The problem is, if i set the temp in HA, it updates MQTT, but never seems to get back to the Hestia…

Here’s my bridge config:

## Bridge to HA
connection ha-bridge
address 192.168.86.40
topic # in
topic # out
remote_username ha
remote_password ha'spassword

and my climate.yaml in HA.

  • platform: mqtt
    name: TestHestia
    current_temperature_topic: “hestia/testhestia/temperature”
    temperature_command_topic: “hestia/testhestia/cmnd/setmintempsetpoint”
    temperature_state_topic: “hestia/testhestia/mintempsetpoint”
    min_temp: 62
    max_temp: 78

I see hestia/testhestia/cmnd/setmintempsetpoint in my HA mqtt, along with all of the other expected hestia topics, and they’re getting updates from the hestia, but if I chance the temperature on my HA’s panel for the hestia, i see it update in mqtt on HA, but not on the Hestia. eventually hestia pushes the setting that’s on itself back over the bridge, and overwrites the one I set in HA.

So if the temp is 76, say. I set it to 74 in the HA ui. i see hestia/testhestia/cmnd/setmintempsetpoint change to 74 in my HA mqtt. but the temperature on the display stays 76. Then eventually, a minute or so later, hestia/testhestia/cmnd/setmintempsetpoint on my HA mqtt changes back to 76.

Have i inadvertently setup some sort of one-way bridge? Do i have to do something on the HA side to bridge the other direction?

I think i figured out my broker problem.

I changed these two lines:

to:

and now when I update my Hestia’s temperature through HA, it almost instantaneously updates on the Hestia’s display.

Apparently mqtt allows you to add or append prefixes over the bridge! So all this work I did renaming the topics… Maybe I could have just appended a “livingroom” root topic and avoided it all… :stuck_out_tongue: This is all setup for test at the moment, and not in its final config, so maybe ill try that when I wipe it out to do the final configuration.

Thanks again! I’ll be writing all of this up once its working, and i’ll share it here once i do.

2 Likes

Another upddate on the mqtt front!

If you’re looking for a way to rename these topics so you dont have several hestia’s clobbering each other in your HA mqtt bridge, you can have mosquitto append a topic via the bridge! I just tested this out.

If you change that topic command above to:

All of your topics that look like this locally:
hestia/local/temperature

will come across the bridge like
someid/hestia/local/temperature

SO! this means if you have a half a dozen hestias all reporting over the bridge, you don’t have to do ANY topic renaming on your hesita openHAB in the channels config. You just append something like “livringroom/” to your bridge!

Then on the HA side, you’d add you climate.yaml to look something like:

and if you added another for your dining room or something, you’ll append diningroom/ to the bridge, and make all of your config topics diningroom/hestia/local/whatever

Pretty slick!

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.