Hallo und guten Morgen, kann mir bitte jemand helfen und Tipps geben wo hier noch Fehler sind? Der Codechecker sagt alles ist i.O.
Code:
# Loads default set of integrations. Do not remove.
default_config:
# Load frontend themes from the themes folder
frontend:
themes: !include_dir_merge_named themes
# Text to speech
tts:
- platform: google_translate
automation: !include automations.yaml
script: !include scripts.yaml
scene: !include scenes.yaml
sensor:
# Foxess
- platform: 12345
username: 12345
password: 12345
deviceID: 12345
# MyStrom Switch
- platform: rest
name: "mystrom_power"
resource: http://192.168.2.123/report
method: GET
unit_of_measurement: W
device_class: power
state_class: measurement
value_template: "{{ value_json.power }}"
- platform: rest
name: "mystrom_temp"
resource: http://192.168.2.123/report
method: GET
unit_of_measurement: W
device_class: power
state_class: measurement
value_template: "{{ value_json.temperature | round(1) }}"
- platform: rest
name: "mystrom_power1"
resource: http://192.168.2.123/report
method: GET
unit_of_measurement: W
device_class: power
state_class: measurement
value_template: "{{ value_json.Ws }}"
midea_dehumidifier:
username: 12345
password: 12345
# put this in your configuration.yaml to get sensor data from powerfox.de
rest:
- resource: http://192.168.2.128/rpc
method: POST
payload: '{"id":1,"jsonrpc":"2.0","method":"getConfig","params":{"key":"latest_data"}}'
scan_interval: 10
headers:
Content-Type: application/json
sensor:
- name: "poweropti_local"
json_attributes:
- "jsonrpc"
- "id"
- "result"
value_template: >
{% set json = value_json.result | base64_decode %}
{% set Timestmp = (json | from_json())[0].t %}
{% set zaehlernummer = (json | from_json())[0].m %}
{% set A_Plus = (json | from_json())[0].d[0].v %}
{% set A_Plus_HT = (json | from_json())[0].d[1].v %}
{% set A_Plus_NT = (json | from_json())[0].d[2].v %}
{% set A_Minus = (json | from_json())[0].d[3].v %}
{% set timestmp2 = (json | from_json())[1].t %}
{% set watt = (json | from_json())[1].d[0].v %}
{{ '{"Watt":' + (watt | string) + ',"Timestamp":' + (Timestmp | string) + ',"A_Plus":' + (((A_Plus | float) / 1000) | string) + ',"A_Minus":' + (((A_Minus | float) / 1000) | string) + '}' }}
template:
- sensor:
- name: "Strom aktuell"
unit_of_measurement: "W"
device_class: "power"
state_class: "measurement"
state: >
{{ (states('sensor.poweropti_local')|from_json).Watt }}
- name: "Strom Bezug"
unit_of_measurement: "kWh"
device_class: "energy"
state_class: "total_increasing"
state: >
{{ (states('sensor.poweropti_local')|from_json).A_Plus }}
- name: "Strom-Netz-Lieferung"
unit_of_measurement: "kWh"
device_class: "energy"
state_class: "total_increasing"
state: >
{{ (states('sensor.poweropti_local')|from_json).A_Minus }}
# MyStrom Switch
switch:
- platform: mystrom
host: 192.168.2.123