# BalenaSense & MQTT & Homeassistant

**URL:** <https://forums.balena.io/t/balenasense-mqtt-homeassistant/209435>\
**Category:** balenaSense\
**Created:** [November 8, 2020, 1:30pm UTC](https://forums.balena.io/t/balenasense-mqtt-homeassistant/209435 "2020-11-08T13:30:01Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![DanielEdge](https://avatars.discourse-cdn.com/v4/letter/d/5daacb/32.png) [@DanielEdge](https://forums.balena.io/u/DanielEdge)\
**Post date:** [November 8, 2020, 1:30pm UTC](https://forums.balena.io/t/balenasense-mqtt-homeassistant/209435/1 "2020-11-08T13:30:01Z")

</div>

Has anyone got this combination working? I’ve followed the tutorial, I already have an MQTT broker running for other IoT devices, so I am trying to use this…

I can see that it is connecting to my mqtt broker as I see this in the logs:

1604863109: New client connected from 172.24.1.180 as Telegraf-Output-ODz3V (p2, c1, k0).  
1604863141: Saving in-memory database to /data/mosquitto.db.  
1604864087: Client Telegraf-Output-ODz3V disconnected.

… but nothing is actually published…

---

<div class="post-metadata">

**Author:** ![rahul-thakoor](https://avatars.discourse-cdn.com/v4/letter/r/9de053/32.png) [@rahul-thakoor](https://forums.balena.io/u/rahul-thakoor)\
**Post date:** [November 9, 2020, 7:45am UTC](https://forums.balena.io/t/balenasense-mqtt-homeassistant/209435/4 "2020-11-09T07:45:44Z")

</div>

Hey there

Can you confirm

- where you see these logs `1604863109: New client connected from 172.24.1.180 as Telegraf-Output-ODz3V (p2, c1, k0). 1604863141: Saving in-memory database to /data/mosquitto.db. 1604864087: Client Telegraf-Output-ODz3V disconnected.`? is it on the balena device running the balenaSense project?

- which mqtt broker are you using? Does it require authentication?

Thanks

---

<div class="post-metadata">

**Author:** ![DanielEdge](https://avatars.discourse-cdn.com/v4/letter/d/5daacb/32.png) [@DanielEdge](https://forums.balena.io/u/DanielEdge)\
**Post date:** [November 9, 2020, 4:14pm UTC](https://forums.balena.io/t/balenasense-mqtt-homeassistant/209435/6 "2020-11-09T16:14:57Z")

</div>

Hi Rahul,

I disabled authentication on my mqtt broker (using mosquito) but no dice!

For now, I’ve got it publishing to its own broker installed on the Pi running BalenaSense and then using NodeRed to move to my broker… How would I modify the telegraf.config file, when I modify this and reboot it seems to revert back to the original configuration.

I’ve also noticed that even after many hours, the accuracy score hasn’t progressed from ‘1’. I had used the same sensor with an arduino board using the official BSEC libraries and I would see this reach 3 after a few hours… could there be something awry?

I also don’t see values for bVoc and calculated co2, but maybe this is because the accuracy score hasn’t hit 3 yet…

Any thoughts really appreciated

Thanks in advance!

---

<div class="post-metadata">

**Author:** ![jtonello](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/jtonello/32/3246_2.png) [@jtonello](https://forums.balena.io/u/jtonello)\
**Post date:** [November 9, 2020, 8:18pm UTC](https://forums.balena.io/t/balenasense-mqtt-homeassistant/209435/7 "2020-11-09T20:18:30Z")

</div>

Hi Dan,

In order to edit the telegraf.conf file, you would need to clone the repository locally to your workstation, make your edits, and then push those changes to your device with `balena push <app-name>` using balenaCLI.

Are the steps you used to deploy the applications come from [this original post](https://www.balena.io/blog/monitor-air-quality-around-your-home-with-home-assistant-and-balena/)?

John

---

<div class="post-metadata">

**Author:** ![georgiats](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/georgiats/32/2571_2.png) [@georgiats](https://forums.balena.io/u/georgiats)\
**Post date:** [November 11, 2020, 1:40pm UTC](https://forums.balena.io/t/balenasense-mqtt-homeassistant/209435/12 "2020-11-11T13:40:39Z")

</div>

Hi there, I just want to follow up regarding the settings. All the settings on the Home Assistant side are saved to a persistent volume, but on the balenaSense side, Telegraf can only be modified by device variables (as mentioned here: [https://github.com/balenalabs/balena-sense#data-outputs](https://github.com/balenalabs/balena-sense#data-outputs)) or by the method John mentioned above, making changes to a local copy and re-pushing.

I hope you managed to have everything up and running now.  
Georgia
