Skip to main content

Getting moving with Grocy

Now we have Grocy working, even if in skeletal form, the next hurdle is to cut the tie to the PC and go mobile. The advantages of being able to update stock levels on the hoof are obvious. All consume and purchase operations can be done at the point of use without the need to make notes and mark these up later. Inventorying can be performed at the storage location rather than dragging everything to the computer or more note making.

What is needed, therefore, is mobile access to Grocy via a smartphone or tablet. There are multiple ways to achieve this.

Web Browser

The first and simplest method is to use the web browser on your device. Although, at least with Android devices, the browser is slightly finnicky about which address it will accept for the Home Assistant (HA) server. Using the standard homeassistant.local:8123 address results in an error message 'This site can't be reached DNS_PROBE_FINISHED_NXDOMAIN.'

There appear to be known problems with Android phones (see 1/2/3). Unfortunately the HA Community pages are a bit light on details of the actual cause and how to fix it. Happily though the way round it, for me at least, was not complex.

Although the text URL didn't work, entering the IP address (circled) with the port number did the trick (drop the /24 suffix though - it's a definition term for the IP number and doesn't form part of the address). So in the case above, typing 192.168.0.97:8123 into the browser address bar got me to the HA log-on screen.

Enter your login details and you are into a mobile version of your HA homepage. From here go the menu (circled) and follow the familiar Settings > Add-ons > Grocy route to get to the Grocy HA interface.

Scroll down to Open Web UI to get into Grocy.

You'll have to log on again, but after that the whole interface is available via the browser. It's that easy.

Home Assistant App

If you'd prefer, Home Assistant have mobile apps for Android and iOS devices. The Android one is available in the Play Store.

Once installed it opens onto a screen that allows you to select your local HA server and then you are ready to log in.

I left phone tracking off as I don’t need it for Grocy and we are back into the familiar HA interface again.

Navigate to Grocy, log-on and once again you are in the Grocy interface, just not in dark mode this time.

Grocy App

The last way to accomplish the same task is to use the Grocy mobile app, which is available for Android or iOS and is produced by Patrick Zedler.

Once started the Welcome to Grocy Android! screen tells us that we will need either a stand-alone server running Grocy or one hosted on Home Assistant. All good, we have the latter so can select the Own server button.

Choose Allow on the pictures permissions request in order that the app can read the QR codes that it will ask for next and ... at this point the set-up procedure fell over for me. Partly because I didn't follow the instructions closely enough and partly because the automated set up procedure is not that robust. However, after a few attempts, I managed to stumble through it.

So not in the order that I did it, here is how to prep for automated server sign-in on the Grocy app.

Basically you need to set up API keys in Grocy and in HA before opening the Grocy app and attempting to log on to your Grocy/HA server.

Grocy API key

On another device (ie back on the PC) go to Grocy on HA and choose Manage API keys from the Settings menu.

The API keys page will open; select Add (circled).

In the Create new API key dialogue box type a name for the new key and press OK.

Grocy will now generate an API key; a 50 character string of text. Clicking the QR code icon (circled) brings up the API key QR code. If you are logged into Grocy you can access the QR code whenever you wish.

Now that is complete you must set up a Long-lived access token in Home Assistant.

HA Long-Lived Access Token

To get to this part of HA you need to click on [Initials] [Your ID] in the bottom left hand corner (circled), which brings up your Profile on the General tab.

What we want is located at the bottom of the Security tab, Long-Lived Access Tokens.

If we select Create Token a dialogue to create a new token will open asking you to name the token.

On clicking OK HA will generate a 183-character access token, this is a one-shot affair and once you complete the process you won't be able to access it again from the HA interface. So best to copy it and keep it for future reference.

Generate QR Code will pop up the required code that the Grocy Android app will ask us for. Don't close this box. Leave it open and return to the app (for ease you can have the Grocy API key QR code open in another HA tab).

Grocy App set-up

With the two QR codes that the Grocy app will ask for generated we can now go back to the app.

Initially it will ask for the Grocy API key, look at it and detect that you are using Grocy as an Add-on with HA. Now you can point it at the HA Long-Lived Access Token QR code and, after a bit more staring, it should prefill the fields on the manual login page. Those being Server URL and Long-lived access token for HA and Ingress proxy identifier and Valid API key for Grocy. I have no idea where the data in the Ingress proxy identifier field comes from but it is another text string, 43-characters this time.

Clicking Login will probably lead to it falling over but this appears to be due to the same reason that the text HA address couldn't be used in the Android web browser above. Replacing the Server URL (ie homeassistant.local:8123) with the HA server's IP address should correct this (ie 192.168.0.97:8123 in this case).

We now have Grocy installed and useable at the point of contact via whichever of the above routes you chose. One final feature has to be set up in order to meet the initial requirements for the program I outlined at the beginning of this series. The ability to use barcode scanning to track the use of products.

P.S. You might get a pop-up notice describing different barcode scanning options whilst you are setting up the Grocy app. You can access this feature later once everything is working so I chose Ignore.

Comments

Popular posts from this blog

How-to: Setting up a Blogger account with a non-Google e-mail address

As I've set up an e-mail address for the blog it makes sense to be able to post from it too. To do that I will need to set up an account with Blogger for the new e-mail address. At the same time I'll create a gmail account to both manage the blog and give access to the Google apps suite without the monthly fee. Skullcinema@gmail.com is already taken (as there is nothing new under the sun), but I can take a related e-mail address. I won't publish it here as the first address will generate enough spam as it is. Setting up a gmail account really doesn't require a guide, but it is covered here if you need one. So, off to set up an account  through Blogger . First of all though, log out of Google and/or Chrome or it will pull you straight through to Blogger on the account you are logged in on. Choose SIGN IN in the top right-hand corner of the Blogger home page, and then select  Use another account underneath the list of your current Google accounts. Now ...

HMRC a-no-go

A few years ago I set up a new company in the UK. The government here has invested quite heavily in digital services so this can be almost entirely completed on-line. You begin the process by notifying Companies House , the venerable UK registrar for companies (for 180 years this year), that you have set up a company. In order for you to do that on-line the Government needs to have some sort of user registration system and one that is a bit more secure than your regular website. Enter the Government Gateway , a government-wide ID system launched in 2001. It was initially designed to be a one-stop-shop that would provide a log-on solution for all of the UK government's on-line services. Whether you were a business/organisation or an individual citizen, with security credentials backed up by GCHQ no less. The Companies House process was exceptionally straightforward and a Government Gateway ID (GG ID) was set up by Companies House for the business. No problems. Another early task...

Evri-thing, Evri-where, All Over the Place

You have to wonder why Hermes went through the hassle of rebranding themselves to Evri, then you get a parcel delivered by them. Only a year ago in a desperate, and cynical, attempt to shed their woeful reputation as the worst parcel delivery company in the UK Hermes rebranded themselves as Evri. On the 14 th March 2022 they rolled out their corporate PR machine and made promises . "The new brand will also see a significant investment in its customer service as part of its commitment to ensuring that its customer service remains responsive, knowledgeable and helpful. This will include Evri opening a fully UK-based customer service team and adding 200 experts who will be based in local depots, closer to where potential issues are. It will also be upgrading its chatbot and releasing more phone lines for those who prefer to speak directly to someone." So was it a surprise when I got an e-mail about a parcel I was expecting? Well, most other couriers don't do this an...