Skip to content

Feature Request - Working with the HomeKit Integration #46

@jvmahon

Description

@jvmahon

I have a feature enhancement suggestion (and proposed implementation method with nodejs code example) to better support bridging shades controlled by this plugin to iOS Home.

The issue:
I'm using this plugin to control shades with the "bf" motor type, which does not support an absolute position. In the HomeSeer interface, I can see both a positional slider interface to control the shades (i.e., position mode), as well as up / down button controls (button mode). If I use the positional mode sliders, they do nothing, but if I use the up/down buttons, all works as expected.

I'd like to be able to export these shades from HomeSeer to iOS Home using HomeSeer's built-in HomeKit Bridge integration. The problem is that the HomeKit environment only supports shades allowing positional control, so it currently can't be done.

Proposed Solution
Before I was using HomeAssistant, I used Hubitat and had a similar issue. For Hubitat, I wrote a homebridge plugin that solved this in a simple way. Instead of having a "do nothing" positional slider, the slider code was set to have 3 positions (you could slide to anywhere in iOS home, but only 3 positions had a real meaning). Normally, the slider is at 50% and this is what you see in iOS Home. I chose this because with the "bf" motor type, you can't really tell where the shade really is, so 50% allows the iOS Home user to either slide to open or slide to close. If the user then slides the slider up to 100%, this triggers an open and the slider stays in the 100% position for a few seconds, but then reverts back to 50%. Similarly, if you slide down to 0% the slide closes, but the positional indicator goes back to 50% after a bit. If you slide to anything but 0 or 100%, the positional indictor returns to 50% with nothing happening..

Here's the code that I used for Homebridge and the Hubitat environment: https://github.com/jvmahon/homebridge-smartshades

If you look in the index.js file, at lines 118-153 you can see the implementation. The "on('set'..." at line 119 gets called when the iOS user moves the shade position slider. If the position goes to 0 (close), the case at line 121 is called, and the shade gets commanded to close (line 122). The position slider will then be shown at 0% in iOS, but a timeout is then set (line 123-126) that returns the iOS position indicator to 50% after a 25 second delay (line 126).

Opening the shade is similar (see lines 138-145).

Could some similar logic be added to his integration so that HomeAssistant's interface's positional slider becomes functional and, thus, allows its export to HomeKit via the HomeKit integration? I'd try adding it myself, but I'm relatively new to HomeAssistant and don't (yet) know Python or the device model well enough to program it.

Thanks for considering this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions