nitaybz / homebridge-sensibo-ac

Homebridge plugin for Sensibo - Smart AC Control
GNU General Public License v3.0
69 stars 15 forks source link

Homekit automations to turn off the AC, turns it on instead. #135

Closed pvanamst closed 1 month ago

pvanamst commented 4 months ago

I have an Abode security system installed at the same house that has a Fujitsu AC system with a Sensible AC wifi unit installed. The idea is that when somebody opens the one of the doors in the house, using HomeKit automations, I can set the action in homekit to turn off a specific AC unit. What happens is that when I am in homekit and I test the automation, the automation works and the AC unit turns off. When I actually open the door, homekit sends a request to turn off the AC, however the Sensibo plugin actually sends a command to turn the AC on, which is not the expected behavior.

My actual configuration is:

 "username": "redacted",     "password": "redacted",     "disableFan": true,     "disableDry": true,     "ignoreHomeKitDevices": false,     "enableSyncButton": false,     "syncButtonInAccessory": false,     "enableOccupancySensor": false,     "enableClimateReactSwitch": false,     "enableHistoryStorage": false,     "disableHorizontalSwing": true,     "disableLightSwitch": false,     "externalHumiditySensor": false,     "allowRepeatedCommands": true,     "debug": true,     "platform": "@benwebbbenwebb/homebridge-sensibo-ac.SensiboAC" }

Below are the debug logs:

'Test this automation' button pressed in the HomeKit app on IOS:

[02/06/2024, 20:54:15] [@benwebbbenwebb/homebridge-sensibo-ac.SensiboAC] Upstairs AC -> Setting AC Swing: SWING_DISABLED [02/06/2024, 20:54:15] [@benwebbbenwebb/homebridge-sensibo-ac.SensiboAC] Upstairs AC -> Setting Mode to HEAT [02/06/2024, 20:54:15] [@benwebbbenwebb/homebridge-sensibo-ac.SensiboAC] Upstairs AC -> Setting AC Rotation Speed: 25% [02/06/2024, 20:54:15] [@benwebbbenwebb/homebridge-sensibo-ac.SensiboAC] Upstairs AC -> Setting Mode to HEAT [02/06/2024, 20:54:15] [@benwebbbenwebb/homebridge-sensibo-ac.SensiboAC] Upstairs AC -> Setting Cooling Threshold Temperature: 22ºC [02/06/2024, 20:54:15] [@benwebbbenwebb/homebridge-sensibo-ac.SensiboAC] Upstairs AC -> Setting Mode to: HEAT [02/06/2024, 20:54:15] [@benwebbbenwebb/homebridge-sensibo-ac.SensiboAC] Upstairs AC -> Setting Target HeaterCooler State: HEAT [02/06/2024, 20:54:15] [@benwebbbenwebb/homebridge-sensibo-ac.SensiboAC] Upstairs AC -> Setting Heating Threshold Temperature: 22ºC [02/06/2024, 20:54:15] [@benwebbbenwebb/homebridge-sensibo-ac.SensiboAC] Upstairs AC -> Setting Mode to: HEAT [02/06/2024, 20:54:15] [@benwebbbenwebb/homebridge-sensibo-ac.SensiboAC] Upstairs AC -> Setting AC state Active: false [02/06/2024, 20:54:16] [@benwebbbenwebb/homebridge-sensibo-ac.SensiboAC] Upstairs AC -> Setting New State: [02/06/2024, 20:54:16] [@benwebbbenwebb/homebridge-sensibo-ac.SensiboAC] { "on": false, <-- Here you can see that the 'AC on' state is set to false when I test the automation in the homekit app, which is the correct behavior. "mode": "heat", "temperatureUnit": "C", "targetTemperature": 22, "swing": "stopped", "fanLevel": "quiet" } [02/06/2024, 20:54:16] [@benwebbbenwebb/homebridge-sensibo-ac.SensiboAC] Creating POST request to Sensibo API ---> [02/06/2024, 20:54:16] [@benwebbbenwebb/homebridge-sensibo-ac.SensiboAC] https://home.sensibo.com/api/v2/pods/B6nSYaaV/acStates [02/06/2024, 20:54:16] [@benwebbbenwebb/homebridge-sensibo-ac.SensiboAC] data: {"acState":{"on":false,"mode":"heat","temperatureUnit":"C","targetTemperature":22,"swing":"stopped","fanLevel":"quiet"}} [02/06/2024, 20:54:18] [@benwebbbenwebb/homebridge-sensibo-ac.SensiboAC] Successful POST response: [02/06/2024, 20:54:18] [@benwebbbenwebb/homebridge-sensibo-ac.SensiboAC] {"status":"success","result":{"id":"redacted","time":{"time":"2024-06-02T08:54:17Z","secondsAgo":0},"status":"Success","acState":{"timestamp":{"time":"2024-06-02T08:54:18.152475Z","secondsAgo":-1},"on":false,"mode":"heat","targetTemperature":22,"temperatureUnit":"C","fanLevel":"quiet","swing":"stopped"},"changedProperties":["on"],"reason":"Homebridge","failureReason":null}} [02/06/2024, 20:54:18] [@benwebbbenwebb/homebridge-sensibo-ac.SensiboAC] Upstairs - Updated 'CurrentTemperature' for HeaterCoolerService with NEW VALUE: 18.2 [02/06/2024, 20:54:18] [@benwebbbenwebb/homebridge-sensibo-ac.SensiboAC] Upstairs - Updated 'CurrentHeaterCoolerState' for HeaterCoolerService with NEW VALUE: 0

Actually open the door, which should trigger the AC unit to turn off:

[02/06/2024, 20:56:14] [@benwebbbenwebb/homebridge-sensibo-ac.SensiboAC] Upstairs AC (GET) - Target HeaterCooler State is: HEAT [02/06/2024, 20:56:14] [@benwebbbenwebb/homebridge-sensibo-ac.SensiboAC] Upstairs AC (GET) - AC Rotation Speed is: 25% [02/06/2024, 20:56:14] [@benwebbbenwebb/homebridge-sensibo-ac.SensiboAC] Upstairs AC (GET) - AC Swing is: SWING_DISABLED [02/06/2024, 20:56:14] [@benwebbbenwebb/homebridge-sensibo-ac.SensiboAC] Upstairs AC (GET) - Target Cooling Temperature is: 22ºC [02/06/2024, 20:56:14] [@benwebbbenwebb/homebridge-sensibo-ac.SensiboAC] Upstairs AC (GET) - AC Active State: true [02/06/2024, 20:56:14] [@benwebbbenwebb/homebridge-sensibo-ac.SensiboAC] Upstairs AC (GET) - Target Heating Temperature is: 22ºC [02/06/2024, 20:56:15] [@benwebbbenwebb/homebridge-sensibo-ac.SensiboAC] Upstairs AC -> Setting Target HeaterCooler State: HEAT [02/06/2024, 20:56:15] [@benwebbbenwebb/homebridge-sensibo-ac.SensiboAC] Upstairs AC -> Setting AC Rotation Speed: 25% [02/06/2024, 20:56:15] [@benwebbbenwebb/homebridge-sensibo-ac.SensiboAC] Upstairs AC -> Setting Mode to HEAT [02/06/2024, 20:56:15] [@benwebbbenwebb/homebridge-sensibo-ac.SensiboAC] Upstairs AC -> Setting AC Swing: SWING_DISABLED [02/06/2024, 20:56:15] [@benwebbbenwebb/homebridge-sensibo-ac.SensiboAC] Upstairs AC -> Setting Mode to HEAT [02/06/2024, 20:56:15] [@benwebbbenwebb/homebridge-sensibo-ac.SensiboAC] Upstairs AC -> Setting Cooling Threshold Temperature: 22ºC [02/06/2024, 20:56:15] [@benwebbbenwebb/homebridge-sensibo-ac.SensiboAC] Upstairs AC -> Setting Mode to: HEAT [02/06/2024, 20:56:15] [@benwebbbenwebb/homebridge-sensibo-ac.SensiboAC] Upstairs AC -> Setting AC state Active: false <-- It looks like that the AC status should be set to false, ie turn it off [02/06/2024, 20:56:15] [@benwebbbenwebb/homebridge-sensibo-ac.SensiboAC] Upstairs AC -> Setting Heating Threshold Temperature: 22ºC [02/06/2024, 20:56:15] [@benwebbbenwebb/homebridge-sensibo-ac.SensiboAC] Upstairs AC -> Setting Mode to: HEAT [02/06/2024, 20:56:16] [@benwebbbenwebb/homebridge-sensibo-ac.SensiboAC] Upstairs AC -> Setting New State: [02/06/2024, 20:56:16] [@benwebbbenwebb/homebridge-sensibo-ac.SensiboAC] { "on": true, <-- Here the AC state is set to on=true, which is incorrect. It should set it to "on": false. "mode": "heat", "temperatureUnit": "C", "targetTemperature": 22, "swing": "stopped", "fanLevel": "quiet" } [02/06/2024, 20:56:16] [@benwebbbenwebb/homebridge-sensibo-ac.SensiboAC] Creating POST request to Sensibo API ---> [02/06/2024, 20:56:16] [@benwebbbenwebb/homebridge-sensibo-ac.SensiboAC] https://home.sensibo.com/api/v2/pods/B6nSYaaV/acStates [02/06/2024, 20:56:16] [@benwebbbenwebb/homebridge-sensibo-ac.SensiboAC] data: {"acState":{"on":true,"mode":"heat","temperatureUnit":"C","targetTemperature":22,"swing":"stopped","fanLevel":"quiet"}} <-- Once again, AC state is set to on=true, which is incorrect [02/06/2024, 20:56:18] [@benwebbbenwebb/homebridge-sensibo-ac.SensiboAC] Successful POST response: [02/06/2024, 20:56:18] [@benwebbbenwebb/homebridge-sensibo-ac.SensiboAC] {"status":"success","result":{"id":"redacted","time":{"time":"2024-06-02T08:56:17Z","secondsAgo":0},"status":"Success","acState":{"timestamp":{"time":"2024-06-02T08:56:17.840024Z","secondsAgo":0},"on":true,"mode":"heat","targetTemperature":22,"temperatureUnit":"C","fanLevel":"quiet","swing":"stopped"},"changedProperties":[],"reason":"Homebridge","failureReason":null}} [02/06/2024, 20:56:18] [@benwebbbenwebb/homebridge-sensibo-ac.SensiboAC] Upstairs - Updated 'CurrentTemperature' for HeaterCoolerService with NEW VALUE: 18.2 [02/06/2024, 20:56:18] [@benwebbbenwebb/homebridge-sensibo-ac.SensiboAC] Upstairs - Updated 'Active' for HeaterCoolerService with NEW VALUE: 1

Any insights would be much appreciated. Note that I am running version 2.3.4 of the Sensibo homebridge plugin.

pvanamst commented 4 months ago

I also upgraded to the latest alpha release 2.5.0-alpha.3 and unfortunately the 'Test this automation' button now also leaves the AC turned on, instead of turning it off, which is what HomeKit is asking it to do. Below are the debug logs:

[02/06/2024, 22:33:39] [SensiboAC] Upstairs AC (SET) - Target Cooling Temperature: 22ºC [02/06/2024, 22:33:39] [SensiboAC] StateHandler SET Property: targetTemperature [02/06/2024, 22:33:39] [SensiboAC] StateHandler SET New Value: 22 [02/06/2024, 22:33:39] [SensiboAC] Upstairs AC - updating setProcessing to true, Prop: targetTemperature [02/06/2024, 22:33:39] [SensiboAC] Upstairs AC (SET) - Target HeaterCooler State: HEAT [02/06/2024, 22:33:39] [SensiboAC] StateHandler SET Property: active [02/06/2024, 22:33:39] [SensiboAC] StateHandler SET New Value: true [02/06/2024, 22:33:39] [SensiboAC] Upstairs AC - updating setProcessing to true, Prop: active [02/06/2024, 22:33:39] [SensiboAC] StateHandler SET Property: mode [02/06/2024, 22:33:39] [SensiboAC] StateHandler SET New Value: "HEAT" [02/06/2024, 22:33:39] [SensiboAC] Upstairs AC - updating setProcessing to true, Prop: mode [02/06/2024, 22:33:39] [SensiboAC] Upstairs AC (SET) - AC Rotation Speed: 25% [02/06/2024, 22:33:39] [SensiboAC] StateHandler SET Property: fanSpeed [02/06/2024, 22:33:39] [SensiboAC] StateHandler SET New Value: 25 [02/06/2024, 22:33:39] [SensiboAC] Upstairs AC - updating setProcessing to true, Prop: fanSpeed [02/06/2024, 22:33:39] [SensiboAC] Upstairs AC (SET) - HeaterCooler State: HEAT [02/06/2024, 22:33:39] [SensiboAC] StateHandler SET Property: active [02/06/2024, 22:33:39] [SensiboAC] StateHandler SET New Value: true [02/06/2024, 22:33:39] [SensiboAC] Upstairs AC - updating setProcessing to true, Prop: active [02/06/2024, 22:33:39] [SensiboAC] StateHandler SET Property: mode [02/06/2024, 22:33:39] [SensiboAC] StateHandler SET New Value: "HEAT" [02/06/2024, 22:33:39] [SensiboAC] Upstairs AC - updating setProcessing to true, Prop: mode [02/06/2024, 22:33:39] [SensiboAC] Upstairs AC (SET) - Target Heating Temperature: 22ºC [02/06/2024, 22:33:39] [SensiboAC] StateHandler SET Property: targetTemperature [02/06/2024, 22:33:39] [SensiboAC] StateHandler SET New Value: 22 [02/06/2024, 22:33:39] [SensiboAC] Upstairs AC - updating setProcessing to true, Prop: targetTemperature [02/06/2024, 22:33:39] [SensiboAC] Upstairs AC (SET) - HeaterCooler State: HEAT [02/06/2024, 22:33:39] [SensiboAC] StateHandler SET Property: active [02/06/2024, 22:33:39] [SensiboAC] StateHandler SET New Value: true [02/06/2024, 22:33:39] [SensiboAC] Upstairs AC - updating setProcessing to true, Prop: active [02/06/2024, 22:33:39] [SensiboAC] StateHandler SET Property: mode [02/06/2024, 22:33:39] [SensiboAC] StateHandler SET New Value: "HEAT" [02/06/2024, 22:33:39] [SensiboAC] Upstairs AC - updating setProcessing to true, Prop: mode [02/06/2024, 22:33:39] [SensiboAC] Upstairs AC (SET) - Target HeaterCooler State: HEAT [02/06/2024, 22:33:39] [SensiboAC] StateHandler SET Property: mode [02/06/2024, 22:33:39] [SensiboAC] StateHandler SET New Value: "HEAT" [02/06/2024, 22:33:39] [SensiboAC] Upstairs AC - updating setProcessing to true, Prop: mode [02/06/2024, 22:33:39] [SensiboAC] StateHandler SET Property: active [02/06/2024, 22:33:39] [SensiboAC] StateHandler SET New Value: true [02/06/2024, 22:33:39] [SensiboAC] Upstairs AC - updating setProcessing to true, Prop: active [02/06/2024, 22:33:39] [SensiboAC] Upstairs AC (SET) - AC Active State: false [02/06/2024, 22:33:39] [SensiboAC] StateHandler SET Property: active [02/06/2024, 22:33:39] [SensiboAC] StateHandler SET New Value: false <<- Here the state is set to false [02/06/2024, 22:33:39] [SensiboAC] Upstairs AC - updating setProcessing to true, Prop: active [02/06/2024, 22:33:39] [SensiboAC] Upstairs AC (SET) - AC Swing: SWING_DISABLED [02/06/2024, 22:33:39] [SensiboAC] StateHandler SET Property: verticalSwing [02/06/2024, 22:33:39] [SensiboAC] StateHandler SET New Value: "SWING_DISABLED" [02/06/2024, 22:33:39] [SensiboAC] Upstairs AC - updating setProcessing to true, Prop: verticalSwing [02/06/2024, 22:33:39] [SensiboAC] Upstairs AC (SET) - HeaterCooler State: HEAT [02/06/2024, 22:33:39] [SensiboAC] StateHandler SET Property: active [02/06/2024, 22:33:39] [SensiboAC] StateHandler SET New Value: true [02/06/2024, 22:33:39] [SensiboAC] Upstairs AC - updating setProcessing to true, Prop: active [02/06/2024, 22:33:39] [SensiboAC] StateHandler SET Property: mode [02/06/2024, 22:33:39] [SensiboAC] StateHandler SET New Value: "HEAT" [02/06/2024, 22:33:39] [SensiboAC] Upstairs AC - updating setProcessing to true, Prop: mode [02/06/2024, 22:33:40] [SensiboAC] Upstairs AC -> sensiboFormattedACState start [02/06/2024, 22:33:40] [SensiboAC] Upstairs AC - before calling API to set new state [02/06/2024, 22:33:40] [SensiboAC] Creating POST request to Sensibo API -> [02/06/2024, 22:33:40] [SensiboAC] https://home.sensibo.com/api/v2/pods/B6nSYaaV/acStates [02/06/2024, 22:33:40] [SensiboAC] data: { "acState": { "on": true, <-- Here the AC state is set to true, where as it should be set to false. "mode": "heat", "temperatureUnit": "C", "targetTemperature": 22, "swing": "stopped", "fanLevel": "quiet" } } [02/06/2024, 22:33:42] [SensiboAC] Successful POST response: [02/06/2024, 22:33:42] [SensiboAC] { "status": "success", "result": { "id": "aqFBHag8Aq", "time": { "time": "2024-06-02T10:33:41Z", "secondsAgo": 0 }, "status": "Success", "acState": { "timestamp": { "time": "2024-06-02T10:33:42.085337Z", "secondsAgo": -1 }, "on": true, <-- Given that the AC was asked to turn on (which it already was), the response states that it is on. "mode": "heat", "targetTemperature": 22, "temperatureUnit": "C", "fanLevel": "quiet", "swing": "stopped" }, "changedProperties": [], "reason": "Homebridge", "failureReason": null } }

benwebbbenwebb commented 4 months ago

Hi @pvanamst

I’m away at the moment so won’t be able to take a proper look for a few days, but at first glance it looks like the automation is setting multiple properties (rather than just active true/false)…

Currently if you set a mode (in your example Heat), that also turns the unit on (if it is off) so that in the Home app you don’t have to do two separate requests.

Can you update your automation so that it only turns the unit off, rather than setting mode, temperature, swing etc?

pvanamst commented 4 months ago

@benwebbbenwebb , thanks for the prompt feedback. In the IOS home app, when you set the AC unit to 'Off' the fan speed in the UI is set also to 0, ie off. There is no option to select heat, cool or auto when you turn the AC unit off.

To reproduce this issue, please select: 1 - In the IOS Home app, select Accessory settings under the AC unit, add automation 2 - Under events, select 'A sensor detects something'. I then select the alarm system door sensor and press 'Next' 3 - Select When the 'Door sensor' opens and press 'Next' and select the 'Upstairs AC' unit 4 - Select the Upstairs AC unit and select to turn it off and press the 'Done' key.

I also see in the debug logs that heat is being selected whilst the AC unit is asked to turn off. I'm not sure if this request comes from the Homekit automation, or if the Sensibo plugin is selecting the 'heat' option.

I really appreciate you looking into this.

benwebbbenwebb commented 3 months ago

Hi @pvanamst

I appreciate your patience. Are you still experiencing issues?

A new version of the plugin, v2.5.0, has been released (though I don't expect the changes included would improve your issue unfortunately).

pvanamst commented 3 months ago

Ben, thanks for the feedback. Unfortunately I was on a tight deadline to get it working, so I went with a scrypted plugin instead. I hope you can look into this for other users however. Paul Sent from my iPhoneOn Jul 5, 2024, at 00:02, Ben @.***> wrote: Hi @pvanamst I appreciate your patience. Are you still experiencing issues? A new version of the plugin, v2.5.0, has been released (though I don't expect the changes included would improve your issue unfortunately).

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you were mentioned.Message ID: @.***>