Skip to content

Instantly share code, notes, and snippets.

@leinich
Last active July 6, 2024 17:57
Show Gist options
  • Save leinich/38b15ad7b60c699b85395533ed208f56 to your computer and use it in GitHub Desktop.
Save leinich/38b15ad7b60c699b85395533ed208f56 to your computer and use it in GitHub Desktop.
e3dc Configuration Modbus for Homeassistant via YAML
modbus:
name: e3dc
type: tcp
host: 192.168.1.68
port: 502
sensor:
- platform: template
sensors:
e3dc_netzeinspeisung:
friendly_name: e3dc Netzeinspeisung
unique_id: e3dc_netzeinspeisung
unit_of_measurement: 'W'
value_template: >
{% if states("sensor.e3dc_net_power") | int < 0 -%}
{{ states("sensor.e3dc_net_power") | int}}
{%- else -%}
0
{%- endif %}
e3dc_netzbezug:
friendly_name: e3dc Netzbezug
unique_id: e3dc_netzbezug
unit_of_measurement: 'W'
value_template: >
{% if states("sensor.e3dc_net_power") | int > 0 -%}
{{ states("sensor.e3dc_net_power") | int}}
{%- else -%}
0
{%- endif %}
e3dc_emergency_power:
unique_id: e3dc_emergency_power
value_template: >
{% set eep = states('sensor.e3dc_emergency_power_modb') %}
{% if eep == '0' %}
nicht unterstützt
{% elif eep == '1' %}
aktiv
{% elif eep == '2' %}
inaktiv
{% elif eep == '3' %}
nicht verfügbar
{% elif eep == '4' %}
falsche Position 1K04
{% else %}
unbekannt
{% endif %}
- platform: modbus
scan_interval: 60
registers:
- name: E3DC EMS State
register: 40084
data_type: uint
hub: e3dc
- name: E3DC S10 ModBus ID
register: 40000
data_type: uint
hub: e3dc
- name: E3DC PV1 Power
unit_of_measurement: 'W'
register: 40067
count: 2
reverse_order: true
hub: e3dc
#data_type: custom
#structure: ">l"
- name: E3DC PV2 Power
unit_of_measurement: 'W'
register: 40075
count: 2
reverse_order: true
scale: -1
hub: e3dc
#data_type: custom
#structure: ">l"
- name: E3DC House Power
unit_of_measurement: 'W'
register: 40071
count: 2
reverse_order: true
hub: e3dc
#data_type: custom
#structure: ">l"
- name: E3DC Net Power
unit_of_measurement: 'W'
register: 40073
count: 2
reverse_order: true
hub: e3dc
#data_type: custom
#structure: ">l"
- name: E3DC Battery Power
unit_of_measurement: 'W'
register: 40069
count: 2
reverse_order: true
hub: e3dc
#data_type: custom
#structure: ">l"
- name: E3DC Battery Percent
unit_of_measurement: '%'
register: 40082
data_type: uint
hub: e3dc
- name: E3DC Selfpower
unit_of_measurement: '%'
register: 40081
data_type: custom
structure: "xB"
hub: e3dc
- name: E3DC Autarki
unit_of_measurement: '%'
register: 40081
data_type: custom
structure: "Bx"
hub: e3dc
- name: E3DC Emergency Power MODB
register: 40083
data_type: uint
hub: e3dc
@ersteinmal
Copy link

Hallo
@clfberlin
Für den Home Assistant habe ich zwar immer noch kein Ergebnis, da scheinbar einen letzten kleinen Fehler in der modbus.ymal hat -
Gedenfalls habe ich das Programm unter Virtual Box zum laufen gebracht. Jetzt hoffe ich noch auf den letzten Kick, Danach versuche ich dann Deinen Weg.
Step by Step Danke Carsten

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment