[ST Edge] Why does fanSpeed have 4 speeds and can it be modified or mimicked?

The stock fanSpeed capability has 4 speeds. Unfortunately, a large percentage of the population uses commodity 3-speed fan controllers.

According to the associated presentation, fanSpeed displays as a list. However, it’s actually what I would call an enumerated slider. Normally a slider displays a number which has a popup for direct entry. Not this hybrid. I like the slider because it’s compact and uniform. A 2x2 cluster of buttons just doesn’t excite me. A normal slider works OK, but displaying 0 for ‘Off’ is a little nerdy and the popup for direct entry is overkill. A normal popup list works fine, but requires extra presses.

So, ST, is this hardcoded or can we accomplish the same? Can the ‘Max’ be filtered out with “supportedValues”?

While we’re at it, I see no need for a second 0-100 level slider control when there are only 4 (or 5) discrete steps.

I’m not aware of a way to modify it. Most fans are 3 or 4 speeds. I just supported 4 speeds and have High = Max on the 3 speed. This just so happens to be the way my 3 speed fans work anyway if you send them a value higher than their max. I don’t think it’s a big issue.

The capability itself uses an integer and so has an infinite number of speeds. The capability presentation supports four speeds (plus off) but you should be able to override that in the device config with the values key if that floats your boat.

Whether the apps respect the device presentation or prefer to do their own thing is another matter. If it is the latter then all bets are off.

There’s extra customization of the UI for some of the stock capabilities in a layer that we can’t see. Take temperatureMeasurement for example - the history graph and combo display with humidity can’t be explained or replicated with a capability presentation.

You could certainly remove it from the display view, but if you remove it entirely from the profile then I think you’ll lose the ability to control speed from voice assistants.

Correct. I would hide rather than remove. The way things are now, I can see a naïve user expecting the level slider to control the light under the fan. That’s actually something I want to try, but the (second) level slider would be mapped (via driver information sharing) to another physical dimmer switch.

Do you know if there is a way to do this dynamically, or would it need to be defined in the presentation itself?

Would it basically look like this:

        {
            "group": "Fan",
            "component": "main",
            "capability": "fanSpeed",
            "version": 1,
            "values": [{
                    "key": "fanSpeed",
                    "range": [
                        1,
                        8
                    ],
                    "step": 1
                }],
            "patch": []
        }

I don’t think there is a way of doing it dynamically, unless there is a way of reading an attribute value, but all I really know about it is what I’ve read.

1 Like

The fanSpeed capability is technically displayed as a list. If you can modify the enumerated list via device-config and the tick points on the slider scale as expected and the supportedValues filter works, then you can filter what speeds are shown in the list (slider). It’s dynamic in that it can be configured once the driver is running. However, any changes to the filter will not take affect until you leave and reenter detail view. I decided not to wrestle with fanSpeed. I use a normal list with filter. The con is that it’s one more press on the gear icon. The pro is that the user is forced to go directly to the target speed rather than sliding which could result in redundant intermediate actions.

It works partially for me.
The “detailView” will display correctly, 0-3. The automation/routine doesn’t yet, probably UI bug - still show 0-4.

        "values": [
            {
                "key": "fanSpeed",
                "range": [
                    0,
                    3
                ],
                "step": 1
            }
        ],

Follow this -

1 Like

Ah, but what happens if you use 1-8 in the @blueyetisoftware example? There are no enumerated values for 5-8.