# Multi-state-switch disable 1 or more positions

**URL:** <https://discourse.nodered.org/t/multi-state-switch-disable-1-or-more-positions/75179>\
**Category:** Dashboard\
**Created:** [14 February 2023 13:29 UTC](https://discourse.nodered.org/t/multi-state-switch-disable-1-or-more-positions/75179 "2023-02-14T13:29:44Z")\
**Posts on this page:** 18\
**Page:** 1

<div class="post-metadata">

**Author:** ![henkkas](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/henkkas/32/39844_2.png) [@henkkas](https://discourse.nodered.org/u/henkkas)\
**Post date:** [14 February 2023 13:29 UTC](https://discourse.nodered.org/t/multi-state-switch-disable-1-or-more-positions/75179/1 "2023-02-14T13:29:44Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![hotNipi](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/hotnipi/32/383_2.png) [@hotNipi](https://discourse.nodered.org/u/hotNipi)\
**Post date:** [14 February 2023 17:13 UTC](https://discourse.nodered.org/t/multi-state-switch-disable-1-or-more-positions/75179/2 "2023-02-14T17:13:34Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![henkkas](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/henkkas/32/39844_2.png) [@henkkas](https://discourse.nodered.org/u/henkkas)\
**Post date:** [15 February 2023 14:25 UTC](https://discourse.nodered.org/t/multi-state-switch-disable-1-or-more-positions/75179/3 "2023-02-15T14:25:52Z")

</div>

@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?

---

<div class="post-metadata">

**Author:** ![hotNipi](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/hotnipi/32/383_2.png) [@hotNipi](https://discourse.nodered.org/u/hotNipi)\
**Post date:** [15 February 2023 14:35 UTC](https://discourse.nodered.org/t/multi-state-switch-disable-1-or-more-positions/75179/4 "2023-02-15T14:35:43Z")

</div>

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 ..

---

<div class="post-metadata">

**Author:** ![BartButenaers](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bartbutenaers/32/10476_2.png) [@BartButenaers](https://discourse.nodered.org/u/BartButenaers)\
**Post date:** [15 February 2023 17:34 UTC](https://discourse.nodered.org/t/multi-state-switch-disable-1-or-more-positions/75179/5 "2023-02-15T17:34:41Z")

</div>

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 ☹. If @hotNipi has time for this, then please be my guest!! Otherwise it will stay like it is...

Sorry!  
Bart

---

<div class="post-metadata">

**Author:** ![hotNipi](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/hotnipi/32/383_2.png) [@hotNipi](https://discourse.nodered.org/u/hotNipi)\
**Post date:** [15 February 2023 17:50 UTC](https://discourse.nodered.org/t/multi-state-switch-disable-1-or-more-positions/75179/6 "2023-02-15T17:50:31Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![henkkas](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/henkkas/32/39844_2.png) [@henkkas](https://discourse.nodered.org/u/henkkas)\
**Post date:** [16 February 2023 06:37 UTC](https://discourse.nodered.org/t/multi-state-switch-disable-1-or-more-positions/75179/7 "2023-02-16T06:37:56Z")

</div>

@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.

---

<div class="post-metadata">

**Author:** ![hotNipi](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/hotnipi/32/383_2.png) [@hotNipi](https://discourse.nodered.org/u/hotNipi)\
**Post date:** [16 February 2023 07:03 UTC](https://discourse.nodered.org/t/multi-state-switch-disable-1-or-more-positions/75179/8 "2023-02-16T07:03:20Z")

</div>

Using the good old CSS override technique

```auto
<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.

---

<div class="post-metadata">

**Author:** ![henkkas](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/henkkas/32/39844_2.png) [@henkkas](https://discourse.nodered.org/u/henkkas)\
**Post date:** [17 February 2023 09:53 UTC](https://discourse.nodered.org/t/multi-state-switch-disable-1-or-more-positions/75179/9 "2023-02-17T09:53:03Z")

</div>

@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!!!

---

<div class="post-metadata">

**Author:** ![hotNipi](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/hotnipi/32/383_2.png) [@hotNipi](https://discourse.nodered.org/u/hotNipi)\
**Post date:** [17 February 2023 10:14 UTC](https://discourse.nodered.org/t/multi-state-switch-disable-1-or-more-positions/75179/10 "2023-02-17T10:14:01Z")

</div>

No problem 🙂

```auto
<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>

```

---

<div class="post-metadata">

**Author:** ![henkkas](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/henkkas/32/39844_2.png) [@henkkas](https://discourse.nodered.org/u/henkkas)\
**Post date:** [17 February 2023 11:05 UTC](https://discourse.nodered.org/t/multi-state-switch-disable-1-or-more-positions/75179/11 "2023-02-17T11:05:32Z")

</div>

> [@hotNipi](#):
>
> ```auto
> .multistate-switch-wrapper{
> border-color:red;
> }   
> 
> ```

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

---

<div class="post-metadata">

**Author:** ![hotNipi](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/hotnipi/32/383_2.png) [@hotNipi](https://discourse.nodered.org/u/hotNipi)\
**Post date:** [17 February 2023 11:09 UTC](https://discourse.nodered.org/t/multi-state-switch-disable-1-or-more-positions/75179/12 "2023-02-17T11:09:38Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![henkkas](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/henkkas/32/39844_2.png) [@henkkas](https://discourse.nodered.org/u/henkkas)\
**Post date:** [17 February 2023 12:40 UTC](https://discourse.nodered.org/t/multi-state-switch-disable-1-or-more-positions/75179/13 "2023-02-17T12:40:45Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![BartButenaers](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bartbutenaers/32/10476_2.png) [@BartButenaers](https://discourse.nodered.org/u/BartButenaers)\
**Post date:** [17 February 2023 19:38 UTC](https://discourse.nodered.org/t/multi-state-switch-disable-1-or-more-positions/75179/14 "2023-02-17T19:38:16Z")

</div>

@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.

---

<div class="post-metadata">

**Author:** ![henkkas](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/henkkas/32/39844_2.png) [@henkkas](https://discourse.nodered.org/u/henkkas)\
**Post date:** [18 February 2023 07:28 UTC](https://discourse.nodered.org/t/multi-state-switch-disable-1-or-more-positions/75179/15 "2023-02-18T07:28:49Z")

</div>

@BartButenaers and @hotNipi Sure I can. Hereby the new outlook.  
 ![afbeelding](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/d/f/df0393f74349851a1a0779bb6d70fc56e10b58c7.png)

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

 ![afbeelding](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/6/d/6d0610051895a46b69a1976b6144352dc57e7ce9.png)

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

[https://flows.nodered.org/flow/47e0e1ba234753f4d218438341ef41c7](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.

---

<div class="post-metadata">

**Author:** ![dynamicdave](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dynamicdave/32/96_2.png) [@dynamicdave](https://discourse.nodered.org/u/dynamicdave)\
**Post date:** [18 February 2023 08:54 UTC](https://discourse.nodered.org/t/multi-state-switch-disable-1-or-more-positions/75179/16 "2023-02-18T08:54:27Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![henkkas](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/henkkas/32/39844_2.png) [@henkkas](https://discourse.nodered.org/u/henkkas)\
**Post date:** [18 February 2023 09:18 UTC](https://discourse.nodered.org/t/multi-state-switch-disable-1-or-more-positions/75179/17 "2023-02-18T09:18:15Z")

</div>

@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 🙂

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [4 March 2023 09:18 UTC](https://discourse.nodered.org/t/multi-state-switch-disable-1-or-more-positions/75179/18 "2023-03-04T09:18:25Z")

</div>

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