Home assistant to Brewfather intergration

Hi all,

I’m trying to intergrate Brewfather with HA. What i’m trying to do is use sensor values from Home Assistant entities, to feed into the Brewfather cloud portal.

i have figured out I (probably) need to the Brefather custom stream method for importing HA data into Brewfather. And somehow combine that with a rest_command similar to below:

rest_command:
  rapt_pill:
    url: "http://log.brewfather.net/stream?id=xxxxxxxxx"
    payload:
      {
      "name": "xxxxxxxxxx", 
      "temp": "{{ states('sensor.pill_temperature')}}",
      "gravity": "{{ states('sensor.pill_specific_gravity')}}",
      "battery": "{{ states('sensor.pill__battery')}}"
      }

The above code doesn’t work, but i’d be super appreciative if someone could point me in the right direction

Cheers

I figured it out, for those who are looking for it, the following works when added to configuration.yaml

rest_command:
  rapt_pill:
    url: http://log.brewfather.net/stream?id=XXXXXXXXXXX
    method: POST
    headers:
      accept: "application/json, text/html"
      user-agent: 'Home Assistant'
    payload: '{"name": "homeassistant","temp": "{{states("sensor.rapt_pill_fc12_temperature")}}","temp_unit": "C","gravity": "{{states("sensor.rapt_pill_fc12_specific_gravity")}}","gravity_unit": "G","battery": "{{states("sensor.rapt_pill_fc12_battery")}}"}'
    content_type: 'application/json; charset=utf-8'
    verify_ssl: false

Cheers

1 Like

Great find!
How long did it take for the device to show up in Brewfather? And how often does it update?
[EDIT] Found out it did not update automatically, you have to use the restful service :slight_smile:
/L

Thanks! This was extremely useful. Turns out I was like lovekull76 and also wondered at first why the data was not sent to BrewFather… I just wrote a blog post to document the solution and explain the need to add an automation RAPT Pill and Home Assistant – Concept Fermentation Lab . I hope that could be useful to someone :slight_smile: