Weird issue - SwitchBot Blind Tilt

Okay so here’s the deal:

SwitchBot Blind Tilt Bluetooth Integration → Home Assistant → HomeKit Bridge

It works great in the SwitchBot app (updated to latest firmware here), it works great in Home Assistant however, in Apple Home, it works as expected in the settings page for the device in Apple Home, but not in the actual device page in Apple Home itself…

So it works when adjusting here perfectly fine, and as you’d expect:

But on this page, it never moves, no matter how you adjust the blind, the graphic just immediately snaps back to closed at the bottom. It never moves, it never updates, unlike in the settings page above, where it works great:

I have it export with the HomeKit Bridge integration in Home Assistant, with it set to ‘Accessory’ and ‘Include - Cover’ (set to the Left Blind device in HA).

I’ve tried:

  • force closing the Apple Home app
  • restarting the HomeKit Bridge integration
  • rebooting Home Assistant entirely

If it didn’t work at all in Apple Home, I’d be less perplexed, but working on the settings page for the device, and not the main page for the device? What’s the difference between the two here that’s causing it to not work on one, where it works perfectly on the other?

Your help is appreciated!

Did you ever get this resolved? I have the same weird issue.

Sadly not, no.

I’ve rebooted HA since, still no joy. There’s obviously a difference between the device view, and settings view for the device in the Apple Home app, I’m just not smart enough to know what it is, to work out how to fix it.

I’ve tried changing the “show as” type to various options to no avail. I’ve tried blind/shade/shutter/etc. This has worked previously when exporting the Konnected GDO blaQ to HomeKit which won’t work properly until you change the “show as” type to ‘Garage Door’.

I’m hoping those with more knowledge of Homekit Bridge can chime in. I wonder if Homebridge also has this issue.

Did you by any chance work this out? :smiley:

Still having the same issue and I’m pretty much up to date on everything. Tried deleting the homekit bridge accessory and creating a new one, but still no luck.

I found a working solution after digging a little into how HomeKit handles cover devices. SwitchBot Blind Tilt devices only report current_tilt_position (no current_position), but HomeKit apparently expects covers to have both position and tilt characteristics.

I debugged a bit on my Mac and found that when HA’s HomeKit bridge exposes a tilt-only cover, it results in a malformed HomeKit accessory. When using the tile (or whatever it’s called) to adjust the tilt, homed throws errors about tile rendering and an error that I assume is HomeKit trying to get current_position. Though the logs didn’t contain enough info to confirm.

The fix is wrapping it in a template cover that maps tilt to position. An example of one called “Blind Tilt Left” (adjust the name and entity as needed for your setup):

template:
  - cover:
      - name: "Blind Tilt Left HomeKit"
        unique_id: blind_tilt_left_homekit
        device_class: blind
        open_cover:
          service: cover.open_cover_tilt
          target:
            entity_id: cover.blind_tilt_left
        close_cover:
          service: cover.close_cover_tilt
          target:
            entity_id: cover.blind_tilt_left
        stop_cover:
          service: cover.stop_cover_tilt
          target:
            entity_id: cover.blind_tilt_left
        set_cover_position:
          service: cover.set_cover_tilt_position
          data:
            tilt_position: "{{ position }}"
          target:
            entity_id: cover.blind_tilt_left
        set_cover_tilt_position:
          service: cover.set_cover_tilt_position
          data:
            tilt_position: "{{ tilt }}"
          target:
            entity_id: cover.blind_tilt_left
        position: "{{ state_attr('cover.blind_tilt_left', 'current_tilt_position') }}"
        tilt: "{{ state_attr('cover.blind_tilt_left', 'current_tilt_position') }}"

Add this to the top level of your HA configuration.yaml and restart HA. Then:

  1. In your HA HomeKit Bridge configuration, exclude or remove the original cover.blind_tilt_left from HomeKit
  2. Include the new cover.blind_tilt_left_homekit instead
  3. Restart HA again to apply the HomeKit changes (you might be able to just reload the integration, I forgot exactly what I did)
  4. Apple Home should show the new accessory rather than the old one, and it should work now

Note that status updates from the device seem to be a bit slower than you might be used to from some lights and other devices.

This might be considered a bug in the HA HomeKit integration, because it looks like it needs to add this mapping if position is missing.

2 Likes

@hammertime this is great - I have exactly this issue! The one gotcha in your template is when you click the “open” button in HomeKit, rather than open the blind to midpoint / 50 percent tilt, it essentially closes it fully upward. Did you modify further so that “open” was actually 50% tilt?

1 Like

I messed around extensively this evening and now have a working template. I specifically wanted to replace the slider as this would just cause confusion to my family. The below will give you a working open / close tilt blind when you push the button in HomeKit.

  - cover:
      - unique_id: office_blind_homekit
        name: Office Blind (Homekit)
        device_class: blind

        open_cover:
          service: cover.set_cover_tilt_position
          target:
            entity_id: cover.office_blind
          data:
            tilt_position: 50

        close_cover:
          service: cover.set_cover_tilt_position
          target:
            entity_id: cover.office_blind
          data:
            tilt_position: 0

        stop_cover:
          service: cover.stop_cover_tilt
          target:
            entity_id: cover.office_blind

        set_cover_position:
          service: cover.set_cover_tilt_position
          target:
            entity_id: cover.office_blind
          data:
            tilt_position: >-
              {% if position | int >= 100 %}
                50
              {% else %}
                0
              {% endif %}

        position: >-
          {% if (state_attr('cover.office_blind', 'current_tilt_position') | int(0)) >= 50 %}
            100
          {% else %}
            0
          {% endif %}

        state: >-
          {% if (state_attr('cover.office_blind', 'current_tilt_position') | int(0)) > 0 %}
            open
          {% else %}
            closed
          {% endif %}
1 Like

You guys are insanely awesome. First off, @hammertime comes from outta nowhere, first ever post on this forum and BOOM, finds the root cause of the issue, and provides a solution.

Then, @shellprompt , having not posted on here for a year, comes in and refines things even further.

Amazing stuff! I have tried the template, and seems to be somewhat working now in Apple Home, though I have some issues with behavior trying both versions of the template.

For me, the native Switchbot integration into Home Assistant, when set to 100% (slider all the way up in HA), the slats are facing up (“Closed up” in the SwitchBot app).

When set to 0% (slider all the way down in HA), the slats are facing down (“Closed down” in the SwitchBot app).

With the new template method, the slider in Apple Home “works”, as in, it’ll now move the tilt on the blinds, but the actual UI of the slider glitches, and it never really shows the current position.

Instructing the blinds to close in Apple Home always seems to “Close Down”, not sure if there is a way to change this behaviour? I thought I could understand and rewrite the YAML in either template, but I failed miserably!

I’ve also noticed that instructing the blinds through Apple Home somehow seems to ignore the soft calibration limits set on the devices, and it will strain at either maximum (closed all the way up or closed all the way down), until I think the SwitchBot Blind Tilt itself cuts out due to detecting the motor load spiking for too long.

It is great to be able to be able to ask Siri to close/open the blinds finally though!

Not sure who to report the potential HA HomeKit Bridge bug too? Would be good to have this native, rather than creating an additional template/device for each of the blinds? Doing some digging, I think @bdraco is the code owner for HomeKit Bridge, is there a way to fix this: