Hello community
I am currently facing a problem where I have not found a solution in the cases from our forum.
I always get the following error:
My REST sensor looks like this.
Can you identify an error here and possibly help me?
sensor:
- platform: rest
name: heat_pump_api
resource_template: https://app.melcloud.com/Mitsubishi.Wifi.Client/user/ListDevices?id=XXXXXXXX&buildingID=XXXXX
method: GET
headers:
X-MitsContextKey: 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
value_template: "OK"
scan_interval: 60
json_attributes_path: "$..Devices[?(@.DeviceID==XXXXXXXXX)].Device"
json_attributes:
- CurrentEnergyConsumed
#- DailyHeatingEnergyConsumed
#- DailyHotWaterEnergyConsumed
#- DailyEnergyConsumedDaily
#- HeatPumpFrequency
#- DefrostMode
- platform: template
sensors:
heat_pump_power:
friendly_name: "Heat Pump Power"
# availability_template: "{{ is_state('sensor.heat_pump_api', 'OK') }}"
availability_template: >-
{{ (states("sensor.heat_pump_api") not in ["unknown", "unavailable"]) and (state_attr('sensor.heat_pump_api', 'CurrentEnergyConsumed') != None) }}
value_template: "{{ state_attr('sensor.heat_pump_api', 'CurrentEnergyConsumed') }}"
device_class: power
unit_of_measurement: "kW"
unique_id: 010320231
Many thanks in advance