Hi guys,
Let me start with that I’m not a coder. So I use tutorials and hope it works the first time
I have the following set up:
-esphome with the S0tool code from huizebruin.
-Esp32 connected to a KWH meter LEM022SJ. 400 pulses per kWh (2.5Wh/imp)
-KWH meter to read usage of Tesla wallcharger.
The S0tool is reading KW and KWH. But there is actually nu power been drawn. So it reads false pulses I guess. Imgur: The magic of the Internet
What am I doing wrong?
The code is as following:
select:
imp/kWh rate
- platform: template
name: “Pulse_rate kWh meter”
id: Select_pulse_rate
optimistic: true
options:- “2000”
- “1500”
- “1000”
- “500”
- “400”
- “100”
initial_option: “400”
on_value:
then:- logger.log:
format: "Chosen option: %s "
args: [“x.c_str()”]
- logger.log:
#------------------------# Kwh meter S0 poort 1 #------------------------#
sensor:
kwh meter s0
- platform: pulse_meter
pin: GPIO14
name: “Actuele energie”
id: W_opbrengst
icon: “mdi:flash”
internal_filter: ${impulslengte}
accuracy_decimals: 3
unit_of_measurement: ‘kW’
state_class: measurement
device_class: power
filters:- lambda: return x * ((60.0 / atoi(id(Select_pulse_rate).state.c_str())));
Totaal opgebracht
total:
unit_of_measurement: 'kWh'
name: "Totaal opgebracht"
id: W_opbrengst_totaal
state_class: total_increasing
device_class: energy
icon: "mdi:flash"
accuracy_decimals: 2
filters:
- lambda: return x * ((1.0 / atoi(id(Select_pulse_rate).state.c_str())));
Kwh meterstand stand bij benadering
- platform: template
id: kwh_total
name: “Actuele meterstand”
state_class: “total_increasing”
icon: “mdi:flash”
update_interval: 1s
unit_of_measurement: ‘kWh’
accuracy_decimals: 2
lambda:
return id(W_opbrengst_totaal).state + id(totalkwhUsage);