Hi all I’ve a problem “translation” my configuration.yaml code to the new “syntax” needed with the 2021.7 version.
This is the old version. Can anyone help me to convert this to the new one, I’m not a programmer …
sensor:
- platform: modbus
scan_interval: 5
registers:
- name: E3DC Solar Hausdach
unit_of_measurement: W
register: 40067
hub: e3dc
device_class: power
- name: E3DC Batterie
unit_of_measurement: W
register: 40069
hub: e3dc
device_class: power
- name: E3DC Wallbox
unit_of_measurement: W
register: 40077
hub: e3dc
device_class: power
- name: E3DC Hausbezug
unit_of_measurement: W
register: 40071
hub: e3dc
device_class: power
- name: E3DC Netzbezug
unit_of_measurement: W
register: 40073
hub: e3dc
device_class: power
- name: E3DC Solar extern Garage
register: 40075
hub: e3dc
device_class: power
- name: E3DC Wallbox solar
unit_of_measurement: W
register: 40079
hub: e3dc
device_class: power
- name: E3DC Autarkie
data_type: uint
register: 40081
hub: e3dc
- name: E3DC Batterie Ladung
data_type: uint
register: 40082
hub: e3dc
- name: E3DC emergency power state
data_type: uint
register: 40083
hub: e3dc
- name: E3DC_emergency_state
slave: 1
data_type: uint
register: 40084
hub: e3dc
- name: E3DC_Leistungsmesser-L1
slave: 1
data_type: uint
register: 40105
hub: e3dc
- name: E3DC_Leistungsmesser-L2
slave: 1
data_type: uint
register: 40106
hub: e3dc
- name: E3DC_Leistungsmesser-L3
slave: 1
data_type: uint
register: 40107
hub: e3dc
modbus:
name: e3dc
type: tcp
host: 192.168.1.159
port: 502
binary_sensor:
- platform: template
sensors:
e3dc_emergency_power_available:
friendly_name: "E3DC Emergency Power available"
value_template: "{{ states('sensor.e3dc_ems_state')|int|bitwise_and(4) > 0 }}"
e3dc_battery_loading_blocked:
friendly_name: "E3DC Battery loading blocked"
value_template: "{{ states('sensor.e3dc_ems_state')|int|bitwise_and(1) > 0 }}"
e3dc_battery_unloading_blocked:
friendly_name: "E3DC Battery unloading blocked"
value_template: "{{ states('sensor.e3dc_ems_state')|int|bitwise_and(2) > 0 }}"
e3dc_weather_based_loading:
friendly_name: "E3DC weather based loading limiter"
value_template: "{{ states('sensor.e3dc_ems_state')|int|bitwise_and(8) > 0 }}"
e3dc_power_limiter:
friendly_name: "E3DC power limiter"
value_template: "{{ states('sensor.e3dc_ems_state')|int|bitwise_and(16) > 0 }}"
e3dc_smartcharge_loading_blocked:
friendly_name: "E3DC SmartCharge loading blocked"
value_template: "{{ states('sensor.e3dc_ems_state')|int|bitwise_and(32) > 0 }}"
e3dc_smartcharge_unloading_blocked:
friendly_name: "E3DC SmartCharge unloading blocked"
value_template: "{{ states('sensor.e3dc_ems_state')|int|bitwise_and(64) > 0 }}"
- platform: template
sensors:
e3dc_autarky:
friendly_name: 'E3DC Autarky'
unit_of_measurement: '%'
value_template: "{{ (states('sensor.e3dc_own_consumption')|int / 256)|round(0,'floor') }}"
e3dc_own_consumption:
friendly_name: 'E3DC Own Consumption ratio'
unit_of_measurement: '%'
value_template: "{{ ((states('sensor.e3dc_own_consumption')|int / 256 - states('sensor.e3dc_autarkie')|int) * 256)|round(0,'floor') }}"