Energy metering with PRO380-Mod
After finishing the most basic home automation setup of my Neuron L203 driven by Evok & Node-red, I'm planning to add energy metering capabilities in order to synchronize the consumption of electric heaters around. To measure consuption I was considering to add a PRO380-Mode to my setup but not sure how could I add to my system. Is there any doc available how should it be done? On the product page, there is no information, the link points to a deal link. Thanks,
there are basically two ways of achieving that. Both of them require connecting the Inepro energy meter via RS485. The difference is in who will be responsible for polling the Modbus data from the device.
The Evok way
Evok can be configured in a way, that it will poll general Modbus devices. See https://github.com/UniPiTechnology/evok/blob/master/etc/hw_definitions/CUSTOM MODBUS DEVICE.yaml
The updated data are available via standard Evok API.
The Node-RED way
You can poll the Modbus device in Node-RED directly via node-red-contrib-modbus https://www.npmjs.com/package/node-red-contrib-modbus
Personally, I would suggest you the option 2, since configuration in Evok is not easy. For configuration you need a Modbus registers map for the given device, that can be found in the documentation from the vendor. Please note, that there are several HW and SW revisions for the device and you need to use the correct documentation. The latest one is here: https://ineprometering.com/wp-content/uploads/2019/04/PRO380-user-manual-V2.18v6.pdf and the Modbus registers map starts from page 27.
I am trying to read from PRO1-Mob and I have no Idea what I am doing wrong.
First question I havn't found for what is the on off switch at the RS485 Port on Neuron S103?
I have set over the EVOK the Serialport to the right 9600bps baud rate. I also found that the Neutron has an TCP Modbus Server and connected the node-red-contrib-modbus Modbus getter to the Local Server.
I set the PRO1 to ID 5 and tried to read but I get always the same error Error: Modbus exception 4: Slave device failure (device reports internal error)"
Can you tell me what I am doing wrong, I have tried to find the right solution over 3 Days but I can't find anything
- The DIP switch marked as RS485-END enables a 120ohm termination resistor between the RS485A and RS485B.
- The ModbusTCP server running on the PLC is for accessing local IOs, not for accessing anything else over RS485
- The RS485 are available as standard devices /dev/ttyNS0, /dev/ttyNS1 and /dev/ttyNS2. To access any serial device over this line, you need to use ModbusRTU getter in Node-RED. Alternatively, you could define ModbusRTU device in the Evok directly, but that's quite complicated. Try the Node-RED way first.
I just got a PRO380 to measure energy from my solar panels from my Neuron device. Since I don't want to run (learn ;-)) NodeRed and there is no turn key solution for native integration of the MOD380 in Evok I searched the internet and found this; https://github.com/volkszaehler/mbmd
This spins up a webserver with API and MQTT / InfluxDB integration for different energy meter including the PRO380. Works like a charm for me.
Some steps I did;
- Connect the meter to a RS485 port on the Unipi and enable the dip-switch
- Make sure that for that particular RS485 port there is no config in /etc/evok.conf (So yes, you need a unused / free port). When I had the port configured in the conf file I did not work, presumably because Evok is intercepting the traffic)
- Download the pre-compiled binaries from GitHub and extract as documented
- Perform a scan over modbus to see if your device is found with the command
/usr/local/bin/mbmd scan --rtu -v --raw --comset 8E1 -a /dev/ttyNS1. Note that ttyNS1 is my SECOND port on my device (2.01). Adjust this as needed for your device.
My Output was the following (I changed the ID of the PRO380 to 5 on the device:
2020/11/25 09:47:52 config: creating RTU connection for /dev/ttyNS1 (9600baud, 8E1)
2020/11/25 09:47:52 starting bus scan on /dev/ttyNS1
2020/11/25 09:47:56 device 1: n/a
2020/11/25 09:48:00 device 2: n/a
2020/11/25 09:48:04 device 3: n/a
2020/11/25 09:48:08 device 4: n/a
2020/11/25 09:48:10 device 5: INEPRO type device found, VoltageL1: 239.90
- Start the webserver with the command
/usr/local/bin/mbmd run --rtu --comset 8E1 -a /dev/ttyNS1 -d INEPRO:5 --mqtt-broker tcp://184.108.40.206:1883 --api 0.0.0.0:1380. Also make sure you adjust the ttyNS port numer. As example I included a MQTT broker IP. Please read the docs for further config or InfluxDB integration.
Do Note that I redirect the webserver port to 1380 because 8080 is already in use. Go to the IP of your Neuron device on port 1380 and see what happens. I see the information coming up nicely. :-). There are API possibilities too to extract data, or push via MQTT or InfluxDB.
If this is what you want to keep, set up a service to start with your device, how to is also in the docs.
Perhaps this helps someone. It fairly easy to use. :-)