For those of you with a Mitsubishi Ecodan Heater (for sanitary water and heating) you probably know it breaks this plug in when you add it to your MelCloud account. Somehow the plugin breaks when it gets water-related values that are not referenced in the component.
I created a MelCloud guest account to include only the devices that can be controlled by this component. But I found a way to at least monitor the Ecodan system. First get a contextKey by going to terminal (change email and password to your account login info):
curl --data "AppVersion=1.7.1.0&Language=7&CaptchaChallenge´=&CaptchaResponse=&Persist=true&[email protected]&Password=yourpassword" https://app.melcloud.com/Mitsubishi.Wifi.Client/Login/ClientLogin
Then copy and paste your context key here so you can get a list of buildings and devices on your MeLCloud account:
curl -v --header "X-MitsContextKey: contextkeynumbersgohere" https://app.melcloud.com/Mitsubishi.Wifi.Client/User/ListDevices
Building ID is the first ID number. Look closely to find your Ecodan Device ID, should be a 5-number string. Now you can get all available values by typing:
curl -v -H "X-MitsContextKey: contextkeynumbersgohere" "https://app.melcloud.com/Mitsubishi.Wifi.Client/Device/Get?id=123456&buildingID=12345"
Now you can create a command_line sensor with any of those values as json_attributes, so you can have any number of extra sensors for whatever values you want to monitor. I just wanted to know if the system is on or off (Power), if the heat pump is running (OperationMode) and the water tank temperature (TankWaterTemperature):
- platform: command_line
json_attributes:
- TankWaterTemperature
- OperationMode
- Power
command: 'curl -v -H "X-MitsContextKey: contextkeynumbersgohere" "https://app.melcloud.com/Mitsubishi.Wifi.Client/Device/Get?id=123456&buildingID=12345"'
name: Ecodan
unit_of_measurement: '°C'
value_template: '{{ value_json.TankWaterTemperature }}'
scan_interval: 90
command_timeout: 30
- platform: template
sensors:
ecodanoperationmode:
friendly_name: "Ecodan Heating"
value_template: >-
{% if is_state_attr('sensor.ecodan','OperationMode',0) %}
Off
{% elif is_state_attr('sensor.ecodan','OperationMode',1) %}
Heating ACS
{% elif is_state_attr('sensor.ecodan','OperationMode',2) %}
Heating Radiators
{% elif is_state_attr('sensor.ecodan','OperationMode',3) %}
Cooling
{% elif is_state_attr('sensor.ecodan','OperationMode',4) %}
Defrost
{% elif is_state_attr('sensor.ecodan','OperationMode',5) %}
Standby
{% elif is_state_attr('sensor.ecodan','OperationMode',6) %}
Legionella
{% else %}
Unknown
{% endif %}
ecodanpower:
friendly_name: "Ecodan Power"
device_class: power
value_template: >-
{% if is_state_attr('sensor.ecodan','Power',true) %}
ON
{% else %}
OFF
{% endif %}
That’s it. Now obviously this is read-only, and getting the Ecodan to work with the MelCloud component would be way more convenient. Just in case someone can take a look, here are the values to read/write:
{
"EffectiveFlags": 0,
"LocalIPAddress": null,
"SetTemperatureZone1": 30,
"SetTemperatureZone2": 20,
"RoomTemperatureZone1": 35.5,
"RoomTemperatureZone2": -39,
"OperationMode": 0,
"OperationModeZone1": 1,
"OperationModeZone2": 2,
"WeatherObservations": [
],
"ErrorMessage": null,
"ErrorCode": 8000,
"SetHeatFlowTemperatureZone1": 60,
"SetHeatFlowTemperatureZone2": 0,
"SetCoolFlowTemperatureZone1": 0,
"SetCoolFlowTemperatureZone2": 0,
"HCControlType": 1,
"TankWaterTemperature": 50.5,
"SetTankWaterTemperature": 50,
"ForcedHotWaterMode": false,
"UnitStatus": 0,
"OutdoorTemperature": 33,
"EcoHotWater": true,
"Zone1Name": "Heating",
"Zone2Name": null,
"HolidayMode": false,
"ProhibitZone1": false,
"ProhibitZone2": false,
"ProhibitHotWater": false,
"TemperatureIncrementOverride": 0,
"IdleZone1": true,
"IdleZone2": true,
"DeviceID": 123456,
"DeviceType": 1,
"LastCommunication": "2019-08-08T15:14:48.467",
"NextCommunication": "2019-08-08T15:15:48.467",
"Power": true,
"HasPendingCommand": false,
"Offline": false,
"Scene": null,
"SceneOwner": null
}
There might be some useful info here.