Moin,
es gibt hier ja schon den ein oder anderen Schnipsel für die EASTRON SDM Smartmeter um diese dann auch per Modbus auszulesen.
Wir bauen gerade unser Haus um und ich dachte mir, hey cool, gibt ja von B+G auch Smartmeter, sogar günstiger als von EASTRON. Leider musste ich nur feststellen, dass ich gefühlt der erste bin der die Kisten versucht in Homeassistant einzubinden. Ich hab heute mal meinen ersten ESPHome Code für ein Smartmeter fertiggestellt, es könnte noch sein das an der ein oder anderen Stelle etwas nicht zu 100% richtig ist. Ich wollte aber mein Ergebnis schon mal teilen.
Aufgebaut habe das ich das ganze mit einem Wemos D1 Mini (Chinaverschnitt) und einem MAX485. Genutzt wird die Serielle Console direkt vom ESP8266. Als Smartmeter nutze ich das B+G E-Tech DS100-00B.
esphome:
name: wemosd1-bgetech-smartmeter01
friendly_name: wemosd1-bgetech-smartmeter01
esp8266:
board: d1_mini_lite
# Enable logging
# WICHTIG, hier Baud_rate auf 0
logger:
baud_rate: 0
# Enable Home Assistant API
api:
encryption:
key: "hierkönntedeinencryptionpasswordstehen"
ota:
password: "hierkönntedeinotapasswordstehen"
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
captive_portal:
# Hier werden die TXD01 und RXD01 genutzt, damit läuft das ganze wohl stabiler. Oben drauf achten das die Baud auf 0 ist.
uart:
id: mod_bus
tx_pin: GPIO1
rx_pin: GPIO3
baud_rate: 9600
stop_bits: 1
modbus:
flow_control_pin: D1
id: modbus1
modbus_controller:
- id: ds100_mb10
address: 0xA ## Adresse des Modbus-Geräts (im Slave-Mode) hier ist es Decimal 10
modbus_id: modbus1
setup_priority: -10
update_interval: 30s ## Für's Testen sehr häufig, später kann man den Wert runterstellen.
sensor:
# Wirk-Leistung MB10
- platform: modbus_controller
modbus_controller_id: ds100_mb10
name: "MB10 L1 Active Power"
id: "mb10_l1_active_power"
register_type: read
address: 0x041A
value_type: S_DWORD
accuracy_decimals: 0
unit_of_measurement: "W"
state_class: measurement
device_class: power
filters:
- multiply: 1
- platform: modbus_controller
modbus_controller_id: ds100_mb10
name: "MB10 L2 Active Power"
id: "mb10_l2_active_power"
register_type: read
address: 0x041C
value_type: S_DWORD
accuracy_decimals: 0
unit_of_measurement: "W"
state_class: measurement
device_class: power
filters:
- multiply: 1
- platform: modbus_controller
modbus_controller_id: ds100_mb10
name: "MB10 L3 Active Power"
id: "mb10_l3_active_power"
register_type: read
address: 0x041E
value_type: S_DWORD
accuracy_decimals: 0
unit_of_measurement: "W"
state_class: measurement
device_class: power
filters:
- multiply: 1
- platform: modbus_controller
modbus_controller_id: ds100_mb10
name: "MB10 Combined Active Power"
id: "mb10_combined_active_power"
register_type: read
address: 0x0420
value_type: S_DWORD
accuracy_decimals: 0
unit_of_measurement: "W"
state_class: measurement
device_class: power
filters:
- multiply: 1
# Schein-Leistung MB10
- platform: modbus_controller
modbus_controller_id: ds100_mb10
name: "MB10 L1 Apparent Power"
id: "mb10_l1_apparent_power"
register_type: read
address: 0x0422
value_type: S_DWORD
accuracy_decimals: 0
unit_of_measurement: "VA"
state_class: measurement
device_class: apparent_power
filters:
- multiply: 1
- platform: modbus_controller
modbus_controller_id: ds100_mb10
name: "MB10 L2 Apparent Power"
id: "mb10_l2_apparent_power"
register_type: read
address: 0x0424
value_type: S_DWORD
accuracy_decimals: 0
unit_of_measurement: "VA"
state_class: measurement
device_class: apparent_power
filters:
- multiply: 1
- platform: modbus_controller
modbus_controller_id: ds100_mb10
name: "MB10 L3 Apparent Power"
id: "mb10_l3_apparent_power"
register_type: read
address: 0x0426
value_type: S_DWORD
accuracy_decimals: 0
unit_of_measurement: "VA"
state_class: measurement
device_class: apparent_power
filters:
- multiply: 1
- platform: modbus_controller
modbus_controller_id: ds100_mb10
name: "MB10 Combined Apparent Power"
id: "mb10_combined_apparent_power"
register_type: read
address: 0x0428
value_type: S_DWORD
accuracy_decimals: 0
unit_of_measurement: "VA"
state_class: measurement
device_class: apparent_power
filters:
- multiply: 1
# Blind-Leistung MB10
- platform: modbus_controller
modbus_controller_id: ds100_mb10
name: "MB10 L1 Reactive Power"
id: "mb10_l1_reactive_power"
register_type: read
address: 0x042A
value_type: S_DWORD
accuracy_decimals: 0
unit_of_measurement: "var"
state_class: measurement
device_class: reactive_power
filters:
- multiply: 1
- platform: modbus_controller
modbus_controller_id: ds100_mb10
name: "MB10 L2 Reactive Power"
id: "mb10_l2_reactive_power"
register_type: read
address: 0x042C
value_type: S_DWORD
accuracy_decimals: 0
unit_of_measurement: "var"
state_class: measurement
device_class: reactive_power
filters:
- multiply: 1
- platform: modbus_controller
modbus_controller_id: ds100_mb10
name: "MB10 L3 Reactive Power"
id: "mb10_l3_reactive_power"
register_type: read
address: 0x042E
value_type: S_DWORD
accuracy_decimals: 0
unit_of_measurement: "var"
state_class: measurement
device_class: reactive_power
filters:
- multiply: 1
- platform: modbus_controller
modbus_controller_id: ds100_mb10
name: "MB10 Combined Reactive Power"
id: "mb10_combined_reactive_power"
register_type: read
address: 0x0430
value_type: S_DWORD
accuracy_decimals: 0
unit_of_measurement: "var"
state_class: measurement
device_class: reactive_power
filters:
- multiply: 1
# Strom MB10
- platform: modbus_controller
modbus_controller_id: ds100_mb10
name: "MB10 L1 Current"
id: "mb10_l1_current"
register_type: read
address: 0x0410
value_type: S_DWORD
accuracy_decimals: 2
unit_of_measurement: "A"
state_class: measurement
device_class: current
filters:
- multiply: 0.001
- platform: modbus_controller
modbus_controller_id: ds100_mb10
name: "MB10 L2 Current"
id: "mb10_l2_current"
register_type: read
address: 0x0412
value_type: S_DWORD
accuracy_decimals: 2
unit_of_measurement: "A"
state_class: measurement
device_class: current
filters:
- multiply: 0.001
- platform: modbus_controller
modbus_controller_id: ds100_mb10
name: "MB10 L3 Current"
id: "mb10_l3_current"
register_type: read
address: 0x0414
value_type: S_DWORD
accuracy_decimals: 2
unit_of_measurement: "A"
state_class: measurement
device_class: current
filters:
- multiply: 0.001
- platform: modbus_controller
modbus_controller_id: ds100_mb10
name: "MB10 N Current"
id: "mb10_n_current"
register_type: read
address: 0x0416
value_type: S_DWORD
accuracy_decimals: 2
unit_of_measurement: "A"
state_class: measurement
device_class: current
filters:
- multiply: 0.001
- platform: modbus_controller
modbus_controller_id: ds100_mb10
name: "MB10 Combined Current"
id: "mb10_combined_current"
register_type: read
address: 0x0418
value_type: S_DWORD
accuracy_decimals: 2
unit_of_measurement: "A"
state_class: measurement
device_class: current
filters:
- multiply: 0.001
# Spannung MB10
- platform: modbus_controller
modbus_controller_id: ds100_mb10
name: "MB10 L1-N Voltage"
id: "mb10_l1_voltage"
register_type: read
address: 0x0400
value_type: S_DWORD
accuracy_decimals: 3
unit_of_measurement: "V"
state_class: measurement
device_class: voltage
filters:
- multiply: 1
- platform: modbus_controller
modbus_controller_id: ds100_mb10
name: "MB10 L2-N Voltage"
id: "mb10_l2_voltage"
register_type: read
address: 0x0402
value_type: S_DWORD
accuracy_decimals: 3
unit_of_measurement: "V"
state_class: measurement
device_class: voltage
filters:
- multiply: 1
- platform: modbus_controller
modbus_controller_id: ds100_mb10
name: "MB10 L3-N Voltage"
id: "mb10_l3_voltage"
register_type: read
address: 0x0404
value_type: S_DWORD
accuracy_decimals: 3
unit_of_measurement: "V"
state_class: measurement
device_class: voltage
filters:
- multiply: 1
- platform: modbus_controller
modbus_controller_id: ds100_mb10
name: "MB10 L-N Average Voltage"
id: "mb10_n_voltage"
register_type: read
address: 0x040C
value_type: S_DWORD
accuracy_decimals: 3
unit_of_measurement: "V"
state_class: measurement
device_class: voltage
filters:
- multiply: 1
- platform: modbus_controller
modbus_controller_id: ds100_mb10
name: "MB10 L-L Average Voltage"
id: "mb10_l_voltage"
register_type: read
address: 0x040E
value_type: S_DWORD
accuracy_decimals: 3
unit_of_measurement: "V"
state_class: measurement
device_class: voltage
filters:
- multiply: 1
# Powerfaktor MB10
- platform: modbus_controller
modbus_controller_id: ds100_mb10
name: "MB10 L1 Power Factor"
id: "mb10_l1_power_factor"
register_type: read
address: 0x0436
value_type: S_WORD
accuracy_decimals: 2
unit_of_measurement: "/"
state_class: measurement
device_class: power_factor
filters:
- multiply: 0.01
- platform: modbus_controller
modbus_controller_id: ds100_mb10
name: "MB10 L2 Power Factor"
id: "mb10_l2_power_factor"
register_type: read
address: 0x0437
value_type: S_WORD
accuracy_decimals: 2
unit_of_measurement: "/"
state_class: measurement
device_class: power_factor
filters:
- multiply: 0.01
- platform: modbus_controller
modbus_controller_id: ds100_mb10
name: "MB10 L3 Power Factor"
id: "mb10_l3_power_factor"
register_type: read
address: 0x0438
value_type: S_WORD
accuracy_decimals: 2
unit_of_measurement: "/"
state_class: measurement
device_class: power_factor
filters:
- multiply: 0.01
- platform: modbus_controller
modbus_controller_id: ds100_mb10
name: "MB10 Combined Power Factor"
id: "mb10_combined_power_factor"
register_type: read
address: 0x0439
value_type: S_WORD
accuracy_decimals: 2
unit_of_measurement: "/"
state_class: measurement
device_class: power_factor
filters:
- multiply: 0.01
# Gesamtbetrachtung MB10
- platform: modbus_controller
modbus_controller_id: ds100_mb10
name: "Combined Frequency"
id: "mb10_combined_freq"
register_type: read
address: 0x0432
value_type: S_WORD
accuracy_decimals: 1
unit_of_measurement: "Hz"
state_class: measurement
device_class: frequency
filters:
- multiply: 0.1
- platform: modbus_controller
modbus_controller_id: ds100_mb10
name: "MB10 Forward Active Demand"
id: "mb10_forward_active_demand"
register_type: read
address: 0x0440
value_type: S_DWORD
accuracy_decimals: 1
unit_of_measurement: "W"
state_class: measurement
device_class: power
filters:
- multiply: 1
- platform: modbus_controller
modbus_controller_id: ds100_mb10
name: "MB10 Active Demand"
id: "mb10_active_demand"
register_type: read
address: 0x0450
value_type: S_DWORD
accuracy_decimals: 1
unit_of_measurement: "W"
state_class: measurement
device_class: power
filters:
- multiply: 1
# Ertrag/Verbrauchszähler MB10
- platform: modbus_controller
modbus_controller_id: ds100_mb10
name: "MB10 Reverse Total Active Energy"
id: "mb10_reverse_total_active_energy"
register_type: read
address: 0x0118
value_type: S_DWORD
accuracy_decimals: 2
unit_of_measurement: "kWh"
state_class: measurement
device_class: energy
filters:
- multiply: 1
- platform: modbus_controller
modbus_controller_id: ds100_mb10
name: "MB10 Active Total Energy"
id: "mb10_active_total_energy"
register_type: read
address: 0x0122
value_type: S_DWORD
accuracy_decimals: 2
unit_of_measurement: "kWh"
state_class: measurement
device_class: energy
filters:
- multiply: 1
- platform: modbus_controller
modbus_controller_id: ds100_mb10
name: "MB10 Forward Total Reactive Energy"
id: "mb10_forward_total_reactive_energy"
register_type: read
address: 0x012C
value_type: S_DWORD
accuracy_decimals: 2
unit_of_measurement: "kWh"
state_class: measurement
device_class: energy
filters:
- multiply: 1
- platform: modbus_controller
modbus_controller_id: ds100_mb10
name: "MB10 Reverse Total Reactive Energy"
id: "mb10_reverse_total_reactive_energy"
register_type: read
address: 0x0136
value_type: S_DWORD
accuracy_decimals: 2
unit_of_measurement: "kWh"
state_class: measurement
device_class: energy
filters:
- multiply: 1
- platform: modbus_controller
modbus_controller_id: ds100_mb10
name: "MB10 Reactive Total Energy"
id: "mb10_reactive_total_energy"
register_type: read
address: 0x0140
value_type: S_DWORD
accuracy_decimals: 2
unit_of_measurement: "kWh"
state_class: measurement
device_class: energy
filters:
- multiply: 1
web_server:
port: 80
Falls noch jemand Ideen hat oder Fehler entdeckt, gerne her damit.
Grüße aus der Steinhuder-Meer-Region.