Hi,
of course, here is my sensors.yaml:
- platform: rest
name: heat_pump_api
resource: https://app.melcloud.com/Mitsubishi.Wifi.Client/user/ListDevices?id=88506454&buildingID=660070
method: GET
headers:
X-MitsContextKey: 'XXXXXXXXXXXXXXXXXXXXXX'
value_template: "OK"
scan_interval: 60
force_update: true
unique_id: "heat_pump_api1"
json_attributes_path: "$..Devices[?(@.DeviceID==88506454)].Device"
json_attributes:
- CurrentEnergyConsumed
- CurrentEnergyProduced
- DefrostMode
- RoomTemperatureZone1
- RoomTemperatureZone2
- OutdoorTemperature
- FlowTemperature
- FlowTemperatureZone1
- FlowTemperatureZone2
- FlowTemperatureBoiler
- ReturnTemperature
- ReturnTemperatureZone1
- ReturnTemperatureZone2
- ReturnTemperatureBoiler
- TankWaterTemperature
- SetTankWaterTemperature
- MixingTankWaterTemperature
- TargetHCTemperatureZone1
- TargetHCTemperatureZone2
- CondensingTemperature
- HeatPumpFrequency
- DailyHeatingEnergyConsumed
- DailyHotWaterEnergyConsumed
- DailyHeatingEnergyProduced
- DailyHotWaterEnergyProduced
- DailyLegionellaActivationCounter
- BoilerStatus
- BoosterHeater1Status
- BoosterHeater2Status
- BoosterHeater2PlusStatus
- ImmersionHeaterStatus
- WaterPump1Status
- WaterPump2Status
- WaterPump3Status
- ValveStatus3Way
- ValveStatus2Way
- WaterPump4Status
- ValveStatus2Way2a
- ValveStatus2Way2b
- ThermostatStatusZone1
- ThermostatStatusZone2
- platform: template
sensors:
heat_pump_currentenergyconsumedpower:
friendly_name: "CurrentEnergyConsumed"
# 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: "CurrentEnergyConsumed1"
heat_pump_currentenergyproduced:
friendly_name: "CurrentEnergyProduced"
# 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', 'CurrentEnergyProduced') != None) }}
value_template: "{{ state_attr('sensor.heat_pump_api', 'CurrentEnergyProduced') }}"
device_class: power
unit_of_measurement: "kW"
unique_id: "CurrentEnergyProduced1"
heat_pump_dailyheatingenergyconsumed:
friendly_name: "DailyHeatingEnergyConsumed"
# 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', 'DailyHeatingEnergyConsumed') != None) }}
value_template: "{{ state_attr('sensor.heat_pump_api', 'DailyHeatingEnergyConsumed') }}"
device_class: energy
unit_of_measurement: "kWh"
unique_id: "DailyHeatingEnergyConsumed1"
heat_pump_dailyhotwaterenergyconsumed:
friendly_name: "DailyHotWaterEnergyConsumed"
# 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', 'DailyHotWaterEnergyConsumed') != None) }}
value_template: "{{ state_attr('sensor.heat_pump_api', 'DailyHotWaterEnergyConsumed') }}"
device_class: energy
unit_of_measurement: "kWh"
unique_id: "DailyHotWaterEnergyConsumed1"
heat_pump_dailyheatingenergyproduced:
friendly_name: "DailyHeatingEnergyProduced"
availability_template: >-
{{ (states("sensor.heat_pump_api") not in ["unknown", "unavailable"]) and (state_attr('sensor.heat_pump_api', 'DailyHeatingEnergyProduced') != None) }}
value_template: "{{ state_attr('sensor.heat_pump_api', 'DailyHeatingEnergyProduced') }}"
device_class: energy
unit_of_measurement: "kWh"
unique_id: "DailyHeatingEnergyProduced1"
heat_pump_dailyhotwaterenergyproduced:
friendly_name: "DailyHotWaterEnergyProduced"
availability_template: >-
{{ (states("sensor.heat_pump_api") not in ["unknown", "unavailable"]) and (state_attr('sensor.heat_pump_api', 'DailyHotWaterEnergyProduced') != None) }}
value_template: "{{ state_attr('sensor.heat_pump_api', 'DailyHotWaterEnergyProduced') }}"
device_class: energy
unit_of_measurement: "kWh"
unique_id: "DailyHotWaterEnergyProduced1"
heat_pump_heatpumpfrequency:
friendly_name: "HeatPumpFrequency"
# 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', 'HeatPumpFrequency') != None) }}
value_template: "{{ state_attr('sensor.heat_pump_api', 'HeatPumpFrequency') }}"
device_class: frequency
unit_of_measurement: "Hz"
unique_id: "HeatPumpFrequency1"
heat_pump_defrostmode:
friendly_name: "DefrostMode"
# 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', 'DefrostMode') != None) }}
value_template: "{{ state_attr('sensor.heat_pump_api', 'DefrostMode') }}"
device_class: aqi
unit_of_measurement: ""
unique_id: "DefrostMode1"
heat_pump_roomtemperaturezone1:
friendly_name: "RoomTemperatureZone1"
availability_template: >-
{{ (states("sensor.heat_pump_api") not in ["unknown", "unavailable"]) and (state_attr('sensor.heat_pump_api', 'RoomTemperatureZone1') != None) }}
value_template: "{{ state_attr('sensor.heat_pump_api', 'RoomTemperatureZone1') }}"
device_class: temperature
unit_of_measurement: "°C"
unique_id: "RoomTemperatureZone1_1"
heat_pump_roomtemperaturezone2:
friendly_name: "RoomTemperatureZone2"
availability_template: >-
{{ (states("sensor.heat_pump_api") not in ["unknown", "unavailable"]) and (state_attr('sensor.heat_pump_api', 'RoomTemperatureZone2') != None) }}
value_template: "{{ state_attr('sensor.heat_pump_api', 'RoomTemperatureZone2') }}"
device_class: temperature
unit_of_measurement: "°C"
unique_id: "RoomTemperatureZone2_1"
heat_pump_outdoortemperature:
friendly_name: "OutdoorTemperature"
availability_template: >-
{{ (states("sensor.heat_pump_api") not in ["unknown", "unavailable"]) and (state_attr('sensor.heat_pump_api', 'OutdoorTemperature') != None) }}
value_template: "{{ state_attr('sensor.heat_pump_api', 'OutdoorTemperature') }}"
device_class: temperature
unit_of_measurement: "°C"
unique_id: "OutdoorTemperature_1"
heat_pump_flowtemperature:
friendly_name: "FlowTemperature"
availability_template: >-
{{ (states("sensor.heat_pump_api") not in ["unknown", "unavailable"]) and (state_attr('sensor.heat_pump_api', 'FlowTemperature') != None) }}
value_template: "{{ state_attr('sensor.heat_pump_api', 'FlowTemperature') }}"
device_class: temperature
unit_of_measurement: "°C"
unique_id: "FlowTemperature_1"
heat_pump_tankwatertemperature:
friendly_name: "TankWaterTemperature"
availability_template: >-
{{ (states("sensor.heat_pump_api") not in ["unknown", "unavailable"]) and (state_attr('sensor.heat_pump_api', 'TankWaterTemperature') != None) }}
value_template: "{{ state_attr('sensor.heat_pump_api', 'TankWaterTemperature') }}"
device_class: temperature
unit_of_measurement: "°C"
unique_id: "TankWaterTemperature_1"
heat_pump_mixingtankwatertemperature:
friendly_name: "MixingTankWaterTemperature"
availability_template: >-
{{ (states("sensor.heat_pump_api") not in ["unknown", "unavailable"]) and (state_attr('sensor.heat_pump_api', 'MixingTankWaterTemperature') != None) }}
value_template: "{{ state_attr('sensor.heat_pump_api', 'MixingTankWaterTemperature') }}"
device_class: temperature
unit_of_measurement: "°C"
unique_id: "MixingTankWaterTemperature_1"
heat_pump_condensingtemperature:
friendly_name: "CondensingTemperature"
availability_template: >-
{{ (states("sensor.heat_pump_api") not in ["unknown", "unavailable"]) and (state_attr('sensor.heat_pump_api', 'CondensingTemperature') != None) }}
value_template: "{{ state_attr('sensor.heat_pump_api', 'CondensingTemperature') }}"
device_class: temperature
unit_of_measurement: "°C"
unique_id: "CondensingTemperature_1"
heat_pump_returntemperature:
friendly_name: "ReturnTemperature"
availability_template: >-
{{ (states("sensor.heat_pump_api") not in ["unknown", "unavailable"]) and (state_attr('sensor.heat_pump_api', 'ReturnTemperature') != None) }}
value_template: "{{ state_attr('sensor.heat_pump_api', 'ReturnTemperature') }}"
device_class: temperature
unit_of_measurement: "°C"
unique_id: "ReturnTemperature_1"