[APP][Cloud & Pro] SwitchBot (Release 2.0.35, Test 2.0.49)

Hi @robertklep & @Adrian_Rockall, thanks for your help regarding to this homekit support issue. I think the homekit can simply support the button with on/off capability. In Homey, now the user is already able to build a trigger or do an action based toggle on/off. This is good enough.

For AC remote, personally I got a sensibo sky, it has similar function like switchbot hub acting as IR controller to control another air-coniditioner in my living room. In Homekit, it has been identified as thermal control devices. Not sure if this idea can be replicated to Switchbot IR controlled devices (e.g. air-con)

Since it’s a button presser, how does it keep track of the current state? Does the switchbot device track that, it is it just a state that you maintain within the app?

The device tracks it and can return it’s state when asked. If the connection is via BLE then I get that information in the advertised service data from the device, so I know it is the device that tracks it and it therefore update even when the Bot is operated by another source.
I am also wondering if I should change it to a “socket” class as then the user could specify what is plugged in (e.g. what it operates)?

For the AC, I could possibly change the class to “fan” or “heater” if either of those are supported by Homekit .

I need to clarify that the bot has two operational modes. It can simulate a simple button where it moves down and then back up as one operation. In that mode it does not track state. The other mode is an On / Off device where the arm moves up or down and then stops in that position. It knows the state in this mode.
So maybe when I detect the Bot is in push button mode, I set the class to “button” and when it is in switch mode I set the class to “socket”.

Fan’s are supported (onoff and dim for fan speed), heaters aren’t because there didn’t used to be a compatible HomeKit “service” (but there is now, so I might look into supporting them).

OK, so I could set the class to “fan” and it would then show the on / off in HomeKit. Unfortunately, the fan speeds supported by SwichBot are just “1” to “4” where:
“1” = ‘Auto’,
“2” = ‘Low’,
“3” = 'Medium,
“4” = ‘High’.
So the custom capability is an enum.

If I make the speed a ‘dim’ with a min of 2, max of 4 and a step of 1, would HomeKt read those and know there are just 3 positions?
Then could I add an on/off for Auto that HomeKit would understand?
Or, I could maybe add the ‘dim’ capability with no UI and then map the values specifically for HomeKit so the lowest setting is Auto and then goes to 1, 2 , 3 and 4?
Homey would still present the custom enum to the user, which I would synchronise with the ‘dim’ capability.

I have now updated the Bot class based on the mode it is set to, so it will be either ‘button’ for the quick press mode and ‘socket’ for the on / off mode. When it is added via BLE I can do this automatically as the mode is returned in the device data. Unfortunately, the API doesn’t provide that information so it is done via a device setting.

HomeyKit expects the value to be between 0 and 1, so no custom start/end values.

What about step size, can I specify that?

Edit: If I set the step to 0.25 would it provide just 4 positions?

HomeyKit will receive continuous values from iOS and set the dim capability accordingly (after some scaling). I don’t know how Homey will behave if an app programmatically sets a capability value that doesn’t match the configured step size, do you?

I have just realised that I have got myself confused with the Humidifier. The AC has separate On and Off capabilities as the state is not know. I even put in my post above :flushed:. So I don’t think it will work as a ‘fan’ anyway.

So, if I set the class to ‘other’ will HomeKit pick up the “power_on” and “power_off”, which are custom ‘button’ capabilities?
And will then it pick up the enum capability?

I could also change the fan speed to individual buttons for “Fan Auto”, “Fan Low”, etc if that would work better for HomeKit.

Also, if the class is set to ‘other’ would it recognise the “target_temperature” capability?

HomeyKit does not support any custom capabilities, regardless of device class. It also doesn’t support target_temperature for other, only for the thermostat class.

OK, so I think I have run out of options for the AC.
Thanks for your advice, it is much appreciated.

I have published a new test version where the bot class is set to ‘socket’ when the Bot is set to the switch mode. You will need to view the Advanced settings for the device and change the button mode to on, save the settings and then change back to off and save the settings.
Let me know if this allows you to add the Bot to HomeKit.

2 Likes

Hi Adrian,
it would be really cool if there was a way to make the battery level of the bots visible in Homey.

Battery is available via BLE but it isn’t provided by the API.
I have asked for it but no response so far.

1 Like

It’s not particularly important either. It would just be nice to have. But I notice it on my own when the bot no longer switches on my coffee machine :coffee::no_entry_sign::scream:

I have installed 1.1.3 version. Homekit can recognize the button presser with on/off switch capability. I also found the humidifier actually can be recognized in the 1.0.5 version as well with on/off function. (verion 1.1.3 acts as the same). But I think this is good enough as the humidifier would be able to auto-adjust the level under auto mode. Thanks

1 Like

At the moment, it is sufficient if you can switch the humidifier on/off. The temperature, humidity and water alarm data are only updated irregularly when the unit is in operation. There seems to be a bug in the firmware.
I have coupled the on/off switch with an Aqara humidity sensor. Depending on the value of the Aqara, the humidifier is switched to 25,50,75 or 100% power. It is also more accurate not to measure the humidity directly on the unit.
Screenshot_20220326-193305_Homey

1 Like

Hello, for over a month (i think it started after a firmware update of the bots) my curtains stopped working via your app in homey. So i tried to reinstall them but your app wont find them BLE, only HUB. But im not using a hub, using the homey. In the switchbot app they work fine. When i add the bots in homey as hub i get the error msg ‘device’s cloud service not enabled’, which i cant enable because im not using a switchbot hub. I’ve seen more people reporting this but found no solution. Is there one yet?

Are you using the test version of the app?
That has a fix for the last bot update that changed the format of the BLE data.

2 Likes