KiraPC / ha-switchbot-remote

A Custom HomeAssistant Integration to control Switchbot Hub
MIT License
54 stars 3 forks source link

climate.set_temperature Causes AC to Turn off #52

Closed rewse closed 4 months ago

rewse commented 4 months ago

When I send the following command, my AC is always turned off.

service: climate.set_temperature
target:
  entity_id: climate.dads_room_ac 
data:
  temperature: 26
  hvac_mode: cool

According to the log on the mobile app, turning off has been called via API. The buttons on the mobile app work correctly.

IMG_1150

Expected Results

Actual Results

Frequency

Always

Version

KiraPC commented 4 months ago

Hello, @rewse

This is related on how your physical remote works.

Basically, the switchbot hub sends all the command status, if you did not set the "on/off" value before to send the temp, the status will not change.

You have to manually call the service to turn on the device.

Does the Integration Work when you try to turn the device on via the interface?

rewse commented 4 months ago

I see. Thank you for your quick reply.

When I send climate.turn_on before climate.set_temperature, it works as expected.

- service: climate.turn_on
  target:
    entity_id: climate.dads_room_ac 
- service: climate.set_temperature
  target:
    entity_id: climate.dads_room_ac 
  data:
    temperature: 26
    hvac_mode: cool

I can call the above two services at automation without issues, but the Thermostat card cannot choose turning on easily before changing the temperature.

When we call climate.set_temperature, could you call SwitchBot API setAll with "power state" always on? I think nobody expects turning off when calling climate.set_temperature.

KiraPC commented 4 months ago

I don't want to change the behavior of a service.

The service is set_temperature, and not, turn_on_and_set_temperature.

I use to use the Thermostat card, I first tap on the card to turn on the climate, then change the temperature.

It's a design think.

rewse commented 4 months ago

OK. Understood.

KiraPC commented 4 months ago

Thanks you for understanding.