Multi-state-switch disable 1 or more positions

@BartButenaers Is it possible to disable 1 or more positions of the multi-state-switch somehow?

May I ask what will be the real life use case of this feature?

@hotNipi I intend to make a "standard" switch for multiple similar devices. The switch has 3 positions off-on-auto, under some conditions I want to disable the auto-position. Under some other conditions I want to disable the whole switch, but that's not so hard. You see my dilemma?

If you don't know if it's possible, maybe you know some alternative solution?

Technically it should be possible to make. Quite of things to figure out how it should look and behave ..
I can't see any workarounds or hacks to achieve this with current solution.

But at first we need to wait for @BartButenaers to decide ..

Hi guys,

It sounds indeed like a plauzible use case. Unfortunately I have to admit that at the moment I don't have time anymore for such kind of implementations :frowning_face:. If @hotNipi has time for this, then please be my guest!! Otherwise it will stay like it is...

Sorry!
Bart

Design questions may barely fit into my quite tight schedule but not more for pesent and near future.

1 Like

@hotNipi @BartButenaers Thanks guys for your reactions. I understand you're all busy, and it is not such hot item for me, just thought it was maybe easily possible somehow. I make use of multi state switch a lot, because I like it, and easy to use.

I already thought of another angle with on-off switch and then next with button manual/auto.

Just one question left for me. Now it is possible to change background color of the multi-state switch, is it also possible to change the font color somehow, because if you choose light background, you need dark font color. Never mind if that is also troublesome.

Using the good old CSS override technique

<style>
    .multistate-switch-label{
        color:red;
    }
    .multistate-switch-button{
        color:red;
    }
    .multistate-switch-button.light{
        color:white;
    }
    .multistate-switch-button.dark{
        color:black;
    }
</style>

The color choice of the button which is currently active is controlled by the internal logic which then adds the light or dark class to that button. As you see in the CSS above, you can override the colors but you can't override when one or another is used.

1 Like

@hotNipi Thanks very much, that was very helpful. It is almost perfect!
The only thing I would like more if possible, is to change the border color of the switch, then it will be 100% perfect!!!

No problem :slight_smile:

<style>
    .multistate-switch-wrapper{
        border-color:red;
    }    
    .multistate-switch-label{
        color:red;
    }
    .multistate-switch-button{
        color:red;
    }
    .multistate-switch-button.light{
        color:white;
    }
    .multistate-switch-button.dark{
        color:black;
    }
</style>
2 Likes

@hotNipi I am sorry to report, that doesn't seem to work.:frowning:

Works fine for me.. Find element by inspecting it with browser dev tools and see if your adjustment exists in applied styles and find the reason why there is no effect.

@hotNipi Yes, sorry did something stupid in my style sheet.
Learned a lot by inspecting the web-browser!
Works great now. Thanks again!!!

@hotnip: thanks for supporting Henk with his question!!

@henkkas: could you please share here how it looks like, to make sure other people can boost their creativity and use it in their own setup.

1 Like

@BartButenaers and @hotNipi Sure I can. Hereby the new outlook.
afbeelding

If you push the "Meer"-button, the options become visible. That is timed auto-switching and auto-switching on export power.

It is the control of a Tasmota powerplug.
The basic flow I already published before.

https://flows.nodered.org/flow/47e0e1ba234753f4d218438341ef41c7

By the way, it would be a nice improvement on the multi-state-switch, if you cannot only change background color, but also text color and border color.

4 Likes

Oh that looks nice. Love the colour scheme you have used.

@dynamicdave Really? Not everybody agrees on that!!

I made navigation buttons green and "action"-buttons greenYellow. Until now I didn't use multi-state switch for actions, only buttons. But I love the multi-state-switch, and here it comes in handy, and looks good to me :slight_smile:

1 Like

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