Brew Bubbles: Web-Enabled Airlock

Homebrew Talk - Beer, Wine, Mead, & Cider Brewing Discussion Forum

Help Support Homebrew Talk - Beer, Wine, Mead, & Cider Brewing Discussion Forum:

This site may earn a commission from merchant affiliate links, including eBay, Amazon, and others.
@LBussy I'm tinkering around with HomeAssistant and was thinking if I could log/use BrewBubbles. So where does the general HHTP POST from BrewBubbles come from? Is there an endpoint after the IP address, i.e. "http://IP_ADDRESS/ENDPOINT"? I've tried a few guesses but not yet been able to get HomeAssistant to actually hear anything, but that could also be me fumbling in the dark (again)!
 
Last edited:
Hell if I know! :p Lemme look ....

Are you talking about a "Generic HTTP Target?" That doc section shows you the payload, The target string is a full url like "http://hasst.local/brewbubbles/" (or whatever you want to call it.) It's set in "URL Target Settings." There's some additional information in that part of the doc.

(Incidentally, I found your name in the source code.)

If all that is taken care of, you might be able to see something in the serial log. There should be enough of a clue there to figure out what's going on.
 
Hell if I know! :p Lemme look ....

Are you talking about a "Generic HTTP Target?" That doc section shows you the payload, The target string is a full url like "http://hasst.local/brewbubbles/" (or whatever you want to call it.) It's set in "URL Target Settings." There's some additional information in that part of the doc.

(Incidentally, I found your name in the source code.)

If all that is taken care of, you might be able to see something in the serial log. There should be enough of a clue there to figure out what's going on.
Well if YOU don't know.... :no:

Yes, Generic HTTP target, but I could never find the full url of what BrewBubbles is supplying in the documentation. The information that HomeAssistant requires about the source of the POST is "http://IP_ADDRESS/ENDPOINT". I guessed several options (I think including .../brewbubbles...) but never got one to work. In BrewBubbles I think I just point to my HomeAssistant IP address, but I'm not sure if it requires anything else.

So far I've not found a combination of source and dstination that works, but I must stress I'm fumbling around with options that I'm not fully understanding!
 
You'll have to excuse any terminology here, I haven't got to grips with it yet. My "task" is get information from BB into HA. So is this a POST from BB AND a GET from HA? Is this just a POST from BB, or just a GET from HA? At this point I'm unclear if HA requests the info from BB or if BB sends and HA is always listening.

More reading over a coffee or several :coff3:
 
Well my time with HAST ended when I moved full time into an RV ... but BB will POST to an endpoint, that means something in HAST has a RESTful API to allow that. The way HAST works most easily is to have dedicated integration or MQTT. Right now Brew Bubbles does not have MQTT but it could (I think.)

So your paths are "get Home Assistant to accept JSON POSTed by a device," add MQTT support to Brew Bubbles and send a pull request, or wait till I knock a couple projects off my list and can look at it.

One way that could work is to create an endpoint on your HAST host to receive the data and then turn around and send MQTT from there. You can look at this example in BrewPi Remix to see how to receive the POST from the device. You'd then need to code the rest to transform and send via MQTT.
 
@LBussy Thanks for the info. I've tried to run before I've learned to crawl here, time to go back to some testing. I've downloaded RESTer extension for Chrome and in between hosting and tasking over the next few days I'll go back to first principles.
 
So, after lots of anti-alcohol. Using RESTer on my laptop and doing a GET to the IP address of BB I get the HTML code. So I'm guessing I need to GET a different port or endpoint?

When I telnet to BB I get the following at the timing specicied in the target frequency.

2023-01-29T16:41:20Z V: Triggered URL Target push.
2023-01-29T16:41:20Z V: Host lookup: 192.168.20.197.
2023-01-29T16:41:20Z V: Resolved host 192.168.20.197 to IP 192.168.20.197.
2023-01-29T16:41:20Z N: Posting to: 192.168.20.197
2023-01-29T16:41:20Z V: Connecting to: 192.168.20.197 at 192.168.20.197 on port 80
2023-01-29T16:41:26Z W: Connection failed, Host: 192.168.20.197, Port: 80 (Err: 0)
2023-01-29T16:41:26Z E: URL Target post failed.
So BB is talking, but I'm not listening, or I'm listening to the wrong thing?
 
So, after lots of anti-alcohol. Using RESTer on my laptop and doing a GET to the IP address of BB I get the HTML code. So I'm guessing I need to GET a different port or endpoint?
There is not currently an endpoint dedicated for any generic use. There is one used to supply information to the index page, however. Here's the JS in index,.htm that does the GET to Brew Bubbles:

https://github.com/lbussy/brew-bubb...350cc325c2d2a54d2020/data/index.htm#L168-L223
You can look at that and see the endpoint is /bubble/ so hit that and you will see the JSON returned. I will warn you that since this is not a "published" API, I reserve the right to change it at any time and not consider it a breaking change. Given how often I have had to make changes, you should be safe.

When I telnet to BB I get the following at the timing specicied in the target frequency.
That looks like whatever you have chosen as your target is not listening.
 
So there is a small amount of illumination dawning. I can GET from HA to the BB endpoint /IP/bubble/ and I understand,
You can look at that and see the endpoint is /bubble/ so hit that and you will see the JSON returned. I will warn you that since this is not a "published" API, I reserve the right to change it at any time and not consider it a breaking change. Given how often I have had to make changes, you should be safe.
could make it stop working.

What I can't get working is the PUSH from BB to HA and am I right that the BB PUSH is always to port 80, as below?
2023-01-29T16:41:20Z V: Triggered URL Target push.
2023-01-29T16:41:20Z V: Host lookup: 192.168.20.197.
2023-01-29T16:41:20Z V: Resolved host 192.168.20.197 to IP 192.168.20.197.
2023-01-29T16:41:20Z N: Posting to: 192.168.20.197
2023-01-29T16:41:20Z V: Connecting to: 192.168.20.197 at 192.168.20.197 on port 80
2023-01-29T16:41:26Z W: Connection failed, Host: 192.168.20.197, Port: 80 (Err: 0)
2023-01-29T16:41:26Z E: URL Target post failed.
The path I set in BB for the URL Target is, http://IP:8123/api/webhook/brewbubbles
The HA webhook set in HA is to the (default) HA port 8123 and the port is not separately configurable, in the above path I can only configure "brewbubbles".

Have I at last appeared at the right tree to bark up?

Additional: I can POST from RESTer to HA with the above path and sample BB data and it works fine.
 
Last edited:
Have I at last appeared at the right tree to bark up?
Yes. :)

It seems I might have to update the lib with which I do that work with the url and port. - the good news is that guy that owns the other lib is standing right here. The bad news is I might end up with other library issues caused by upstream stuff changing.

If you have a moment would you create an issue on GitHub so I don't forget this? I have some other stuff percolating these next days but I might be able to look at that later this week.
 
@LBussy I'm tinkering around with HomeAssistant and was thinking if I could log/use BrewBubbles. So where does the general HHTP POST from BrewBubbles come from? Is there an endpoint after the IP address, i.e. "http://IP_ADDRESS/ENDPOINT"? I've tried a few guesses but not yet been able to get HomeAssistant to actually hear anything, but that could also be me fumbling in the dark (again)!
I was able to glean some more information about a "proper" MQTT push to HA. I'll make myself some notes and queue that up to the next effort here. I just need to actually find my Brew Bubbles board. :)

Add HAST Support through MQTT #50
 
@LBussy That won't stop me getting out "a spare" d1mini and seeing what happens if I try and configure a new sensor... Well it will 'till next week, which gives you plenty of time :oops:
 
Not wishing to highjack this thread, but yes, ESPHome is what I was thinking of. Got a few sensors already running, just might try a change/addition to see if I can get the same data into MQTT...
 
Okay try #2:

What I was saying was .... Espressif has expressed and acted upon a desire to deprecate the ESP-8266 and go all-in on the ESP-32 ecosystem. The core platform support for the 8266 is a mess, and getting the libraries I use to work with the broken core is a depressing prospect to be honest. I talked it over with @Thorrak a bit and he's got me convinced it's time to set aside my old boards.

So, I ordered some direct from China, and when they get here, I am going to work on porting Brew Bubbles to the new platform. Then, I'll look at fixing a couple bugs, add a feature or two (like HAST), and see if I can get a release out without making it an all-summer project. If you are interested and order now, you will be ready when I release.

1677500562567.png1677500576995.png

"What about my Brew Bubbles board?!" Not to worry, as you can see, the outside row of pins is nearly identical in function to the older board. The dimensions are the same, and the new board is 0.6g lighter (I wonder if the iSpindel folks will take this up?) It should plug right on your existing Brew Bubbles boards without any muss or fuss.

And, come on folks, it's purple!

You will need a USB-C cable though, that's one for sure difference. Other than that I think it will be a simple upgrade for you folks. Let's hope it's as simple for me.
 
@LBussy I've had limited exposure to ESP32, what I can say is that the S2 mini, seems a little "odd". Not the double row of pins, but trying to get Arduino or ESPHome to talk nicely took a while to find the right post!

I got the S2 mini initially without reading and thought it was going to be a "drop in" for ESP8266 D1-mini. Still tinkering with the S2 mini on ESPHome, once initially configured it appears to be OK. --crossing fingers--
 
I can say is that the S2 mini, seems a little "odd". Not the double row of pins, but trying to get Arduino or ESPHome to talk nicely took a while to find the right post!
Well, that will all be on me. ESP32 is, in general, going to have different libs created for it depending on the ecosystem. When I am done I intend to add HAST as a feature.
 
Hello,
I'm a very occasional brewer that made a brewbubbles a few years ago. I'm doing a batch right now mainly to test using Brewfather (still in the 30 day premium trial). Brewbubbles is working well and I can see the data in Thingspeak, but not in Brewfather. After a few false starts, I think I have the settings in both correct, but Brewfather is still waiting for an initial logging. I did update Brewbubbles, now v2.2.3. Any idea what I'm doing wrong?
James


1705419427503.png
1705419274173.png

1705419355804.png

1705419539166.png

1705419571253.png
 
Hello,
I'm a very occasional brewer that made a brewbubbles a few years ago. I'm doing a batch right now mainly to test using Brewfather (still in the 30 day premium trial). Brewbubbles is working well and I can see the data in Thingspeak, but not in Brewfather. After a few false starts, I think I have the settings in both correct, but Brewfather is still waiting for an initial logging. I did update Brewbubbles, now v2.2.3. Any idea what I'm doing wrong?
James
Well, I checked, and Brewfather removed the original API. Like, removed.

Old: PATCH to https://api.brewfather.app/v1/batches/:id

New: PATCH to https://api.brewfather.app/v2/batches/:id

Theoretically, I could change the URL, issue, and update, and let you test. I suspect, in practice, I will wish I had not looked. I can't say when I can look, and I know I do not have a Brewbubbles device with me, but I can give it a go and let you test it.

Logged as issue #60.
 
Last edited:
Well, I checked, and Brewfather removed the original API. Like, removed.

Old: PATCH to https://api.brewfather.app/v1/batches/:id

New: PATCH to https://api.brewfather.app/v2/batches/:id

Theoretically, I could change the URL, issue, and update, and let you test. I suspect, in practice, I will wish I had not looked. I can't say when I can look, and I know I do not have a Brewbubbles device with me, but I can give it a go and let you test it.

Logged as issue #60.
OK, thanks, no rush. I wanted to see if being able to see my brewbubbles and floaty hydrometer data in one place was worth the premium subscription cost, but I suspect it won't be.
Looking at two different web pages or apps really isn't a big deal.
 
OK, thanks, no rush. I wanted to see if being able to see my brewbubbles and floaty hydrometer data in one place was worth the premium subscription cost, but I suspect it won't be.
Looking at two different web pages or apps really isn't a big deal.
Yep, this is bigger than a breadbox, unfortunately. Not just Brewfather, but there are a lot of other lib changes that make me sad.
 
For your information I did not change anything and for me it is still working fine in Brewfather (v. 2.10.5):

1705836775985.png


1705836858537.png
 
For your information I did not change anything and for me it is still working fine in Brewfather (v. 2.10.5):
That's good to hear. I don't have a setup I can use here, so I was going the route of a simulator, and that was all sorts of messed up.

Sounds like a setup issue of some sort, then.
 
Back
Top