Hello,
So I’ve used the S0 5 channel pulse meter from a dutch website: 5-kanaals S0 Pulse Meter op USB
Installation was pretty easy. Just connect the two wires to the S0 pulse reader the right way. And the reader to my home assistant device. (USB)
Once connected you’re able to check the hardware connected. (settings->system->hardware, find the 3 dots on the top right and you’ll find all the hardware)
In my case the device path was “/dev/ttyACM0”. It’s recommenden to use the device ID but I couldn’t get it to work right away so used the device path.
When connected I added the following on my config file:
sensor:
- platform: serial
name: s0pcm5
serial_port: /dev/ttyACM0
baudrate: 9600
parity: E
bytesize: 7
stopbits: 1
(old sensor templating Template - Home Assistant)
These settings were in the box of the pulse meter.
Every few secconds the pulse meter will send the readed information to home assistant. Next you need to do is read out this information the right way. The information is splitted with the : sign. And will look something like this: ID:x:00:01:M1:03:12:M2:c:d:M3:e:f:M4:g:h:M5:i:j
Little explanation
ID:x:I:y:M1:a:b:M2:c:d:M3:e:f:M4:g:h:M5:i:j
x = ID S0 meter
y = Pulse Count (standard 10 sec)
M1, M2, etc the connection point on you S0 pulse meter. (always start with M1)
a,c,e,g,i = Pulses since last interval
b,d,f,h,j = Total pulses since startup
To read these out the right way I added the following in my config file (I still got some old coding in my config, so check what you want to use):
’ ’
- platform: template
sensors:
s0pcm5_m1_total_watt:
unique_id: s0pcm5_m1_total_watt
friendly_name: Total s0 power usage
unit_of_measurement: “W”
value_template: “{{ states(‘sensor.s0pcm5’).split(’:’)[6] | float }}”
- platform: template
sensors:
s0pcm5_m1_total:
unique_id: s0pcm5_m1_total
friendly_name: Total s0 power usage
unit_of_measurement: kWh
device_class: energy
value_template: “{{ (states(‘input_number.m1_offset’)| float + states(‘sensor.s0pcm5’).split(’:’)[6] | float / 1000 ) | round(2) }}”
(old sensor templating Template - Home Assistant)
’ ’
or
’ ’
template:
- sensor:
unique_id: s0pcm5_m1_total
name: Total s0 power usage
unit_of_measurement: kWh
device_class: energy
state_class: total
state: “{{ (states(‘input_number.m1_offset’)| float + states(‘sensor.s0pcm5’).split(’:’)[6] | float / 1000 ) | round(2) }}”
- sensor:
name: Total ESP power usage
unit_of_measurement: kWh
device_class: energy
state_class: total
state: “{{ (states(‘sensor.energy_consumed_tariff_1’)| float + states(‘sensor.energy_consumed_tariff_2’) | float )}}”
’ ’
(new sensor templating Template - Home Assistant)
The value given by the S0 pulse meter is splitted at the 6th : where it will read it’s value from.
After this I guess you’ll know what to do. I’ve copied some of my codes from other forums and other users.
I need to note, the pulse meter isn’t really accurate though. Since it’s a pulse meter it doesn’t (offcourse) read out your meter, it just checks the pulses.
I wanted it more accurate so switched to a modbus reader, modbus it installed simular and really reads out the device.
Hope I helped you on your way.