Hildebrandglow - Smart Meters - SMETS2

Is anyone using the hildebrand integration through HACS? I’ve added the integration via HACS and restarted but it doesn’t come up as an integration to add and there’s no error in the logs?

1 Like

I was going through just this yesterday. I tried installing it via HACS a couple of times, latterly enabling beta versions and getting the most recent. Initially there was still no integration to setup but after about 45 minutes I checked again and it had appeared as an integration. I was able to add it and add my Bright app login credentials but it reports “failed to setup” and checking the logs I have:

This error originated from a custom integration.

Logger: homeassistant.config_entries
Source: custom_components/hildebrandglow/glow.py:100
Integration: Hildebrand Glow (documentation)
First occurred: 8:29:14 (1 occurrences)
Last logged: 8:29:14

Error setting up entry for hildebrandglow
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 293, in async_setup
    result = await component.async_setup_entry(hass, self)  # type: ignore
  File "/config/custom_components/hildebrandglow/__init__.py", line 30, in async_setup_entry
    await hass.async_add_executor_job(glow.retrieve_cad_hardwareId)
  File "/usr/local/lib/python3.9/concurrent/futures/thread.py", line 52, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/config/custom_components/hildebrandglow/glow.py", line 100, in retrieve_cad_hardwareId
    self.hardwareId = cad["hardwareId"]
KeyError: 'hardwareId'

With the new features in Home Assistant I was hoping to pull in my data from my SMETS2 meter. I don’t mind buying a Glowmarkt device if that’s the key but currently they are out of stock :frowning:

Hi, I’m having the same error, did you manage to resolve it?

I tried getting this working as well, after reinstalling multiple times I finally managed to install the beta and add the integration only to hit a similar (or same) error as you. I thought it was an install error given the initial issues so I restored a backup but I’m back at square one of not having it even appear in the integrations.

Are there any other companies that offer a similar API product as Glowmarkt which is currently supported by HA? Does anyone know of documentation on writing HA integrations? I work as a dev so if there’s nothing in this space that works I might give it a shot when I have time, it has been quite a while since I wrote any python though!

1 Like

@Eldudemeister Not so far. Although beyond retrying it a couple of times in case it was some random glitch or temporary connectivity issue I haven’t tried anything else yet.

@declan-morris No other companies that I know of (but then my knowledge in this space is limited). There is documentation on integrations at Starting with Development | Home Assistant Developer Docs (home-assistant.io). From the error message I can’t help but wonder whether it’s as basic as something having changed in the Bright API that the current integration hasn’t caught up with. But I don’t know where to look on either end of that to investigate further.

1 Like

Has a quick play with some of the glow.py code last night, authenticating and retrieving a list of resources worked, didn’t have time to test grabbing actual readings.

Looks like a PR has been submitted to get the integration at least found by HA. I implemented it manually and this allowed it to be found on the integrations page and it found my gas and electricity meters. After that though the sensors doesn’t update and I got the below errors.

2021-08-11 19:27:44 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 708, in _update_entity_states
    await asyncio.gather(*tasks)
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 451, in async_update_ha_state
    self._async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 498, in _async_write_ha_state
    state = self._stringify_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 470, in _stringify_state
    state = self.state
  File "/config/custom_components/hildebrandglow/sensor.py", line 112, in state
    return self._state["data"][0][1]
IndexError: list index out of range

Hey @Gronda @Eldudemeister @declan-morris
The integration doesn’t work unless you have Glowmarkt hardware because it’s using the API to request realtime usage data, which doesn’t exist if you are going via the DCC because that data is updated every 30 minutes max. I’ve forked that integration and modified it slightly to have it pull the usage so far that day (but of course it will be up to 1 hour off) - you can find that repo and install it via HACS here (EDIT: new repo) Additionally, it has support for the home assistant energy statistics. :slight_smile:

The only other company providing a similar API product are n3rgy, however from what I can tell they only update their data every day so it’s not as powerful as Hildebrand’s

6 Likes

Should your forked version work without the Glow hardware?

Yes, it works without needing Glowmarkt hardware

Fantastic! I’ve added it to HACS, but can’t see the option to add it as an integration. Have I missed a step?

1 Like

This is amazing! Not against buying the CAD but don’t really need it if I can use your integration. All set up so will keep an eye on it and see my energy stats :blush: thanks for doing this!

1 Like

This is indeed amazing. Thank you! But where do I find my “application ID”?

1 Like

It’s b0f1b774-a586-4f72-9edd-27ead8aa7a8d

2 Likes

Ah this is fantastic, I’ve quickly added your integration @HandyHat and it appears to be working! Thanks very much for getting this working. I’ve created a quick PR just to update the instructions in case people don’t notice the different URL!

@WhimsySpoon make sure you’ve added the URL https://github.com/HandyHat/ha-hildebrandglow not the unlobito repo

3 Likes

Thank you! :grinning:

That was exactly my problem, thanks @declan-morris!

I’m getting the following when trying to add a HACS repository;
image

can anyone spot what I’ve done wrong?

You’re searching in the existing repositories.
To get it working

  • Go to the HACs integration screen
  • Click on the top right then “Custom Repositories”
  • Add the URL https://github.com/HandyHat/ha-hildebrandglow and the type is “integration”

That should then let you install, you’ll need to reboot HA then go to the “normal” integrations page to add the new integration there.

1 Like

@declan-morris Thank you. Followed your instructions and bingo, all setup. Really looking forward to seeing this as the data starts to flow.
@HandyHat - Thanks for your support for the HA Energy Stats.

1 Like

@HandyHat i have everything set up but for some reason my electricity sensor has gone unavailable around midnight for the past couple of days and I have to re add the integration to get it back. Any ideas on why this is?