Forceu / barcodebuddy

Barcode system for Grocy
GNU Affero General Public License v3.0
442 stars 59 forks source link

Integrating Grocy and Barcode buddy as Add-ons within Home Assistant #257

Open Tim-G-Winters opened 2 months ago

Tim-G-Winters commented 2 months ago

Discussed in https://github.com/Forceu/barcodebuddy/discussions/223

Originally posted by **dvpfig** September 10, 2023 Hi, Not sure how up-to-date this repository is kept with the changes in HA, but the ingress type of access in HA add-ons seems not to be supported by Barcode buddy. Or at least I cannot find a way. I have both Grocy and Barcode buddy as two Add-ons in the same HassOS instance. Grocy is well installed and communicates with my Grocy on Android app, so it's reachable. For the Barcode buddy add-on, when trying to setup the connection to Grocy. I don't manage to make it work. The screen requests a IP address for Grocy and /api/ at the end. However, with ingress, I cannot seem to make Grocy accessible via an IP and port number. Is there a way with latest versions of HA, Grocy, to make Barcode buddy work?
mazetar commented 1 month ago

Hi, I'm using the most recent version of HA, running HassOS. I got Barcode buddy to communicate with Grocy by using the local address that the machine hosting HA/HassOS runs at. So I set the Grocy API URL http://192.168.0.100:9192/api/

Now if I use SSL for Grocy and have it exposed to the web I did not find a way to avoid going through the web to access it as it won't accept http connections (which is fair) and I can't be arsed to figure out local certs now :P When I had exposed HA to the web through duckdns then I could reach it from barcode buddy by uisng https://MySubDomainName.duckdns.org:9192/api/

Note that you would have to forward ports on your router for this to work, so check the portforwarding.

Tim-G-Winters commented 1 month ago

I get an error. Unable to connect to API: Invalid API key.

mazetar commented 1 month ago

Check that you are using the correct API key from Grocy? If you doubleclick the API key in Grocy and copy it, you should get it without any trailing spaces