Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: Home Assistant Add-on #63

Open
CpuID opened this issue Dec 11, 2024 · 13 comments
Open

Feature: Home Assistant Add-on #63

CpuID opened this issue Dec 11, 2024 · 13 comments

Comments

@CpuID
Copy link
Contributor

CpuID commented Dec 11, 2024

Does it make sense to package this project as a Home Assistant Add-on?

Context: a lot of people that intend to run this may already have a hardware device that runs Home Assistant (eg. a small embedded appliance), and Home Assistant Add-ons are mostly just a container with some metadata.

This would make it a streamlined process to install/setup potentially...

https://developers.home-assistant.io/docs/add-ons/

@longzheng
Copy link
Owner

Yes I agree. Unfortunately at the moment the docker compose uses multiple containers (an InfluxDB container), which Home Assistant addons natively support.

@PaulSchulz mentioned he was going to look into this too #61 (comment)

@CpuID
Copy link
Contributor Author

CpuID commented Dec 11, 2024

Sounds good 👍whoever gets time to write up the metadata I guess :) It may also require dropping arm64 Docker images on Docker Hub (in addition to amd64), as a lot of the embedded hardware that Home Assistant recommends are ARM based. That likely just involves adding 2 architectures to https://github.com/longzheng/open-dynamic-export/blob/main/.github/workflows/publish-docker.yml - can be done via a PR at some point.

Adding a link to the Home Assistant InfluxDB add-on for anyone curious: https://github.com/hassio-addons/addon-influxdb

@longzheng
Copy link
Owner

I've given this a bit more thought and I think we can make the InfluxDB completely optional.

Originally I was thinking the system might depend on InfluxDB for data storage/query (eg storing inverter/meter samples to send to CSIP server for dynamic connection telemetry requirements), but currently it's been implemented as an in-memory store and has been fine. I may take it a step further with a SQLite database in the future.

Currently I use InfluxDB for some metric logging which I use to help debug and build a dashboard (that I intended to package with hardware as a plug and play product). If I make InfluxDB an optional config thing, then that "package" can be the one that bundles InfluxDB than this project itself.

A single container will life easier with setup/debugging too.

@CpuID
Copy link
Contributor Author

CpuID commented Dec 11, 2024

One nice thing about retaining InfluxDB protocol wise - you can just have an on/off feature toggle to send the metrics still, and if someone wants to use a different metrics store for whatever purpose they have, suggest telegraf as a translation layer (eg. if someone wanted Prometheus as their preferred datastore)

https://github.com/influxdata/telegraf/tree/master/plugins/inputs/influxdb_listener

No point writing native outputs for every metrics store out there :) SQLite is tempting though (very lightweight)

@PaulSchulz
Copy link

PaulSchulz commented Dec 11, 2024

I have managed to write a minimal Dockerfile which successfully runs Open Dynamic Export on Home Assistant. It doesn't start as a HA Add-on yet.. not sure why.

I will commit to my github repo under a 'home-assistant' branch.

@PaulSchulz
Copy link

PaulSchulz commented Dec 11, 2024

https://github.com/PaulSchulz/open-dynamic-export/tree/home-assistant-addon

Please see the commit comments, as there were quite a few (non-obvious) issues to work through.

@longzheng
Copy link
Owner

@PaulSchulz I've just pushed a change that makes InfluxDB optional, so you can even just run the app with Node.js directly. Hopefully that can simplify the HA addon.

@JimboHamez
Copy link

If this is packaged as a HA add-on will the variables be exposed to HA for use on the Energy page? I currently use the Sunspec addon to retrieve data from my Fronius Gen24 using Modbus TCP with a polling rate of 5 Secs. Given the CSIP spec requirement for a polling rate 300ms (United Energy/Powercor) it seems to make sense to use Open Dynamic Export as the source for this data.

@PaulSchulz
Copy link

PaulSchulz commented Jan 10, 2025 via email

@JimboHamez
Copy link

JimboHamez commented Jan 10, 2025

@PaulSchulz is the output to MQTT an undocumented feature at this stage? From what I can tell the publish feature does not forward usage data from the inverter or smart-meter, it is information from the limiter used to control the inverter.

update: The inverter and meter Modbus data is available from localhost:3000/sunspec/data. Not tested however HA Scrape looks promising

@longzheng
Copy link
Owner

@PaulSchulz is the output to MQTT an undocumented feature at this stage? From what I can tell the publish feature does not forward usage data from the inverter or smart-meter, it is information from the limiter used to control the inverter.

update: The inverter and meter Modbus data is available from localhost:3000/sunspec/data. Not tested however HA Scrape looks promising

It's documented here https://opendynamicexport.com/configuration/publish

@JimboHamez
Copy link

@PaulSchulz is the output to MQTT an undocumented feature at this stage? From what I can tell the publish feature does not forward usage data from the inverter or smart-meter, it is information from the limiter used to control the inverter.
update: The inverter and meter Modbus data is available from localhost:3000/sunspec/data. Not tested however HA Scrape looks promising

It's documented here https://opendynamicexport.com/configuration/publish

There seems to be a little confusion here, my original question was if all of the inverter and smart meter data would be available in home assistant as sensors that could be then used in the Energy dashboard. From the document you pointed to, the MQTT publish feature per my earlier comment does not appear to contain this data, hence the undocumented feature comment. Is there another 'topic' other than 'limits' to publish the inverter and smart meter data via MQTT?

@longzheng
Copy link
Owner

longzheng commented Jan 18, 2025

@JimboHamez Right sorry I didn't read it closely enough.

Currently there's no MQTT topic to get the inverter/meter data out, but it's available via the coordinatorStatus API

Image

I'm thinking most people who use this project would already have Home Assistant integrations set up with their inverter/meter so I wanted to avoid reinventing the wheel.

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

No branches or pull requests

4 participants