Hallo zusammen, es tut mir sehr leid, ich bin neuling und sehr verzweifelt. Ich bin nicht in der Lage einen funktionierenden Code einzufügen. ich habe das ganze Netz durchsucht alles ausprobiert, aber mir werden einfach nicht die Entiäten der Sensoren angezeigt, egal was ich mache. Und schon gar nicht unter der Energie Reiter den Bezug einzubinden. Vielleicht mag mir jemand einen Tip geben.
# Loads default set of integrations. Do not remove.
default_config:
# Load frontend themes from the themes folder
frontend:
themes: !include_dir_merge_named themes
homeassistant:
customize: !include customize.yaml
automation: !include automations.yaml
script: !include scripts.yaml
scene: !include scenes.yaml
# custom rest sensor for poweropti device
rest:
- resource: https://backend.powerfox.energy/api/2/my/main/current?unit=kwh
method: GET
authentication: basic
username: !secret poweropti_username
password: !secret poweropti_password
timeout: 10
scan_interval: 30
sensor:
- name: "poweropti_cloud"
unique_id: "poweropti-cloud"
json_attributes:
- "watt"
- "timestamp"
- "a_Plus"
- "a_Plus_HT"
- "a_Plus_NT"
- "a_Minus"
- "outdated"
- name: "PowerOpti 1 Strom Aktuell"
unique_id: "poweropti1-strom-aktuell"
device_class: "power"
state_class: "measurement"
unit_of_measurement: "W"
value_template: "{{ value_json.watt }}"
availability: "{{ is_number(state_attr('sensor.poweropti_cloud', 'watt')) and state_attr('sensor.poweropti_cloud', 'outdated') == false}}"
- name: "PowerOpti 1 Strom Gesamt"
unique_id: "poweropti1-strom-total"
device_class: "energy"
state_class: "total_increasing"
unit_of_measurement: "kWh"
value_template: "{{ value_json.a_Plus }}"
availability: "{{ is_number(state_attr('sensor.poweropti_cloud', 'a_Plus')) and state_attr('sensor.poweropti_cloud', 'outdated') == false}}"
- name: "PowerOpti 1 Einspeisung Gesamt"
unique_id: "poweropti1-production-total"
device_class: "energy"
state_class: "total_increasing"
unit_of_measurement: "kWh"
value_template: "{{ value_json.a_Minus }}"
availability: "{{ is_number(state_attr('sensor.poweropti_cloud', 'a_Minus')) and state_attr('sensor.poweropti_cloud', 'outdated') == false}}"
by HarryP: Code-/Logzeilen formatiert (bitte immer in </> einbinden)