Yavki
28. März 2024 um 06:05
1
Hallo an Alle,
mir stellt sich die Frage, wenn man HomeAssistant verwendet, weshalb man den Stromzähler SML Lesekopf mit Tasmota ausliest und nicht mit ESP-Home.
Ich habe jetzt mal meinen IR Schreib-Lesekopf TTL UART mit ESP-Home eingebunden Stromzähle ( SGM-C4 ) und muss sagen es funktioniert gut.
Was sind denn die Vorteile von Tasmota, die Konfiguration wiederherstellen, also das Backup funktioniere bei mir jedenfalls mit der angepassten Skript Tasmota Version nicht.
Ich bin mir noch nicht sicher ob ich endgültig Tasmota oder ESP-Home verwenden werde, deshalb meine Frage
für euere Anmerkungen bzw. Kommentare
vielen Dank im Voraus
Gruß Bernd
Wolfi1
28. März 2024 um 13:40
2
Mal eine blöde Frage da ich mich noch zu wenig mit Esphome beschäftigt habe!
Bei Tasmosta ist es ja so das der Wemos (SML Zählert) )für sich weiter arbeitet auch ohne Verbindung. (eigenständiges System)
Ist das Bei der ESPHome Variante ebenso.
Oder braucht es das eine Ständige Verbindung zu Esphome auf HA?
Würdest du den Script reinstellen?
Gibt es eine Docu für SML und Esphome?
Welchen Lesekopf verwendest DU?
Meine laufen alle noch mit Tasmota.
(Wechsel von iobroker zu HA)
Gruß
Wolfgang
Warum nicht? Tasmota war halt drauf und funktioniert
Wolfi1
28. März 2024 um 17:18
5
anon47390435:
Ü60er mit Null Programmiererfahrung
Du willst aber nicht sagen das alle ü60 null Programmiererfahrung haben?!
Denn genau die sind mit dem aufgewachsen und haben noch richtig programmieren gelernt.
Gruss
Wolfgang
2 „Gefällt mir“
Yavki
28. März 2024 um 20:47
7
Diese yamlverwende ich,
bitte um Verbesserungen
esphome:
name: anbau-sgm-meter
friendly_name: Anbau SGM Meter
esp32:
board: esp-wrover-kit
framework:
type: arduino
# Enable logging
logger:
baud_rate: 0 #
# Enable Home Assistant API
api:
encryption:
key: " "
ota:
password: " "
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
# Optional manual IP
manual_ip:
static_ip: 192.168.178.14
gateway: 192.168.178.1
subnet: 255.255.255.0
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "Anbau-Sgm-Meter Fallback Hotspot"
password: " "
web_server:
captive_portal:
uart:
id: uart_bus
# tx_pin: GPIO17 # TX2
rx_pin: GPIO16 # RX2
baud_rate: 9600
data_bits: 8
parity: NONE
stop_bits: 1
debug:
sml:
id: mysml
uart_id: uart_bus
sensor:
- platform: sml
name: "SML Total energy"
sml_id: mysml
obis_code: "1-0:1.8.0"
unit_of_measurement: kWh
accuracy_decimals: 3
device_class: energy
state_class: total_increasing
filters:
- multiply: 0.0001
- throttle_average: 300s
- platform: sml
name: "SML Power"
sml_id: mysml
obis_code: "1-0:16.7.0"
unit_of_measurement: W
accuracy_decimals: 0
device_class: power
state_class: measurement
on_value:
then:
- switch.turn_on: blueled
- platform: sml
name: "SML Voltage L1"
sml_id: mysml
obis_code: "1-0:32.7.0"
unit_of_measurement: V
accuracy_decimals: 1
device_class: voltage
state_class: measurement
filters:
- multiply: 0.1
- platform: sml
name: "SML Voltage L2"
sml_id: mysml
obis_code: "1-0:52.7.0"
unit_of_measurement: V
accuracy_decimals: 1
device_class: voltage
state_class: measurement
filters:
- multiply: 0.1
- platform: sml
name: "SML Voltage L3"
sml_id: mysml
obis_code: "1-0:72.7.0"
unit_of_measurement: V
accuracy_decimals: 1
device_class: voltage
state_class: measurement
filters:
- multiply: 0.1
- platform: sml
name: "SML Current L1"
sml_id: mysml
obis_code: "1-0:31.7.0"
unit_of_measurement: A
accuracy_decimals: 2
device_class: current
state_class: measurement
filters:
- multiply: 0.01
- platform: sml
name: "SML Current L2"
sml_id: mysml
obis_code: "1-0:51.7.0"
unit_of_measurement: A
accuracy_decimals: 2
device_class: current
state_class: measurement
filters:
- multiply: 0.01
- platform: sml
name: "SML Current L3"
sml_id: mysml
obis_code: "1-0:71.7.0"
unit_of_measurement: A
accuracy_decimals: 2
device_class: current
state_class: measurement
filters:
- multiply: 0.01
- platform: sml
name: "SML Frequency"
sml_id: mysml
obis_code: "1-0:14.7.0"
unit_of_measurement: Hz
accuracy_decimals: 3
device_class: frequency
state_class: measurement
filters:
- multiply: 0.1
#- platform: uptime
# name: Uptime
- platform: wifi_signal
name: "WiFi Signal Sensor"
update_interval: 60s
text_sensor: # https://github.com/alengwenus/esphome_components/blob/main/components/sml/README.md
- platform: sml
name: "Total energy string"
obis_code: "1-0:1.8.0"
format: uint
switch:
- platform: gpio
pin: GPIO2
id: blueled
name: "SML Status LED"
restore_mode: ALWAYS_OFF
on_turn_on:
- delay: 500ms
- switch.turn_off: blueled
Yavki
29. März 2024 um 04:36
8
Mein Hauptbeweggrund mit ESP Home den Zähler auszulesen war oder ist die Möglichkeit ein Backup auf einen neuen ESP 8266 oder ESP32 aufzuspielen im Falle deines defektes der Hardware (Mikrocontroller) und das ohne irgendwas zu konfigurieren.
Bei mir konnte ich die zuvor gespeicherte Tasmota Konfiguration nicht mehr wiederherstellen, wen ich im Tasmota den Menüpunkt Restore Configuration die gesicherte „dmp“ Datei auswählte bekam ich die Meldung „Backup Upload Failed Not enough space“
*Hat den jemand ein *Tasmota Images für ESP8266 mit SML bei der das „Restore Configuration“ funktioniert
# SML component for ESPHome
## About
This external component provides a way to retrieve data from devices using the *Smart Meter Language* (SML). SML is mainly used by electrical counters but also solar devices, gas meters, and much more.
Although the SML protocol is well defined, it gives a lot of freedom to the manufacturers how to store and identify the transmitted data.
A transmitted physical value is identified by an OBIS code (Object Identification System). If it is known which code the manufacturer assigns to the physical value, the corresponding value can be extracted. Unfortunately this differs from manufacturer to manufacturer. Also the transmitted physical values are not fixed.
As an example, many manufacturers use the OBIS code 1-0:1.8.0 for the accumulated total active energy.
## Configuration
The communication with the hardware is done using UART. Therefore you need to have an [UART bus](https://esphome.io/components/uart.html#uart) in your configuration with the `rx_pin` connected to the output of your hardware sensor component. The baud rate usually has to be set to 9600bps.
```yaml
# Example configuration entry
external_components:
- source:
type: local
path: components
Diese Datei wurde abgeschnitten. Original zeigen
offen 07:40PM - 16 Jun 23 UTC
geschlossen 02:51PM - 27 Jun 23 UTC
### The problem
Since couple of Days I can only see uart_debug messages but no … SML.
### Which version of ESPHome has the issue?
2023.5.5
### What type of installation are you using?
Docker
### Which version of Home Assistant has the issue?
2023.6.1
### What platform are you using?
ESP32
### Board
esp32dev (esp32-s)
### Component causing the issue
I guess sml platform(?)
### Example YAML snippet
```yaml
esphome:
name: sml
esp32:
board: esp32dev
framework:
type: arduino
# Enable logging
logger:
level: DEBUG
# Enable Home Assistant API
api:
password: ""
ota:
password: ""
wifi:
ssid: ""
password: ""
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "Sml Fallback Hotspot"
password: ""
web_server:
version: 1
captive_portal:
uart:
id: uart_bus
rx_pin: GPIO27
baud_rate: 9600
data_bits: 8
parity: NONE
stop_bits: 1
debug:
sml:
id: mysml
uart_id: uart_bus
sensor:
- platform: sml
name: "SML Total energy"
sml_id: mysml
obis_code: "1-0:1.8.0"
unit_of_measurement: kWh
accuracy_decimals: 3
device_class: energy
state_class: total_increasing
filters:
- multiply: 0.0001
- throttle_average: 300s
- platform: sml
name: "SML Current Power"
sml_id: mysml
obis_code: "1-0:16.7.0"
unit_of_measurement: W
accuracy_decimals: 0
device_class: power
state_class: measurement
on_value:
then:
- switch.turn_on: blueled
- platform: sml
name: "SML Current Voltage"
sml_id: mysml
obis_code: "1-0:32.7.0"
unit_of_measurement: V
accuracy_decimals: 1
device_class: voltage
state_class: measurement
filters:
- multiply: 0.1
- platform: sml
name: "SML Current Current"
sml_id: mysml
obis_code: "1-0:31.7.0"
unit_of_measurement: A
accuracy_decimals: 2
device_class: current
state_class: measurement
filters:
- multiply: 0.01
- platform: sml
name: "SML Current Frequency"
sml_id: mysml
obis_code: "1-0:14.7.0"
unit_of_measurement: Hz
accuracy_decimals: 3
device_class: frequency
state_class: measurement
filters:
- multiply: 0.1
switch:
- platform: gpio
pin: GPIO23
id: blueled
name: "SML Status LED"
restore_mode: ALWAYS_OFF
on_turn_on:
- delay: 500ms
- switch.turn_off: blueled
```
### Anything in the logs that might be useful for us?
```txt
mother@inuc:~$ docker run --rm -v "${PWD}":/config --device=/dev/ttyUSB0 -it esphome/esphome run sml.yaml
INFO ESPHome 2023.5.5
INFO Reading configuration sml.yaml...
INFO Generating C++ source...
INFO Compiling app...
Processing sml (board: esp32dev; framework: arduino; platform: platformio/espressif32@5.3.0)
----------------------------------------------------------------------------------------------------
HARDWARE: ESP32 240MHz, 320KB RAM, 4MB Flash
- toolchain-xtensa-esp32 @ 8.4.0+2021r2-patch5
Dependency Graph
|-- AsyncTCP-esphome @ 1.2.2
|-- WiFi @ 2.0.0
|-- FS @ 2.0.0
|-- Update @ 2.0.0
|-- ESPAsyncWebServer-esphome @ 2.1.0
| |-- AsyncTCP-esphome @ 1.2.2
|-- DNSServer @ 2.0.0
|-- ESPmDNS @ 2.0.0
|-- ArduinoJson @ 6.18.5
Compiling .pioenvs/sml/src/main.cpp.o
Linking .pioenvs/sml/firmware.elf
RAM: [= ] 12.4% (used 40628 bytes from 327680 bytes)
Flash: [===== ] 47.5% (used 871161 bytes from 1835008 bytes)
Building .pioenvs/sml/firmware.bin
Creating esp32 image...
Successfully created esp32 image.
esp32_create_combined_bin([".pioenvs/sml/firmware.bin"], [".pioenvs/sml/firmware.elf"])
Wrote 0xe6180 bytes to file /config/.esphome/build/sml/.pioenvs/sml/firmware-factory.bin, ready to flash to offset 0x0
===================================================================================================================================================================================================== [SUCCESS] Took 10.54 seconds ====================================================================================================
****************************************************************************************************
INFO Successfully compiled program.
Found multiple options, please choose one:
[1] /dev/ttyUSB0 (Sonoff Zigbee 3.0 USB Dongle Plus - Sonoff Zigbee 3.0 USB Dongle Plus)
[2] Over The Air (sml.local)
(number): 2
INFO Resolving IP address of sml.local
INFO -> 192.168.11.248
INFO Uploading .esphome/build/sml/.pioenvs/sml/firmware.bin (876928 bytes)
Uploading: [============================================================] 100% Done...
INFO Waiting for result...
INFO OTA successful
INFO Successfully uploaded program.
INFO Starting log output from sml.local using esphome API
INFO Successfully connected to sml.local
[16:46:26][I][app:102]: ESPHome version 2023.5.5 compiled on Jun 16 2023, 16:45:42
[16:46:26][C][wifi:505]: WiFi:
[16:46:26][C][wifi:363]: Local MAC:
[16:46:26][C][wifi:364]: SSID:
[16:46:26][C][wifi:365]: IP Address: 192.168.11.248
[16:46:26][C][wifi:367]: BSSID: 00:A0:F9:45:DD:28
[16:46:26][C][wifi:368]: Hostname: 'sml'
[16:46:26][C][wifi:370]: Signal strength: -76 dB ▂▄▆█
[16:46:26][C][wifi:374]: Channel: 10
[16:46:26][C][wifi:375]: Subnet: 255.255.255.0
[16:46:26][C][wifi:376]: Gateway: 192.168.11.254
[16:46:26][C][wifi:377]: DNS1: 192.168.11.254
[16:46:26][C][wifi:378]: DNS2: 0.0.0.0
[16:46:26][C][logger:301]: Logger:
[16:46:26][C][logger:302]: Level: DEBUG
[16:46:26][C][logger:303]: Log Baud Rate: 115200
[16:46:26][C][logger:305]: Hardware UART: UART0
[16:46:26][C][uart.arduino_esp32:124]: UART Bus 1:
[16:46:26][C][uart.arduino_esp32:126]: RX Pin: GPIO27
[16:46:26][C][uart.arduino_esp32:128]: RX Buffer Size: 256
[16:46:26][C][uart.arduino_esp32:130]: Baud Rate: 9600 baud
[16:46:26][C][uart.arduino_esp32:131]: Data Bits: 8
[16:46:26][C][uart.arduino_esp32:132]: Parity: NONE
[16:46:26][C][uart.arduino_esp32:133]: Stop bits: 1
[16:46:26][C][switch.gpio:068]: GPIO Switch 'SML Status LED'
[16:46:26][C][switch.gpio:091]: Restore Mode: always OFF
[16:46:26][C][switch.gpio:031]: Pin: GPIO23
[16:46:26][C][sml:091]: SML:
[16:46:26][C][sml_sensor:033]: SML 'SML Total energy'
[16:46:26][C][sml_sensor:033]: Device Class: 'energy'
[16:46:26][C][sml_sensor:033]: State Class: 'total_increasing'
[16:46:26][C][sml_sensor:033]: Unit of Measurement: 'kWh'
[16:46:26][C][sml_sensor:033]: Accuracy Decimals: 3
[16:46:26][C][sml_sensor:037]: OBIS Code: 1-0:1.8.0
[16:46:26][C][sml_sensor:033]: SML 'SML Current Power'
[16:46:26][C][sml_sensor:033]: Device Class: 'power'
[16:46:26][C][sml_sensor:033]: State Class: 'measurement'
[16:46:26][C][sml_sensor:033]: Unit of Measurement: 'W'
[16:46:26][C][sml_sensor:033]: Accuracy Decimals: 0
[16:46:26][C][sml_sensor:037]: OBIS Code: 1-0:16.7.0
[16:46:26][C][sml_sensor:033]: SML 'SML Current Voltage'
[16:46:26][C][sml_sensor:033]: Device Class: 'voltage'
[16:46:26][C][sml_sensor:033]: State Class: 'measurement'
[16:46:26][C][sml_sensor:033]: Unit of Measurement: 'V'
[16:46:26][C][sml_sensor:033]: Accuracy Decimals: 1
[16:46:26][C][sml_sensor:037]: OBIS Code: 1-0:32.7.0
[16:46:26][C][sml_sensor:033]: SML 'SML Current Current'
[16:46:26][C][sml_sensor:033]: Device Class: 'current'
[16:46:26][C][sml_sensor:033]: State Class: 'measurement'
[16:46:26][C][sml_sensor:033]: Unit of Measurement: 'A'
[16:46:26][C][sml_sensor:033]: Accuracy Decimals: 2
[16:46:26][C][sml_sensor:037]: OBIS Code: 1-0:31.7.0
[16:46:26][C][sml_sensor:033]: SML 'SML Current Frequency'
[16:46:26][C][sml_sensor:033]: Device Class: 'frequency'
[16:46:26][C][sml_sensor:033]: State Class: 'measurement'
[16:46:26][C][sml_sensor:033]: Unit of Measurement: 'Hz'
[16:46:26][C][sml_sensor:033]: Accuracy Decimals: 3
[16:46:26][C][sml_sensor:037]: OBIS Code: 1-0:14.7.0
[16:46:26][C][captive_portal:088]: Captive Portal:
[16:46:26][C][web_server:151]: Web Server:
[16:46:26][C][web_server:152]: Address: sml.local:80
[16:46:26][C][mdns:108]: mDNS:
[16:46:26][C][mdns:109]: Hostname: sml
[16:46:26][C][ota:093]: Over-The-Air Updates:
[16:46:26][C][ota:094]: Address: sml.local:3232
[16:46:26][C][api:138]: API Server:
[16:46:26][C][api:139]: Address: sml.local:6053
[16:46:26][C][api:143]: Using noise encryption: NO
[16:50:48][D][sensor:094]: 'SML Total energy': Sending state nan kWh with 3 decimals of accuracy
[16:51:15][I][ota:113]: Boot seems successful, resetting boot loop counter.
[16:51:15][D][esp32.preferences:114]: Saving 1 preferences to flash...
[16:51:15][D][esp32.preferences:143]: Saving 1 preferences to flash: 0 cached, 1 written, 0 failed
[17:01:27][D][uart_debug:114]: <<< 09:1B:1B:1B:01:01:01:01:76:05:00:37:CE:D3:62:00:62:00:72:63:01:01:76:01:07:FF:FF:FF:FF:FF:FF:05:00:12:9A:47:0B:0A:01:45:46:52:21:02:CF:69:49:72:62:01:65:01:F7:EC:77:01:63:B6:7F:00:76:05:00:37:CE:D4:62:00:62:00:72:63:07:01:77:07:FF:FF:FF:FF:FF:FF:0B:0A:01:45:46:52:21:02:CF:69:49:07:01:00:62:0A:FF:FF:72:62:01:65:01:F7:EC:77:F1:06:77:07:01:00:60:32:01:01:01:01
[17:01:27][D][uart_debug:114]: <<< 01:01:04:45:46:52:01:77:07:01:00:60:01:00:FF:01:01:01:01:0B:0A:01:45:46:52:21:02:CF:69:49:01:77:07:01:00:01:08:00:FF:64:1C:50:04:72:62:01:65:01:F7:EC:77:62:1E:52:FF:65:02:66:F0:CA:01:77:07:01:00:02:08:00:FF:01:72:62:01:65:01:F7:EC:77:62:1E:52:FF:64:07:32:90:01:77:07:01:00:10:07:00:FF:01:01:62:1B:52:00:52:21:01:77:07:01:00:20:07:00:FF:01:01:62:23:52:FF:63:09:17:01:77:07:01:00:34:07:00:FF:01:01:62:23:52:FF:63:09:15:01:77:07:01:00:48:07:00:FF:01:01
[17:01:27][D][uart_debug:114]: <<< 62:23:52:FF:63:09:1C:01:77:07:01:00:1F:07:00:FF:01:01:62:21:52:FE:62:9A:01:77:07:01:00:33:07:00:FF:01:01:62:21:52:FE:62:8B:01:77:07:01:00:47:07:00:FF:01:01:62:21:52:FE:62:50:01:77:07:01:00:51:07:01:FF:01:01:62:08:52:00:53:00:F0:01:77:07:01:00:51:07:02:FF:01:01:62:08:52:00:52:79:01:77:07:01:00:51:07:04:FF:01:01:62:08:52:00:53:01:33:01:77:07:01:00:51:07:0F:FF:01:01:62:08:52:00:53:01:24:01:77:07:01:00:51:07:1A:FF:01:01:62:08:52:00:53:01:3F:01:77:07
[17:01:28][D][uart_debug:114]: <<< 01:00:0E:07:00:FF:01:01:62:2C:52:FF:63:01:F4:01:77:07:01:00:00:02:00:00:01:01:01:01:06:30:33:2E:30:30:01:77:07:01:00:60:5A:02:01:01:01:01:01:03:42:BD:01:77:07:01:00:61:61:00:00:01:01:01:01:03:00:00:01:77:07:01:00:60:32:01:04:01:01:01:01:08:50:31:2E:32:2E:31:32:01:77:07:01:00:60:32:04:04:01:01:01:01:03:04:22:01:01:01:63:1F:DA:00:76:05:00:37:CE:D5:62:00:62:00:72:63:02:01:71:01:63:36:3E:00:00:00:1B:1B:1B:1B:1A:02:08:D9
[17:01:28][D][uart_debug:114]: <<< 09:1B:1B:1B:01:01:01:01:76:05:00:37:CE:D6:62:00:62:00:72:63:01:01:76:01:07:FF:FF:FF:FF:FF:FF:05:00:12:9A:48:0B:0A:01:45:46:52:21:02:CF:69:49:72:62:01:65:01:F7:EC:78:01:63:CE:13:00:76:05:00:37:CE:D7:62:00:62:00:72:63:07:01:77:07:FF:FF:FF:FF:FF:FF:0B:0A:01:45:46:52:21:02:CF:69:49:07:01:00:62:0A:FF:FF:72:62:01:65:01:F7:EC:78:F1:06:77:07:01:00:60:32:01:01:01:01
[17:01:28][D][uart_debug:114]: <<< 01:01:04:45:46:52:01:77:07:01:00:60:01:00:FF:01:01:01:01:0B:0A:01:45:46:52:21:02:CF:69:49:01:77:07:01:00:01:08:00:FF:64:1C:58:04:72:62:01:65:01:F7:EC:78:62:1E:52:FF:65:02:66:F0:CA:01:77:07:01:00:02:08:00:FF:01:72:62:01:65:01:F7:EC:78:62:1E:52:FF:64:07:32:90:01:77:07:01:00:10:07:00:FF:01:01:62:1B:52:00:53:FF:5E:01:77:07:01:00:20:07:00:FF:01:01:62:23:52:FF:63:09:18:01:77:07:01:00:34:07:00:FF:01:01:62:23:52:FF:63:09:16:01:77:07:01:00:48:07:00:FF:01
[17:01:28][D][uart_debug:114]: <<< 01:62:23:52:FF:63:09:1B:01:77:07:01:00:1F:07:00:FF:01:01:62:21:52:FE:62:8E:01:77:07:01:00:33:07:00:FF:01:01:62:21:52:FE:62:88:01:77:07:01:00:47:07:00:FF:01:01:62:21:52:FE:62:55:01:77:07:01:00:51:07:01:FF:01:01:62:08:52:00:53:00:EE:01:77:07:01:00:51:07:02:FF:01:01:62:08:52:00:52:76:01:77:07:01:00:51:07:04:FF:01:01:62:08:52:00:53:01:04:01:77:07:01:00:51:07:0F:FF:01:01:62:08:52:00:53:01:07:01:77:07:01:00:51:07:1A:FF:01:01:62:08:52:00:53:00:FF:01:77
```
### Additional information
This uard_debug looks actually right but I have no Idea why is he not decoding in SML
I hope this is my issue, it should be easier to solve ;)
1 „Gefällt mir“