Hello everyone,
I got a P1-USB (uart) cable to get readings from our energy meter (Landis+gyr E350) in preparation for getting some solar panels. There is a Raspberry Pi 3B+ next to the metering cupboard that has enough spare capacity to transfer this data to my NAS (elsewhere) running home assistant.
I have trouble with getting to register as an energy source. There are no statistics on the energy dashboard.
What I’ve tried
On Sunday I spent about 8 hours on this challenge to get the GitHub - svrooij/smartmeter2mqtt: Publish data from your Smart meter with a P1 interface to you MQTT server. smartmeter2mqqt node.js script working. (I had to reinstall the Pi 3 times. Python, PM2 and Docker problems). It is exporting data now and running as a systemd service. There is now a (secured) Mosquitto MQTT broker running too on the NAS.
This script doesn’t appear to pass state_class
so home assistant doesn’t see it as an energy source? I can’t set it manually tho. Every time it updates (10 sec. interval) it gets reset?
I think the problem lies somewhere in here: smartmeter2mqtt/mqtt-output.ts at 022134797a1ba273f7fd28821f8baa8ad1de1713 · svrooij/smartmeter2mqtt · GitHub
Adding state_class: 'measurement'
under the publishAutoDiscovery
between unit_of_measurement
and value_template
doesn’t work. I’m afraid my programming knowledge is way too basic to troubleshoot this.
** Version information**
Today I did a complete clean install of home assistant (It was a glorified timer and remote switch for a lamp before this) 2022.09.1 in a HaOS VM. This because the TrueNAS plugin is discontinued and updating the plugin from a 2021 version to 2022.8 breaks the install completely. I also see the customize function in home assistant has been removed.
TLDR:
Can anyone help me to get this script working correctly?
or
Know of another program that can run on the Pi that does register correctly as an energy source with statistics?
Note: I can not install Docker on the Pi. It messes with ip-tables in a way that breaks the Pi’s primary function. The recommend fix doesn’t work and gets reset on reboot.
Thank you in advance for your time and help
Rick