Integrating BrewBlox with Home Assistant?

@Bob_Steers I don’t have a Tilt (yet).

This integration also works with openHab (another smarthome system).

Setup:

  • openhab2 running on brewpi machine (which I cannot recommend, a pi3 quickly runs into memory trouble)
  • mosquitto running on same machine
  • brewpi with hass container (I really dislike this abbreviation, being a German I always think, why all the hate? :wink: )

Configuration:

  • in docker-compose.yml i added:

hass:
command: --hass-mqtt-host=192.168.1.6 --hass-mqtt-port=1883
image: brewblox/brewblox-hass:develop
restart: unless-stopped

It took me a while to figure out that I need to specify the actual IP of my machine to access localhost outside of docker (being a container noob). Also, there’s a typo further up in Bob’s example (it’s “unless-stopped” and not “unless_stopped”).

In openhab I needed to install the MQTT binding and configure the MQTT broker (which I had already done). Furthermore, it needs the JINJA transformation service.

And - done. Brewblox things magically appeared in the inbox. :slight_smile:

Thanks Bob for this additional integration! Even though I’m not sure what to do with it, the nerd in me is quite happy to see the fermentation temperature next to the living room temperature. :slight_smile:

2 Likes

If you’re putting everything on the same host anyway, you could also expose the Brewblox MQTT broker

brewblox-ctl service expose eventbus 1883:1883

This only works if you’re not using a password on your broker, but does cut back on process duplication.
Home assistant and Brewblox have no overlap in used topics, so are happy to share a broker.

Yea, I can see how that would look weird.

172.17.0.1 is also a valid IP address to reach the host machine.

Thanks! I went back and fixed that.

You’re not alone. We’ve long since figured out that many users want to see lots of data in pretty graphs - just because they can.

2 Likes

Thanks for your advice, bob! Good idea to use the existing mosquitto broker, I’ll try that.
If I think of any integration that is actually useful in the future, I’ll post it here. :slight_smile:

Hi @Bob_Steers

I wonder if it’s possible to get brew-blox to be installed as a Home Assistant addon?

Many thanks

Andy

We currently only offer the service discussed in this thread. Further integration is something we’d like to do in the future, but we need to find the time.

To revive this topic - I just finished installing my brand new Tilt in BrewBlox and I’d also be interested to have the Tilt values exposed to MQTT HASS/openHAB.

I think I can do a quick pass to add that. What would you prefer: temp included in both F and C, or omitted?

I’m more a SI-unit kind of guy, but I’ve seen postings about the Tilt with questions about Fahrenheit, so it’s probably nice to just export it all.

Thanks Bob, you’re a wizard!

1 Like

Changes are online. They’ll be included in the next release, but you can also preview them now by editing docker-compose.yml, and replacing {BREWBLOX_RELEASE} with develop for your hass service.

For example:

...
  hass:
    image: brewblox/brewblox-hass:develop
...

Then run

docker-compose pull hass
docker-compose up -d hass

Turns out that home assistant does some auto conversion for temperatures, so there was no need to send both degC and degF.

1 Like

Awesome, I’ll try it out! :slight_smile:

Works like a charm. I expected nothing less. :slight_smile:

Had to move brewblox to another Raspberry though because the tilt didn’t transmit far enough. Also worked like a charm thanks to the snapshot feature. I continue to be amazed how far brewpi has come. :slight_smile:

1 Like

While doing some diagnostic work in home assistant, I found old brewblox entities which have been left over from when I was experimenting with the brewblox proof of concept integration. But I’m unable to delete these old entities because no unique ID has been allocated to them. So far I’ve not found a way to get rid of these old entries - you see references to them in the home assistant log viewer.

The home assistant forums point to the lack of a unique reference in the entity when it is created as being the root cause and to check back with the developer of the integration.

When the next phase of development on this proof of concept is done, perhaps someone could take a look at this. In the meantime I’ll continue looking to see if there is a way to remove these errant entities.

MQTT Discovery - Home Assistant suggests that they can be removed by sending an empty message to the configuration topic.

The topic is defined as homeassistant/sensor/{service}__{sanitized_id}/config. IDs are sanitized by removing all characters that are not letters, numbers, or “_” / “-” characters.

For example, Ferment Fridge Sensor on spark-one would be published as homeassistant/sensor/spark-one__FermentFridgeSensor/config.
If you use a client like MQTT Explorer to publish an empty message to this topic, does this remove the sensor?

I added an issue to add unique IDs the next time the brewblox-hass service is worked on.

what a great find that exploring tool is Bob - very handy thanks. I browsed to those sensor items and could easily see the old sensor settings. Once an entry was highlighted, MQTT Explorer has a RETAINED X button highlighted in red, so I simply pressed that, the entry disappeared and a few moments later HA tidied up the entity.

Thanks for the advice - appreciated

Is there any chance of adding a port setting for the destination mqtt server? I’m using --hass-mqtt-host= but would love a --hass-mqtt-port= as well because my mqtt sever is on a non-standard port.

Apologies I see this is already supported!!

1 Like

I think the last brewblox update broke the home assistant integration, I can’t find any messages/readings being broadcast to the mqtt server anymore. Unfortunately I don’t know how to diagnose this further. :-/

Could you please run brewblox-ctl log?

Here’s the log: https://termbin.com/oftj9
The hass service is shown as restarting and there are lots of errors about the hass service in the log but that’s far above my humble skills.

It looks like it’s suffering from a bug in Debian Buster. As a workaround, add privileged: true to the hass service in docker-compose.yml, and then run brewblox-ctl up to apply the changes.

2 Likes