Hallo zusammen,
ich versuche gerade meinen Energiezähler in Home-Assistant einzubinden. Über folgenden Link:
[xxx.xxx.x.x/rest/solarworld/lpvm/powerAndBatteryData]
erhalte ich lokal folgende Werte:
{
"PowerSelfConsumption": 2427.6691346598795,
"PowerConsumption": 0,
"PowerOut": 1118.4083119488978,
"StatesOfCharge": {
"WorkCharge": 840.0000000000001,
"ModeConverter": "CHARGING",
"StateOfCharge": 14
},
"PowerTotalPV": 3546.0774466087773,
"PowerPVPeak": 7560,
"PowerSelfSupply": 0,
"PowerIn": 0,
"PowerConsumptionMax": {
"2024-03-10": 9724.328729331824,
"2024-03-11": 4978.419758734486,
"2024-03-12": 8189.932884234362,
"2024-03-13": 9193.587202032773,
"2024-03-16": 6062.781152153109,
"2024-03-15": 6396.105971234429,
"2024-03-14": 6977.5374043560605
}
}
Ich habe versucht, sie wie folgt in Home Assistant einzubinden, aber es klappt nicht! Kann mir jemand helfen?
# Loads default set of integrations. Do not remove.
default_config:
# Load frontend themes from the themes folder
frontend:
themes: !include_dir_merge_named themes
automation: !include automations.yaml
script: !include scripts.yaml
scene: !include scenes.yaml
rest:
- resource: http://xxx.xxx.x.x/rest/solarworld/lpvm/powerAndBatteryData
scan_interval: 60
sensor:
- name: "suntrol"
json_attributes:
- "PowerIn"
- "PowerOut"
- "PowerTotalPV"
- "WorkCharge"
template:
- sensor:
- name: "Strom-Bezug"
unit_of_measurement: "Wh"
device_class: "energy"
state_class: "measurement"
state: >
{{ state_attr('sensor.suntrol', 'PowerIn') }}
- name: "PV-Einspeisung"
unit_of_measurement: "Wh"
device_class: "energy"
state_class: "measurement"
state: >
{{ state_attr('sensor.suntrol', 'PowerOut') }}
- name: "PV-Erzeugung"
unit_of_measurement: "Wh"
device_class: "energy"
state_class: "measurement"
state: >
{{ state_attr('sensor.suntrol', 'PowerTotalPV') }}
- name: "Batteriespeicher"
unit_of_measurement: "Wh"
device_class: "energy"
state_class: "total_increasing"
state: >
{{ state_attr('sensor.suntrol', 'WorkCharge') }}