Skip to content

Conversation

@HenJou
Copy link
Contributor

@HenJou HenJou commented Jan 10, 2026

Have a look at this enhancement for mqtt that you can see the firmware version that reference the release build and in Home Assistant you can click on the icon and open the github repository.
image

Copy link
Owner

@DevOldSchool DevOldSchool left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for this improvement.

Can you rebase from master for the database fixes as they have been merged in and make the requested change.

@DevOldSchool
Copy link
Owner

Thank you for this contribution. That's a neat idea.

Reviewing the docs for Home Assistant, it appears these fields are intended for a different use: https://developers.home-assistant.io/docs/device_registry_index/#device-properties

configuration_url  |  A URL on which the device or service can be configured, linking to paths inside the Home Assistant UI can be done by using homeassistant://<path>.

sw_version  |  The firmware version of the device.

To me it would be more fitting to pass the firmware version of the hub which is in the headers rather than our "hub-server" version.

@HenJou
Copy link
Contributor Author

HenJou commented Jan 11, 2026

Thanks for the feedback did the re base but what do you think of having above like this
image

and the URL can then also be override from docker-compose variables?
Ok then help me must i close this PR and submit a new one?

@HenJou
Copy link
Contributor Author

HenJou commented Jan 11, 2026

Just have a look that power_discovery is held back until the hub_version is available. and I set a default DEVICE_URL but when I run my local one it is set to my portainer address where i can manage the containers.

@DevOldSchool
Copy link
Owner

Thanks for the feedback did the re base but what do you think of having above like this image

and the URL can then also be override from docker-compose variables? Ok then help me must i close this PR and submit a new one?

I think the hardware and link are good.

The software version shouldn't be the version of powermeter hub server, it should be the firmware of the Efergy Hub server which is found in the headers with X-version. However, we would need a bit of restructuring to make sure this is saved and available for publish at startup.

Can you remove the SW_VERSION for now and we can look at doing the firmware in a different PR.

@DevOldSchool
Copy link
Owner

Hey @HenJou , I have been playing around with this on local and got the firmware version working. However, one part really concerns me. The devices don't update automatically. It seems you have to delete and recreate them which will cause issue with peoples history.

Do you have any ideas on a way around this / did you run into the same issue?

@HenJou
Copy link
Contributor Author

HenJou commented Jan 13, 2026

Hi @DevOldSchool , You talk about the update in home assistant under MQTT.
Just have a look at the at your mqtt server i use mqtt explorer and when you look at that homeassistant topic it does update. What i did was delete it under topic homeassistant/sensor/efergy_h2_sid and restart docker. Then the history is not a issue. When i switched over from my script that pulled from evergyhive website to this one my naming convention was not the same and renamed the entity id to my old name (efergy_hr_sid to trip_k) and by doing this i kept my history of the old sensor the only bad thing now is their is not a reference to the sid any more.

I just now delete the homeassistant/sensor/efergy_h2_sid and restart the docker and the history is back with the old name. You must not delete it in home assistant.

Does this make sense?

@DevOldSchool
Copy link
Owner

Hi @DevOldSchool , You talk about the update in home assistant under MQTT. Just have a look at the at your mqtt server i use mqtt explorer and when you look at that homeassistant topic it does update. What i did was delete it under topic homeassistant/sensor/efergy_h2_sid and restart docker. Then the history is not a issue. When i switched over from my script that pulled from evergyhive website to this one my naming convention was not the same and renamed the entity id to my old name (efergy_hr_sid to trip_k) and by doing this i kept my history of the old sensor the only bad thing now is their is not a reference to the sid any more.

I just now delete the homeassistant/sensor/efergy_h2_sid and restart the docker and the history is back with the old name. You must not delete it in home assistant.

Does this make sense?

That part makes sense.

What about if they swap out their hub device or somehow get firmware update? The data will be out of date until they manually delete it.

@HenJou
Copy link
Contributor Author

HenJou commented Jan 13, 2026

If i got it right is that home assistant cache discovery topics and for this to work we need a process to delete the old topic and republish, but a check must be build in to know when to do the delete and the republish.
What do you think and where do you wanna go with this?

@DevOldSchool
Copy link
Owner

If i got it right is that home assistant cache discovery topics and for this to work we need a process to delete the old topic and republish, but a check must be build in to know when to do the delete and the republish. What do you think and where do you wanna go with this?

On the weekend I'll do some more research to see if there is a recommended way to handle this in HA.

If you get the chance to look before hand that would be good as well.

@DevOldSchool
Copy link
Owner

If i got it right is that home assistant cache discovery topics and for this to work we need a process to delete the old topic and republish, but a check must be build in to know when to do the delete and the republish. What do you think and where do you wanna go with this?

On the weekend I'll do some more research to see if there is a recommended way to handle this in HA.

If you get the chance to look before hand that would be good as well.

Looks like we can pass an empty payload to clear the discovery.
This seems to resolve the issues I was concerned about.

self.publish(config_topic, "", retain=True)

Thanks for your work on this :)

@DevOldSchool DevOldSchool merged commit d6ff562 into DevOldSchool:master Jan 17, 2026
1 check passed
@HenJou HenJou deleted the mqtt-version branch January 19, 2026 14:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants