syssi / xiaomi_airconditioningcompanion

Xiaomi Mi and Aqara Air Conditioning Companion integration for Home Assistant
Apache License 2.0
400 stars 94 forks source link

Is it possible to set the target temperature sensor Id to optional? #121

Open LiangZugeng opened 3 years ago

LiangZugeng commented 3 years ago

In the configuration the target temperature sensor Id is required as per the source code indicated, in my case I do have the temperature sensor, but the sensor is managed by a Lumi gateway which is not added into HomeAssistant but is added to Mijia/Homekit only, so the temperature sensor ID is not accessible from HA.

In my config file I set the ID to a random value, and in HA the temperature of the AC is always displayed as 0 but in HomeKit the current temperature of the AC is always displayed as 21 degree.

image image

I wonder if the target temperature sensor can be set to optional in the config, is it a mandatory for the climate entry in HA? If not this field can be set as optional, when the value is provided the current temperature can be retrieved, if not provided then the gadget of the AC in HA may hide the current temperature just like what is shown in Mijia app.

My config:

climate living_room_ac:
  - platform: xiaomi_miio_airconditioningcompanion
    name: 客厅空调
    host: 192.168.32.11
    token: HIDDEN_VALUE
    target_sensor: sensor.temperature_lumi_158d000255507e    <--- This is set to a non-existing/random Id
    scan_interval: 60
syssi commented 3 years ago

Which device model do you own?

LiangZugeng commented 3 years ago

@syssi thanks for the reply.

The model info is as follows:

Model: lumi.acpartner.v2 Hardware version: MW300 Firmware version: 1.4.1_153