Thanks to everyone here for this great help!
Even with this help it took me some time to get my S10 mini to show up in HA but finally it works.
I decided to catch up with the appoach of [at]ursus_polaris combind with [at]Volker . To get others a hint of what I did to get it up and running here are my configs:
create the âincludesâ folder under config (config/includes)
create /config/includes/binary_sensors.yaml :
- platform: template
sensors:
e3dc_emergency_power_available:
friendly_name: "E3DC Emergency Power available"
value_template: "{{ states('sensor.e3dc_emergency_power_state')|int|bitwise_and(4) > 0 }}"
e3dc_battery_loading_blocked:
friendly_name: "E3DC Battery loading blocked"
value_template: "{{ states('sensor.e3dc_emergency_power_state')|int|bitwise_and(1) > 0 }}"
e3dc_battery_unloading_blocked:
friendly_name: "E3DC Battery unloading blocked"
value_template: "{{ states('sensor.e3dc_emergency_power_state')|int|bitwise_and(2) > 0 }}"
e3dc_weather_based_loading:
friendly_name: "E3DC weather based loading limiter"
value_template: "{{ states('sensor.e3dc_emergency_power_state')|int|bitwise_and(8) > 0 }}"
e3dc_power_limiter:
friendly_name: "E3DC power limiter"
value_template: "{{ states('sensor.e3dc_emergency_power_state')|int|bitwise_and(16) > 0 }}"
e3dc_smartcharge_loading_blocked:
friendly_name: "E3DC SmartCharge loading blocked"
value_template: "{{ states('sensor.e3dc_emergency_power_state')|int|bitwise_and(32) > 0 }}"
e3dc_smartcharge_unloading_blocked:
friendly_name: "E3DC SmartCharge unloading blocked"
value_template: "{{ states('sensor.e3dc_emergency_power_state')|int|bitwise_and(64) > 0 }}"
create /config/includes/customize_global.yaml :
# Customize Global YAML
# Customize entities matching a pattern
# General customization for energy sensors
# Set class to energy and enable statistic
"sensor.*_energy":
last_reset: '1970-01-01T00:00:00+00:00'
device_class: energy
state_class: total_increasing
# General customization for power sensors
# Set class to power and enable statistic
"sensor.*_power":
last_reset: '1970-01-01T00:00:00+00:00'
device_class: power
state_class: measurement
create /config/includes/modbus.yaml :
- name: "e3dc"
type: tcp
host: < your E3DCs ip here >
port: 502
retry_on_empty: true
sensors:
- name: E3DC Serial Number
unique_id: e3dc_serial_number
address: 40035
data_type: string
count: 8
scan_interval: 86400
- name: E3DC Model
unique_id: e3dc_model
address: 40019
data_type: string
count: 8
scan_interval: 86400
- name: E3DC Manufacturer
unique_id: e3dc_manufacturer
address: 40003
data_type: string
count: 8
scan_interval: 86400
- name: E3DC Firmware
unique_id: e3dc_firmware
address: 40051
data_type: string
count: 8
scan_interval: 86400
- name: E3DC Modbus Firmware
unique_id: e3dc_modbus_firmware
address: 40001
data_type: uint16
scan_interval: 86400
- name: E3DC Solar Power
unique_id: e3dc_solar_power
unit_of_measurement: W
data_type: int16
address: 40067
device_class: power
scan_interval: 2
- name: E3DC Battery Power
unique_id: e3dc_battery_power
unit_of_measurement: W
address: 40069
data_type: int16
device_class: power
scan_interval: 2
- name: E3DC Battery State of Charge
unique_id: e3dc_battery_state_of_charge
unit_of_measurement: '%'
address: 40082
data_type: uint16
device_class: battery
scan_interval: 30
- name: E3DC Power Consumption House
unique_id: e3dc_house_consumption_power
unit_of_measurement: W
data_type: int16
address: 40071
device_class: power
scan_interval: 2
- name: E3DC Grid Power
unique_id: e3dc_grid_power
unit_of_measurement: W
data_type: int16
address: 40073
device_class: power
scan_interval: 2
- name: E3DC Emergency Power State
unique_id: e3dc_emergency_power_state
data_type: int16
address: 40083
scan_interval: 10
- name: E3DC Autarky and Consumption
unique_id: e3dc_autarky_and_consumption
data_type: uint16
address: 40081
scan_interval: 60
- name: E3DC String 1 Power
unique_id: e3dc_string_1_power
data_type: uint16
address: 40101
device_class: power
unit_of_measurement: W
scan_interval: 10
- name: E3DC String 2 Power
unique_id: e3dc_string_2_power
data_type: uint16
address: 40102
device_class: power
unit_of_measurement: W
scan_interval: 10
- name: E3DC String 1 Voltage
unique_id: e3dc_string_1_voltage
data_type: uint16
address: 40095
device_class: voltage
unit_of_measurement: V
scan_interval: 10
- name: E3DC String 2 Voltage
unique_id: e3dc_string_2_voltage
data_type: uint16
address: 40096
device_class: voltage
unit_of_measurement: V
scan_interval: 10
- name: E3DC String 1 Current
unique_id: e3dc_string_1_current
data_type: uint16
address: 40098
device_class: current
unit_of_measurement: A
scale: 0.01
precision: 2
scan_interval: 10
- name: E3DC String 2 Current
unique_id: e3dc_string_2_current
data_type: uint16
address: 40099
device_class: current
unit_of_measurement: A
scale: 0.01
precision: 2
scan_interval: 10
- name: E3DC Powermeter 6
unique_id: e3dc_powermeter_6
data_type: int16
address: 40128
scan_interval: 10
- name: E3DC Powermeter 6 L1
unique_id: e3dc_powermeter_6_L1
data_type: int16
address: 40129
device_class: power
unit_of_measurement: W
scan_interval: 10
- name: E3DC Powermeter 6 L2
unique_id: e3dc_powermeter_6_L2
data_type: int16
address: 40130
device_class: power
unit_of_measurement: W
scan_interval: 10
- name: E3DC Powermeter 6 L3
unique_id: e3dc_powermeter_6_L3
data_type: int16
address: 40131
device_class: power
unit_of_measurement: W
scan_interval: 10
create /config/includes/sensors.yaml :
- platform: template
sensors:
e3dc_grid_export_power:
unique_id: e3dc_grid_export_power
friendly_name: "E3DC Grid Export Power"
unit_of_measurement: "W"
device_class: power
value_template: >
{% if states('sensor.e3dc_grid_power') | int > 0 %}
0
{% else -%}
{{ (states('sensor.e3dc_grid_power') | int) | abs }}
{% endif %}
e3dc_grid_import_power:
unique_id: e3dc_grid_import_power
friendly_name: E3DC Grid Import Power
unit_of_measurement: W
device_class: power
value_template: >
{% if states('sensor.e3dc_grid_power') | int > 0 %}
{{ states('sensor.e3dc_grid_power') }}
{% else -%}
0
{% endif %}
e3dc_battery_charge_power:
unique_id: e3dc_battery_charge_power
friendly_name: E3DC Battery Charging Power
unit_of_measurement: W
device_class: power
value_template: >
{% if states('sensor.e3dc_battery_power') | int >= 0 %}
{{ states('sensor.e3dc_battery_power') }}
{% endif %}
e3dc_battery_discharge_power:
unique_id: e3dc_battery_discharge_power
friendly_name: E3DC Battery Discharging Power
unit_of_measurement: W
device_class: power
value_template: >
{% if states('sensor.e3dc_battery_power') | int <= 0 %}
{{ (states('sensor.e3dc_battery_power') | int) | abs }}
{% endif %}
e3dc_autarky:
friendly_name: "E3DC Autarky"
unique_id: e3dc_autarky
unit_of_measurement: "%"
value_template: "{{ (states('sensor.e3dc_autarky_and_consumption')|int / 256)|round(0,'floor') }}"
e3dc_own_consumption:
friendly_name: "E3DC Own Consumption ratio"
unique_id: e3dc_own_consumption_ratio
unit_of_measurement: "%"
value_template: "{{ ((states('sensor.e3dc_autarky_and_consumption')|int / 256 - states('sensor.e3dc_autarky')|int) * 256)|round(0,'floor') }}"
- platform: integration
source: sensor.e3dc_grid_import_power
name: E3DC Grid Import Energy
unit_prefix: k
round: 2
- platform: integration
source: sensor.e3dc_grid_export_power
name: E3DC Grid Export Energy
unit_prefix: k
round: 2
- platform: integration
source: sensor.e3dc_solar_power
name: E3DC Solar Energy
unit_prefix: k
round: 2
- platform: integration
source: sensor.e3dc_battery_power
name: E3DC Builtin Battery Energy
unit_prefix: k
round: 2
- platform: integration
source: sensor.e3dc_battery_charge_power
name: E3DC Battery Charge Energy
unit_prefix: k
round: 2
- platform: integration
source: sensor.e3dc_battery_discharge_power
name: E3DC Battery Discharge Energy
unit_prefix: k
round: 2
add to configuration.yaml:
#...
homeassistant:
customize_glob: !include includes/customize_global.yaml
modbus: !include includes/modbus.yaml
binary_sensor: !include includes/binary_sensors.yaml
sensor: !include includes/sensors.yaml
It took me most of the time to get an idea of the yaml formatting and edit the sensors.yaml to get it work for my environment.
Also I discoverd that my IOBroker modbus adapter runs all adresses shifted by -1 compared to the modbus.yaml. But that is just for reference if anyone think about transferring adresses.
Thanks to @ursus_polaris, @Volker and [at]Slashingsash and all others for all of your input.