Fan Control Speed ENUM dropdown in Dashboard

The Fan Control capability has a supportedFanSpeeds attribute JSON_OBJECT for supportedFanSpeeds - I have modified this to create some different entries. However when I use the 'Fan' template in Dashboard it displays just the original values. :shushing_face: Are these ENUM values hardcoded in the template perhaps ?

image

image

Is there no way to display a dropdown of enumerated values in Dashboard yet? Yoiu can sort of abuse the virtual thermostat to achieve this but having a more generally useful template would be so useful..

image

I've been able to do this in my drivers, let me check...

This is the code I have used, may need to double-check the effect in the dashboard, but I am sure I have seen it work there.... This is from my Unified Thermostat Child driver

def adjustFanModes(pNumberOfFanSpeeds, pHasAutomaticFanSpeed) {
    def fanModes = []
    
    fanModes.add('Off')
    
    //Text or Numbers?
    if (FansTextOrNumbers == true || FansTextOrNumbers == "1") {
        parent.debugLog("adjustFanModes:Text-based Fan Modes")
        if(pNumberOfFanSpeeds.toInteger() == 3) {
            fanModes.add('Low')
            fanModes.add('Medium')
            fanModes.add('High')
        }
        else if(pNumberOfFanSpeeds.toInteger() == 2) {
            fanModes.add('Low')
            fanModes.add('High')
        }
        else
        {
        //if(pNumberOfFanSpeeds.toInteger() == 5) {
            fanModes.add('Low')
            fanModes.add('Medium Low')
            fanModes.add('Medium')
            fanModes.add('Medium High')
            fanModes.add('High')
        }

    }
    else {
        parent.debugLog("adjustFanModes:Number-based Fan Modes")
        if(pNumberOfFanSpeeds.toInteger() == 3) {
            fanModes.add('1')
            fanModes.add('2')
            fanModes.add('3')
        }
        else if(pNumberOfFanSpeeds.toInteger() == 2) {
            fanModes.add('1')
            fanModes.add('2')
        }
        else
        {
        //if(pNumberOfFanSpeeds.toInteger() == 5) {
            fanModes.add('1')
            fanModes.add('2')
            fanModes.add('3')
            fanModes.add('4')
            fanModes.add('5')
        }
    }
    
    if(pHasAutomaticFanSpeed == "true" || pHasAutomaticFanSpeed == "1") {
        fanModes.add('Auto')
    }
    
    fanModes.add('On')
    
    parent.debugLog("adjustFanModes: fanModes detected are ${fanModes}")
    //Apply settings
    sendEvent(name: 'supportedThermostatFanModes', value: fanModes)
}

Ah, thermostat fan modes....Hmmm...

I can sort of get it to work in the thermostat template but that is a little cluttered and has two mode dropdowns. I wanted to use Fan Control because that presents just a single dropdown with the list values in it. I think it is behaving differently to the thermostat template though.

image

^ from the thermostat template

1 Like

I had people wanting to use the fan control as well, I thought I had that working....

Actually, you could be right, it may have been that the systems I was working with had 5 speeds already...

It would seem to be a huge UI omission in Dashboard to not be able to create an enumerated list dropdown tile. I'm sure it should work even if I am (ab)using the fan control template. Or have an attribute template that you could select containing an ENUM

This might be what you are after:

1 Like

That's a spot on topic thanks - I missed it but it just reveals the same shortcoming of the fan template.

Shame... it would be seem so useful (dare I venture ..fundamental)

1 Like

At the end of the topic it appears they were able to get it working.... Or am I missing something still....

I think that 'everything is working now' related to other problems - I don't think a matching displayed fanControl dropdown in Dashboard was ever achievable..

I have implemented the HA MQTT Discovery protocol inside HE meaning that HE can discover devices that advertise their availability using this 'pseudo' standard and (auto) create them in HE. However I have no easy way to add devices that require enumerated control values with dashboard.

1 Like

Yeah, I believe that was just getting the attribute to report correctly on the child device. I still don't think this is really used anywhere useful by default in the UI; an app could certainly read this and do what it wants with the information, but the device page UI doesn't the last time I checked, and Dashboard (an app that certainly could "see" this information and modify things as needed) doesn't, either. They did mention that they are hoping to improve Dashboard in a future release (not necessarily regarding this feature or anything similar), so there is some hope...

(EDIT: I should add that you can manually "override" the command in your driver to make the device page show whatever you want, but this still won't change Dashboard and has no effect on the attribute unless you also modify it as specified, not that any stock app I'm aware of does anything with either of these pieces of information.)

2 Likes

We need to be able to create/code our own templates...

Yes - indeed but not what is needed here

Thanks for clarifying @bertabcd1234

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