HASS Shades Custom Tile Updates

Just one related question. When I change the position from another app or the wall switch, the slider on the dashboard doesn’t change the position. Is there a workaround?

It wouldn’t be a problem if it’s only used via the Sharptools, but I have the automation in the HASS which move the blinds.

When I was originally testing the tweaks to the Vertical Range Input slider I ran into a similar issue.

Your HASS Install

What type of HASS installation are you running (eg. HA OS or Container)? More specifically, is the SharpTools integration running as a Home Assistant Add-on or is it running as its own container?

From the SharpTools Add-on, can you tap the Diagnostics link next to the version number on the home screen of the add-on, then download the diagnostics with at least the SharpTools Addon Settings box checked?

Feel free to send the result to support and I can take a look for you – alternatively, read on if you’re interested in reviewing the file yourself.

My Experience (State Subscription)

When I took a closer look at the event subscriptions that were setup in my SharpTools HASS Add-on I realized the event subscription somehow was messed up and it was trying to subscribe to the general state of the shade (open/closed) for the currentPosition.

Under the addonSettingsstioEntitySubscription it was originally something like:

:cross_mark: WRONG

"cover.virtual_shade": {
    "current_position": {    <--- Might have been `state` (can't remember)
        "type": "state",     <--- 🛑 WRONG 🛑 
        "subscribed": true,
        "stioAttributes": [
            "currentPosition"
        ]
    }
}

:white_check_mark: CORRECT

"cover.virtual_shade": {
    "current_position": {
        "type": "attribute", <--- ✅ CORRECT ✅ 
        "subscribed": true,
        "stioAttributes": [
            "currentPosition"
        ]
    }
}

Subscription Cleanup

Manually Edit settings.json

Since I had access to the filesystem where the add-on was running, I was able to edit the data/settings.json to delete that subscription entry manually and restart the add-on. I was hoping I could reproduce the issue and track down why it happened, but I wasn’t able to reproduce it on further tries.

Diagnostics > Subscriptions > Reset

If you don’t have access to the filesystem where the add-on is running, you could also flip the Advanced toggle on in the top-right corner of the Diagnostic page for the add-on and under Event Subscriptions click the red Reset button.

Note that this approach will delete all of the event subscription settings from the add-on, so you’ll need to then refresh a page where SharpTools is running which will kickoff a background healthcheck which automatically tries to fix any missing event subscriptions.

Interesting outcome - I don’t know what did I do exactly, but now it seems it works. :smiley: I tried many things, but I’m not sure which one did the magic.

1 Like

Even more interesting - the slider position is being updated for some blinds, and for the others it’s not. When I change the “thing” on the same slider and choose another blind, in works. When I change back, it stops working. So I would rather not change any general settings, but I’ll try to dig deeper into those blinds which don’t update the status and try to figure out if there are any differences, even I’m not sure how could it be the case.

EDIT:
When I navigate to my authorized location and check the blind which updates the slider position, I can see that the value really is instantly updated for that blind, and for another blind that value isn’t updated (please refer to the picture). According to the Timestamp, last update was almost a month ago.

After that, I navigated to Diagnostics, Advanced, hit the Reset and now I messed up even devices which were ok before. To be precise, after the reset at some moment the value updated (according to the Timestamp it was 1 hour ago), but now there is no blind which seccessfully updates it’s status instantly.

I also downloaded the DIagnostics data, but I’m not sure how to share it here (it’s the txt file, but too long to just c/p it here.)

HASS installation type is HA OS.

When you use the Diagnostics > Subscriptions > Reset within the add-on, that removes ALL of the event listeners from the local Home Assistant Add-on.

In other words, the Add-on stops listening for changes and thus stops reporting device status updates.

The next step is to kickoff a healthcheck on the SharpTools web-app which will automatically check which subscriptions are missing from your Home Assistant Add-on and will request that the add-on sets those subscriptions back up again.

The healthcheck runs when the SharpTools web app is first loaded, so you can refresh a page showing SharpTools or even close all browser tabs that have SharpTools open, then reopen SharpTools and it should run the healthcheck in the background.

Note that it may take a few minutes for the healthcheck to complete. And if you still aren’t seeing events updating as expected, you can try restarting the add-on in Home Assistant.

If that doesn’t help, feel free to send the diagnostics data in an email to support. I would suggest doing a full diagnostics export with all the boxes checked so we don’t have to go back-and-forth in case we need additional information. :slight_smile:

Thanks to the patience and persistence of @Kresimir_Juric, I was finally able to narrow down the issue that was often causing the currentPosition attribute on Window Shades and similar Home Assistant cover devices to incorrectly get mapped to the state listener on the Home Assistant add-on! :star_struck:

:tada: I’ve pushed an update to the SharpTools platform over the weekend which should resolve this moving forward. :tada:

Thanks again to @Kresimir_Juric for your patience and your help verifying that the update fixed things.

Steps to Apply Fix (for existing issues)

Note that if you already used the currentPosition attribute in a dashboard or rule and it wasn’t working as expected, you will likely need to follow the steps mentioned above to access the Diagnostics page within the SharpTools add-on, toggle Advanced on, then use the Event SubscriptionsReset option. After that, you can refresh a browser page in SharpTools which will kick off the healthcheck in the background to clean things up.

Thanks Josh, the credit is yours, I was just giving the feedback!

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.