Hallo @JoMac, sehr gerne…
die Daten der eCB1 lassen sich im Netzwerk über http://ecb1.local/api/v1/meters/1 abrufen.
Um die dortigen Infos in HA zu bekommen, habe ich die Sensoren über REST erstellt. Danke an der Stelle nochmals an @totow !
In die configuration.yaml folgenden Code:
Die Zeilen mit # oder ## am Anfang sind lediglich eine Arbeitshilfe und nicht zwingend notwendig. Ich schreibe mir halt immer gerne etwas zur Doku dazu.
## Abruf der API-Werte des eCB1 - Hardy Barth Wallbox
## Werte Test:
## {"meter": {"function": "socket", "type": "eCB1 intern", "ipaddress": "127.0.0.1", "vendor": "eCHARGE", "serial": XXXXXXXX, "id": 1, "data": {"1-0:22.4.0": 0.0, "1-0:73.4.0": 0.0, "1-0:51.4.0": 0.0, "1-0:62.4.0": 0.0, "1-0:41.4.0": 0.0, "1-0:72.4.0": 226.973, "1-0:42.4.0": 0.0, "1-0:42.8.0": 0.0, "1-0:2.4.0": 0.0, "1-0:62.8.0": 0.0, "1-0:53.4.0": 0.0, "1-0:41.8.0": 0.0, "1-0:1.8.0": 8.7715, "1-0:61.8.0": 0.0, "1-0:2.8.0": 0.0, "lgwb": -5.0, "1-0:21.8.0": 8.7715, "1-0:52.4.0": 228.037, "1-0:31.4.0": 0.025, "1-0:61.4.0": 0.0, "1-0:71.4.0": 0.0, "1-0:21.4.0": 5.0, "1-0:33.4.0": 0.858, "1-0:13.4.0": 0.858, "1-0:22.8.0": 0.0, "1-0:1.4.0": 5.0, "1-0:32.4.0": 227.321}, "name": "Carport"}, "protocol-version": "1.4"}
# lgwb Saldo Active power+/- <= aktuelle Leistung "-5.6"
# 1-0:1.4.0 Active power+ <= aktuelle Leistung "5.6"
# 1-0:1.8.0 Active energy+ <= Zähler Arbeit/Energie "8.7731999999999988"
# 1-0:2.4.0 Active power- <= aktuelle Leistung "0.0"
# 1-0:2.8.0 Active energy- <= Zähler Arbeit/Energie "0.0"
# 1-0:13.4.0 Power factor "0.866"
# 1-0:21.4.0 Active power+ (L1) "5.6"
# 1-0:21.8.0 Active energy+ (L1) "8.7731999999999988"
# 1-0:22.4.0 Active power- (L1) "0.0"
# 1-0:22.8.0 Active energy- (L1) "0.0"
# 1-0:31.4.0 Current (L1) "0.027999999999999994"
# 1-0:32.4.0 Voltage (L1) "226.914"
# 1-0:33.4.0 Power factor (L1) "0.866"
# 1-0:41.4.0 Active power+ (L2) "0.0"
# 1-0:41.8.0 Active energy+ (L2) "0.0"
# 1-0:42.4.0 Active power- (L2) "0.0"
# 1-0:42.8.0 Active energy- (L2) "0.0"
# 1-0:51.4.0 Current (L2) "0.0"
# 1-0:52.4.0 Voltage (L2) "227.55900000000009"
# 1-0:53.4.0 Power factor (L2) "0.0"
# 1-0:61.4.0 Active power+ (L3) "0.0"
# 1-0:61.8.0 Active energy+ (L3) "0.0"
# 1-0:62.4.0 Active power- (L3) "0.0"
# 1-0:62.8.0 Active energy- (L3) "0.0"
# 1-0:71.4.0 Current (L3) "0.0"
# 1-0:72.4.0 Voltage (L3) "226.546"
# 1-0:73.4.0 Power factor (L3) "0.0"
rest:
- resource: "http://ecb1.local/api/v1/meters/1"
sensor:
- name: "ecb1 Saldo Active power+/- aktuelle Leistung"
value_template: "{{ value_json['meter']['data']['lgwb'] | round(0) }}"
unit_of_measurement: "W"
- name: "ecb1 Active power+ aktuelle Leistung"
value_template: "{{ value_json['meter']['data']['1-0:1.4.0'] | round(0) }}"
unit_of_measurement: "W"
- name: "ecb1 Active energy+ Zähler Arbeit/Energie"
value_template: "{{ value_json['meter']['data']['1-0:1.8.0'] | round(1) }}"
unit_of_measurement: "kWh"
- name: "ecb1 Active power- aktuelle Leistung"
value_template: "{{ value_json['meter']['data']['1-0:2.4.0'] | round(0) }}"
unit_of_measurement: "W"
- name: "ecb1 Active energy- Zähler Arbeit/Energie"
value_template: "{{ value_json['meter']['data']['1-0:2.8.0'] | round(1) }}"
unit_of_measurement: "kWh"
- name: "ecb1 Power factor gesamt"
value_template: "{{ value_json['meter']['data']['1-0:13.4.0'] | round(0) }}"
unit_of_measurement: "W"
- name: "ecb1 Active power+ (L1)"
value_template: "{{ value_json['meter']['data']['1-0:21.4.0'] | round(0) }}"
unit_of_measurement: "W"
- name: "ecb1 Active energy+ (L1)"
value_template: "{{ value_json['meter']['data']['1-0:21.8.0'] | round(1) }}"
unit_of_measurement: "kWh"
- name: "ecb1 Active power- (L1)"
value_template: "{{ value_json['meter']['data']['1-0:22.4.0'] | round(0) }}"
unit_of_measurement: "W"
- name: "ecb1 Active energy- (L1)"
value_template: "{{ value_json['meter']['data']['1-0:22.8.0'] | round(0) }}"
unit_of_measurement: "W"
- name: "ecb1 Current (L1)"
value_template: "{{ value_json['meter']['data']['1-0:31.4.0'] | round(1) }}"
unit_of_measurement: "A"
- name: "ecb1 Voltage (L1)"
value_template: "{{ value_json['meter']['data']['1-0:32.4.0'] | round(1) }}"
unit_of_measurement: "V"
- name: "ecb1 Power factor (L1)"
value_template: "{{ value_json['meter']['data']['1-0:33.4.0'] | round(1) }}"
unit_of_measurement: ""
- name: "ecb1 Active power+ (L2)"
value_template: "{{ value_json['meter']['data']['1-0:41.4.0'] | round(0) }}"
unit_of_measurement: "W"
- name: "ecb1 Active energy+ (L2)"
value_template: "{{ value_json['meter']['data']['1-0:41.8.0'] | round(1) }}"
unit_of_measurement: "kWh"
- name: "ecb1 Active power- (L2)"
value_template: "{{ value_json['meter']['data']['1-0:42.4.0'] | round(0) }}"
unit_of_measurement: "W"
- name: "ecb1 Active energy- (L2)"
value_template: "{{ value_json['meter']['data']['1-0:42.8.0'] | round(0) }}"
unit_of_measurement: "W"
- name: "ecb1 Current (L2)"
value_template: "{{ value_json['meter']['data']['1-0:51.4.0'] | round(1) }}"
unit_of_measurement: "A"
- name: "ecb1 Voltage (L2)"
value_template: "{{ value_json['meter']['data']['1-0:52.4.0'] | round(1) }}"
unit_of_measurement: "V"
- name: "ecb1 Power factor (L2)"
value_template: "{{ value_json['meter']['data']['1-0:53.4.0'] }}"
unit_of_measurement: ""
- name: "ecb1 Active power+ (L3)"
value_template: "{{ value_json['meter']['data']['1-0:61.4.0'] | round(1) }}"
unit_of_measurement: "W"
- name: "ecb1 Active energy+ (L3)"
value_template: "{{ value_json['meter']['data']['1-0:61.8.0'] | round(1) }}"
unit_of_measurement: "kWh"
- name: "ecb1 Active power- (L3)"
value_template: "{{ value_json['meter']['data']['1-0:62.4.0'] | round(0) }}"
unit_of_measurement: "W"
- name: "ecb1 Active energy- (L3)"
value_template: "{{ value_json['meter']['data']['1-0:62.8.0'] | round(0) }}"
unit_of_measurement: "W"
- name: "ecb1 Current (L3)"
value_template: "{{ value_json['meter']['data']['1-0:71.4.0'] | round(1) }}"
unit_of_measurement: "A"
- name: "ecb1 Voltage (L3)"
value_template: "{{ value_json['meter']['data']['1-0:72.4.0'] | round(1) }}"
unit_of_measurement: "V"
- name: "ecb1 Power factor (L3)"
value_template: "{{ value_json['meter']['data']['1-0:73.4.0'] }}"
unit_of_measurement: ""
Nach einem Neustart von HA solltest Du dann die einzelnen Sensoren als Entitäten haben. Diese findet Du dann, wenn Du nach “eCB1” suchst.
Diese Entitäten kannst Du dann gut für viele Zwecke verwenden.
z.B.:
Bei Fragen einfach melden.
VG Michael