Community
OpenEnergyMonitor

OpenEnergyMonitor Community

Home Assistant Emoncms Addon

Hey All,

Just wanted to share the first version of the Emoncms addon that I’ve created.

I don’t actively use Emoncms but wanted to learn how to make an addon for Home Assistant so it seemed like a good candidate to try and have there.

Happy to hear your feedback and comment on what’s missing or should be there!

4 Likes

I think this is a great idea. How close to a ‘production’ release do you think?

Hopefully a bit closer now that I’ve merged @inverse’s emoncms cli pull request :slight_smile: look forward to testing this too.

Interesting, how is this integration different to the existing HA Emoncms module? I’ve been using this HA add-on module for a few years now, it’s simple but works very well.

Totally different.

@glyn.hudson what you are referring to is the integration which is the thing that easily gets data out of Emoncms into HA.

This add-on is a complete instance of Emoncms, being run inside a container within the Home Assistant Supervisor. It is a one click install. No OS to manage and other dependencies are satisfied by other add-ons (such as MQTT, an SQL database etc).

I’ve not looked into it in detail so not sure if Redis is part of the build.

For anyone that wants a simple way to get started and use it in conjunction with other things (such as Node-Red) it is actually a really good solution.

HA has a great snapshot function so regular backups are easily made.

My reservation is that @inverse is simply doing this as he wanted to experiment with creating an add-on so I’d worry about long term support unless you guys took it on.

If using on a Pi and wanting to use the RFM card, there would need to be a little development to get the serial data in (not impossible) or you could just use an alternative RFM receiver and use the RTL_443 add-on (probably - not tested yet).

However, HA is getting to the stage whereby a Pi is not really the ideal hardware to be running it on especially if using an SD Card.

Thanks, that sounds very interesting. Agree that HA is a big heavyweight for a Pi, I’ve been running it on a Synology NAS.

It does depend on what add-ons are running - it is more the wear of the SD Cards.

I splashed out and bought a Blue :grinning_face_with_smiling_eyes:

I’m still learning as I’m going but it’s getting a lot more stable with each minor release.

It’s seeing around 500 installs on docker hub on the various architectures but I am not sure how many of those are actual installs vs automated.

2 Likes

Really? I was running it on a Pi3 for over 2+ years but only when I added a few extensions did it begin to start being hit badly with the 1gb ram.

Around 1 month ago I switched to a PI4 with 8GB ram + SSD and it’s been up since with no issues.

I could have splashed out on the blue like @borpin but I couldn’t find a decent price within DE.

But yeah HA with a SDCard - burned through 1 in 2 years, but I didn’t change the DB flushing so it was hammering the SDCard all the time.

2 Likes

Thanks for doing that! Although Its not complete, I created a follow up PR to fix that :see_no_evil:

There are some users already using it from what I get in the GitHub issues - mostly me not being an active user of emoncms so not knowing what to bundle in the extension… Happy to have contributions/suggestions on what’s missing.

Thanks @inverse merged in

Bit of digging, one issue re Port number, @glyn.hudson you closed this issue, was it resolved?

@inverse Do you provide a means of editing the settings.ini file?

I need to set up a dev HA system to test this add-on.

The issue was closed since it was on the EmonESP repo. If required the port number for Emoncms can be configured in the Apache server config, I think it’s /etc/apache2/ports.conf

I think the point is that to use a custom port, you need to be able to change both ends. It seems the EmonESP assumes the port to use.

I agree - having this customisable from the default through the UI would ease adoption for setups where running on a non-standard HTTP port is enforced.

1 Like

I’ve raised a new issue Define HTTP Port of target emoncms server from UI · Issue #89 · openenergymonitor/EmonESP · GitHub

If you could create a ticket on the project with your needs that would def help.

From my understanding such configuration could be possible but would not be that user friendly as the UI Presents like YAML configuration which you would have to YAML encode your settings.ini which would be decoded and provisioned on container boot.

Alternatively having the settings read from the DB could work as you suggested. The minimal set of “settings” would be the database ones which you suggested.

Is there a reason for not having a sql server instance inside the add-on container? Is that frowned upon by the HA Devs? I don’t currently use the MariaDB add-on and I’m not overly keen on installing it.

Seems having it internal to the container would be a better solution especially as it is not used for storing data as such.

As in running MySQL within the application container? I mean while that is indeed possible it’s not recommended.

They are using Alpine Linux as a base which offers a some what light base for building out the addons.

I mean you could use SQLite mounted to a volume outside of the container that survives upgrades but that would be a bigger change for Emoncms, not sure how that aspect works yet either with addon lifecycles.