mampfes
(Steffen Zimmermann)
October 16, 2023, 6:31pm
17
@JWSK This could have several reasons:
Does your meter provide 1-0:16:7.0? Which meter do you use?
Is the value_regex matching? You can (temporarily) remove the value_regex to check whether this causes the problem.
Do you have access to the esphome logs? If yes you can check the available OBIS codes and the format in the log output.
JWSK
(JWSK)
October 17, 2023, 12:42pm
18
So this is the Smartmeter.
for testing I deactivated the regex parameter
those are the sensors:
sensor:
platform: obis_d0
name: “Consumed Energy”
obis_d0_id: my_sm
obis_code: “1-0:1.8.0*255”
unit_of_measurement: kWh
accuracy_decimals: 0
state_class: total_increasing
device_class: energy
value_regex: “\d{6}\.\d{4}\*kWh”
platform: obis_d0
name: “Provided Energy”
obis_d0_id: my_sm
obis_code: “1-0:2.8.0*255”
unit_of_measurement: kWh
accuracy_decimals: 0
state_class: total_increasing
device_class: energy
value_regex: “\d{6}\.\d{4}\*kWh”
platform: obis_d0
name: “Power”
obis_d0_id: my_sm
obis_code: “1-0:16.7.0*255”
unit_of_measurement: W
accuracy_decimals: 0
state_class: measurement
device_class: power
#value_regex: “-?\d{6}\*W”`
and this is one logfile segment:
[14:39:59][D][obis_d0:157]: Identification: LOG5XXxXXXXXXXXXXXXXXXXXXXX
[14:39:59][D][obis_d0:201]: OBIS info: 1-0:96.1.0255 → 001LOGXXXXXXXXXXX
[14:39:59][D][obis_d0:201]: OBIS info: 1-0:1.8.0 255 → 034914.9953kWh
[14:39:59][D][sensor:093]: ‘Consumed Energy’: Sending state 34914.99609 kWh with 0 decimals of accuracy
[14:39:59][D][obis_d0:201]: OBIS info: 1-0:2.8.0 255 → 006139.1373kWh
[14:39:59][D][sensor:093]: ‘Provided Energy’: Sending state 6139.13721 kWh with 0 decimals of accuracy
[14:39:59][D][obis_d0:201]: OBIS info: 1-0:0.2.0 255 → ver.03,432F,20170504
[14:39:59][D][obis_d0:201]: OBIS info: 1-0:96.90.2255 → 0F66
[14:39:59][D][obis_d0:201]: OBIS info: 1-0:97.97.0 255 → 00000000
[14:39:59][W][component:204]: Component obis_d0 took a long time for an operation (0.22 s).
[14:39:59][W][component:205]: Components should block for at most 20-30ms.
so there is no 1-0:16:7.0, how could I fix it? I am sure the energy supplier won’t install a new smartmeter.
Thanks for your help
JWSK
(JWSK)
October 17, 2023, 12:53pm
19
Maybe thats is the problem.
INF on has to be activated after pin input.
I will try when I visit the smart meter next Time
mampfes
(Steffen Zimmermann)
October 17, 2023, 7:53pm
20
Yes, that’s the problem.
FYI: My smart meter (different vendor) has the following problem: It forgets the INF configuration when there is a power outage. So I always have to reconfigure…
JWSK
(JWSK)
October 18, 2023, 4:49pm
21
Hello mampfes,
thanks for your help.
i will check about the blackouts there.
I already know the the entered pin stays active after blackout.
Give me some days and I will be safe to say what is possible and what not
JWSK
(JWSK)
October 19, 2023, 6:23pm
22
We were right, it was the inf on parameter!
Thank you!
Ole_North
(Ole Mühlfeld)
January 27, 2024, 9:33pm
24
Dear all,
thx for this nice component - unfortunately it does not work for me
Hope you could help me: No matter what I do, I always get
"[22:30:00][D][obis_d0:152]: abort"
in the logger. I tried different things, but apparently the data is not comming through. Using NodeMCUv2 (ESP 8266) with the exact example as given by judges.
Any idea where I should be looking at?
Update: Found that my meter uses SML and code 1_8D_0P_N_1S
for serial coms.
Meter name: ebz dd3 2r06 dta smz1
How do I activate that in the above example? Thx!
Update 2: The link provided by mampfes in the post below was helpful (THX!) - now the IR readout works without problems.
Further reference: https://www.mittelstedt.net/?tag=esphome (german website)
Thx!
mampfes
(Steffen Zimmermann)
January 28, 2024, 8:36am
25
@Ole_North This component only supports D0 based meters. For SML, please use this component: SML (Smart Message Language) — ESPHome
1 Like
M92718
February 2, 2024, 9:00am
26
Has anyone tried to use this on a tasmota based device like the Hichi IR or ESPLesekopf?
mampfes
(Steffen Zimmermann)
February 2, 2024, 6:41pm
27
@M92718 There are people out there which use this component with ESP01 based devices:
mampfes:main
← 749:main
opened 12:47PM - 10 Nov 23 UTC
This modification uses https://github.com/kokke/tiny-regex-c library instead of … the default ccp `#include <regex>`. This reduces the size of the resulting binary below `512KB` for the eZB dd3 example, making it possible to use an ESP01.
This provides support for https://www.amazon.de/dp/B0CH95T7X4, a IR-Reader with ESP-01 included.
The regex library comes with some limitations, which I tried to document in the README.md.
M92718
February 3, 2024, 11:06am
28
Scary, is there something pre build that you can just flash over tasmota?
mampfes
(Steffen Zimmermann)
February 4, 2024, 11:08am
29
ESPHome is using a different approach than Tasmota: ESPHome doesn’t a provide pre-build binary, but let you build your own application based on your needs. Therefore, please get familiar with ESPHome.
pbe
March 1, 2024, 9:18pm
30
Hi guys,
I am also trying to read the energy from my energy meter with an ESP01. I have an ACE3000 type 260.
My configuration:
uart:
id: uart_bus
tx_pin: 1
rx_pin: 3
baud_rate: 300
data_bits: 7
parity: EVEN
stop_bits: 1
obis_d0:
id: mysml
uart_id: uart_bus
optimize_size: true
on_telegram:
then:
- logger.log: "telegram received"
sensor:
- platform: obis_d0
name: "PV-Energie"
obis_d0_id: mysml
obis_code: "1-0:1.8.0*255"
unit_of_measurement: kWh
accuracy_decimals: 1
device_class: energy
state_class: total_increasing
value_regex: "\\d{6}\\.\\d{8}\\*kWh"
interval:
- interval: 5min
then:
- uart.write: "/?!\r\n"
From the log I can see that reading from energy meter seems to work:
But it is not showing any information in the dashboard:
Do you have any ideas how to fix this?
Thanks and regards.
mampfes
(Steffen Zimmermann)
March 2, 2024, 11:04am
31
According to the log, your sensor configuration should look like this:
sensor:
- platform: obis_d0
name: "PV-Energie"
obis_d0_id: mysml
obis_code: "1.8.0"
unit_of_measurement: kWh
accuracy_decimals: 1
device_class: energy
state_class: total_increasing
value_regex: "\\d{6}\\.\\d{1}\\*kWh"
If this is not working, you can temporary remove the value_regex to check whether it is a problem with the obis_code or the regular expression.
Please let me know once it is working, then I would add your configuration to the examples in the documentation.
M92718
March 2, 2024, 2:27pm
32
How would you add a range-check to these sensors so we ignore value changes outside a certain range? Would be a great addition to the example section
mampfes
(Steffen Zimmermann)
March 2, 2024, 3:24pm
33
@M92718 Should be doable with ESPHome Filters, esp. Clamp: Sensor Component — ESPHome
pbe
March 4, 2024, 7:41pm
34
Hi,
my config looks the following for an ACE 3000 Type 260:
(Only meter reading is available, no power)
external_components:
- source: github://mampfes/esphome_obis_d0
uart:
id: uart_bus
tx_pin: 1
rx_pin: 3
baud_rate: 300
data_bits: 7
parity: EVEN
stop_bits: 1
obis_d0:
id: mysml
uart_id: uart_bus
optimize_size: true
# Logging if needed
# on_telegram:
# then:
# - logger.log: "telegram received"
sensor:
- platform: obis_d0
name: "PV-Energie"
obis_d0_id: mysml
obis_code: "1.8.0"
unit_of_measurement: kWh
accuracy_decimals: 1
device_class: energy
state_class: total_increasing
value_regex: "\\d{6}\\.\\d{1}\\*kWh"
# Filter, b/c sometimes NaN is received
filters:
- filter_out: nan
# ACE energy meter needs to be triggered
interval:
- interval: 5min
then:
# Send start sequence
- uart.write: "/?!\r\n"
Thanks
1 Like
M92718
March 9, 2024, 8:09am
35
If I don’t see any logging despite debug level and just a warning to set my baud rate to 0 because uart is interfering, how should I proceed?
How do I figure out if the ibis command is wrong or I just messed up the pin numbers?
mampfes
(Steffen Zimmermann)
March 10, 2024, 12:17pm
36
@M92718 The UARTs might be already used the the logger: Logger Component — ESPHome
M92718
March 20, 2024, 8:39am
37
Two small mistakes, the pins were not the default for the board (esp8285) and i got the regex wrong as the accuracy is different for each value read.
So here is the correct version for an EZB DD3 with this Sensor
esphome:
name: strom-d0
friendly_name: Strom-D0
esp8266:
board: esp8285
# Enable Home Assistant API
api:
encryption:
key: ""
ota:
password: ""
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "StromzählerFallbackWifi"
password: ""
uart:
id: uart_bus
tx_pin: 13
rx_pin: 14
baud_rate: 9600
data_bits: 7
parity: EVEN
stop_bits: 1
external_components:
- source: github://mampfes/esphome_obis_d0
logger:
baud_rate: 0
obis_d0:
id: mysml
uart_id: uart_bus
optimize_size: true
# Logging if needed
on_telegram:
then:
- logger.log: "telegram received"
sensor:
- platform: obis_d0
name: "Verbrauch"
obis_d0_id: mysml
obis_code: "1-0:1.8.0*255"
unit_of_measurement: kWh
accuracy_decimals: 8
device_class: energy
state_class: total_increasing
value_regex: "\\d{6}\\.\\d{8}\\*kWh"
filters:
- filter_out: nan
- platform: obis_d0
name: "Verbrauch_T1"
obis_d0_id: mysml
obis_code: "1-0:1.8.1*255"
unit_of_measurement: kWh
accuracy_decimals: 3
device_class: energy
state_class: total_increasing
value_regex: "\\d{6}\\.\\d{3}\\*kWh"
# Filter, b/c sometimes NaN is received
filters:
- filter_out: nan
- platform: obis_d0
name: "Verbrauch_T2"
obis_d0_id: mysml
obis_code: "1-0:1.8.2*255"
unit_of_measurement: kWh
accuracy_decimals: 3
device_class: energy
state_class: total_increasing
value_regex: "\\d{6}\\.\\d{3}\\*kWh"
# Filter, b/c sometimes NaN is received
filters:
- filter_out: nan
- platform: obis_d0
name: "Erzeugung"
obis_d0_id: mysml
obis_code: "1-0:2.8.0*255"
unit_of_measurement: kWh
accuracy_decimals: 8
device_class: energy
state_class: total_increasing
value_regex: "\\d{6}\\.\\d{8}\\*kWh"
# Filter, b/c sometimes NaN is received
filters:
- filter_out: nan
- platform: obis_d0
name: "VerbrauchGesamt"
obis_d0_id: mysml
obis_code: "1-0:16.7.0*255"
unit_of_measurement: W
accuracy_decimals: 8
device_class: energy
state_class: measurement
value_regex: "\\d{6}\\.\\d{2}\\*W"
# Filter, b/c sometimes NaN is received
filters:
- filter_out: nan
- platform: obis_d0
name: "Verbrauch_L1"
obis_d0_id: mysml
obis_code: "1-0:36.7.0*255"
unit_of_measurement: W
accuracy_decimals: 2
device_class: energy
state_class: measurement
value_regex: "\\d{6}\\.\\d{2}\\*W"
# Filter, b/c sometimes NaN is received
filters:
- filter_out: nan
- platform: obis_d0
name: "Verbrauch_L2"
obis_d0_id: mysml
obis_code: "1-0:56.7.0*255"
unit_of_measurement: W
accuracy_decimals: 2
device_class: energy
state_class: measurement
value_regex: "\\d{6}\\.\\d{2}\\*W"
# Filter, b/c sometimes NaN is received
filters:
- filter_out: nan
- platform: obis_d0
name: "Verbrauch_L3"
obis_d0_id: mysml
obis_code: "1-0:76.7.0*255"
unit_of_measurement: W
accuracy_decimals: 2
device_class: energy
state_class: measurement
value_regex: "\\d{6}\\.\\d{2}\\*W"
# Filter, b/c sometimes NaN is received
filters:
- filter_out: nan
#bis hier wars ok
- platform: obis_d0
name: "Spannung_L1"
obis_d0_id: mysml
obis_code: "1-0:32.7.0*255"
unit_of_measurement: V
accuracy_decimals: 1
device_class: energy
state_class: measurement
value_regex: "\\d{3}\\.\\d{1}\\*V"
# Filter, b/c sometimes NaN is received
filters:
- filter_out: nan
- platform: obis_d0
name: "Spannung_L2"
obis_d0_id: mysml
obis_code: "1-0:52.7.0*255"
unit_of_measurement: V
accuracy_decimals: 1
device_class: energy
state_class: measurement
value_regex: "\\d{3}\\.\\d{1}\\*V"
# Filter, b/c sometimes NaN is received
filters:
- filter_out: nan
- platform: obis_d0
name: "Spannung_L3"
obis_d0_id: mysml
obis_code: "1-0:72.7.0*255"
unit_of_measurement: V
accuracy_decimals: 1
device_class: energy
state_class: measurement
value_regex: "\\d{3}\\.\\d{1}\\*V"
# Filter, b/c sometimes NaN is received
filters:
- filter_out: nan
text_sensor:
- platform: obis_d0
name: "Device Identification"
obis_d0_id: mysml
obis_code: "1-0:96.1.0*255"
entity_category: diagnostic`
Nice to finally filter out spikes with “nan” when the sensor fails at reading the value properly and transmitting it.
GitHub - aquaticus/esphome-iec62056: IEC 62056-21 component for ESPHome could be another solution. Not sure if there are any major differences.