Hey guys,
I am not a coder. But ChatGPT cooked me this up:
modbus:
- name: e3dc
type: tcp
host: 10.2.1.10
port: 502
sensors:
- name: E3DC Wallbox Bits
address: 40087
data_type: uint16
slave: 1
- platform: template
sensors:
e3dc_wallbox_solarbetrieb_aktiv:
name: "E3DC Wallbox Solarbetrieb aktiv"
device_class: power
entity_id: sensor.e3dc_wallbox_bits
value_template: "{{ ((states('sensor.e3dc_wallbox_bits') | int) & 0b10) >> 1 == 1 }}"
e3dc_wallbox_laden_abgebrochen:
name: "E3DC Wallbox Laden abgebrochen"
device_class: power
entity_id: sensor.e3dc_wallbox_bits
value_template: "{{ ((states('sensor.e3dc_wallbox_bits') | int) & 0b100) >> 2 == 1 }}"
[...]
Which looks scary but great. I only need to get the syntax right for this. Anyone care to help me? I can adjust all the stuff myself once I get going. Have been whacking at it for hours…