# \[ANNOUNCE\] node-red-contrib-ui-multistate-switch: 1.2.0

**URL:** <https://discourse.nodered.org/t/announce-node-red-contrib-ui-multistate-switch-1-2-0/50464>\
**Category:** Share Your Nodes\
**Created:** [31 August 2021 21:54 UTC](https://discourse.nodered.org/t/announce-node-red-contrib-ui-multistate-switch-1-2-0/50464 "2021-08-31T21:54:10Z")\
**Posts on this page:** 20\
**Page:** 2

<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:** [26 September 2021 15:35 UTC](https://discourse.nodered.org/t/announce-node-red-contrib-ui-multistate-switch-1-2-0/50464/21 "2021-09-26T15:35:05Z")

</div>

Yeah, I was away from computers and did read it from phone so not much I could do but I see you have manged it going. I was pretty sure there will be such edge cases but life shows - surprisingly not too many 😃  
I think the remaining "0 case" is walk in the park to fix ... 🙃

---

<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:** [26 September 2021 20:59 UTC](https://discourse.nodered.org/t/announce-node-red-contrib-ui-multistate-switch-1-2-0/50464/22 "2021-09-26T20:59:08Z")

</div>

> [@Sean-McG](#):
>
> injecting a 0 doesn't select the home option

@Sean-McG,  
That should now be fixed when you install the new version from Github.

> [@hotNipi](#):
>
> I think the remaining "0 case" is walk in the park to fix ... 🙃

It is meanwhile already dark in the park, but still easy to find it ...

---

<div class="post-metadata">

**Author:** ![tmichaeltx](https://avatars.discourse-cdn.com/v4/letter/t/73ab20/32.png) [@tmichaeltx](https://discourse.nodered.org/u/tmichaeltx)\
**Post date:** [28 September 2021 19:50 UTC](https://discourse.nodered.org/t/announce-node-red-contrib-ui-multistate-switch-1-2-0/50464/23 "2021-09-28T19:50:25Z")

</div>

**Potential bug**. When I use a new multistate switch node and leave the initial defaults in place (including use theme colors), I run into an anomaly. If I add 3-4 different states and then deploy my flow I find that my first option (when selected) shows white text on blue background. My first option shows gray text on white background when another option is selected. Regardless of which option is selected, options 2-n all show gray text with the background driven by selection or not.

Weirdly, experimentation shows that if I create 3 options, deploy, then delete the first option and then deploy again, then all options are gray text. So it is almost like the very first option has a text color hardcoded.

I am using version 1.2.0 from the palette manager.

**Additional question**  
I am using an "All Lights" multiswitch for a room where I have multiple lights (each with their own switch on the dashboard). I would like for my multiswitch to be able to accept an on touch input for on/off to do the obvious change to all of the lights, but I would like it to be able to display that some are on state, but to never allow that to be a user selectable state. (ie. ignore that input, while accepting and outputting either of the other 2. I will programmatically change it to some when only some of the rooms lights are triggered. Is this possible or should I just treat the user input of some as an on, turn on all the lights and then programmatically update the switch to on selected?

---

<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:** [28 September 2021 20:18 UTC](https://discourse.nodered.org/t/announce-node-red-contrib-ui-multistate-switch-1-2-0/50464/24 "2021-09-28T20:18:13Z")

</div>

The node does some semi-smart work to preserve readability in all conditions. It tries avoid situations where bright text is rendered on top of bright background. As you can choose any color for state, it is needed. The text color is not under user control directly so it may seems a little bit as random but it definitely not. If you'll find it does not provide enough contrast, then it is definitely bug.

For additional question - I cant see a way to make the widget that smart. The switch is simple device. It can not do such logical decisions.

---

<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:** [28 September 2021 21:05 UTC](https://discourse.nodered.org/t/announce-node-red-contrib-ui-multistate-switch-1-2-0/50464/25 "2021-09-28T21:05:37Z")

</div>

@tmichaeltx,  
So your switch has 3 options:

1. All lights on.
2. All lights off.
3. Some lights on.

And only option 1 and 2 are manually selectable, while option 3 is automatically selected by your flow via an input message.

Something like that is currently not possible. In that case e.g. each option in the editableList (on the config screen) should have a checkbox _"selectable"_, or something like that. And that would determine which options are disabled and which enabled. Such a feature would unfortunately be quite a lot of work to implement (e.g. the partially disabled look and feel)...

---

<div class="post-metadata">

**Author:** ![tmichaeltx](https://avatars.discourse-cdn.com/v4/letter/t/73ab20/32.png) [@tmichaeltx](https://discourse.nodered.org/u/tmichaeltx)\
**Post date:** [28 September 2021 21:08 UTC](https://discourse.nodered.org/t/announce-node-red-contrib-ui-multistate-switch-1-2-0/50464/26 "2021-09-28T21:08:12Z")

</div>

@BartButenaers Not a surprise that this corner case would be hard to implement. I will just build my workaround. Thanks for verifying that I wasn't just missing something semi-obvious.

---

<div class="post-metadata">

**Author:** ![tmichaeltx](https://avatars.discourse-cdn.com/v4/letter/t/73ab20/32.png) [@tmichaeltx](https://discourse.nodered.org/u/tmichaeltx)\
**Post date:** [28 September 2021 21:09 UTC](https://discourse.nodered.org/t/announce-node-red-contrib-ui-multistate-switch-1-2-0/50464/27 "2021-09-28T21:09:48Z")

</div>

Shouldn't the color of the text when using the theme colors be the same for all options (whether good contrast or bad at least consistent)?

---

<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:** [28 September 2021 21:13 UTC](https://discourse.nodered.org/t/announce-node-red-contrib-ui-multistate-switch-1-2-0/50464/28 "2021-09-28T21:13:09Z")

</div>

Well, consistency vs readability in situation you can't control - for me the readability wins. But let's see what @BartButenaers says.

---

<div class="post-metadata">

**Author:** ![tmichaeltx](https://avatars.discourse-cdn.com/v4/letter/t/73ab20/32.png) [@tmichaeltx](https://discourse.nodered.org/u/tmichaeltx)\
**Post date:** [28 September 2021 21:33 UTC](https://discourse.nodered.org/t/announce-node-red-contrib-ui-multistate-switch-1-2-0/50464/29 "2021-09-28T21:33:48Z")

</div>

I agree that given a choice, I would choose readability. I am not sure I am conveying what I mean. Here are some images to explain:  
As initially created (notice no custom colors) with 2 items

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/0/d/0dc960a8861c6654d585b39aaae5f6718581d96a.png)  
Deployed as initially created notice the first selection is white on blue  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/f/6/f6205ca27045a59cbcef75572becb3c4b8692f86.png)  
Deployed as initially created with second option selected. Notice Black on blue  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/9/0/901b4c1a3c16d5d3a767a8fa25db9247f44ddd7f.png)  
Now if I add a third option  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/d/5/d5fe61e8a9fac0dddfdb422c46d611313d3d9005.png)  
Option 1 selected white on blue, Option 2 black on blue, Option 3 black on blue  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/5/5/550b03923a0bc243939710ed734921c4e7273730.png)  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/6/8/68fd01aacf7d7ea580c44225d9f29c25f734dcbb.png)  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/d/5/d592d8f19fb8c2db4e0ad79f27dfba16f62e75ec.png)  
Then if I delete the first option  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/6/a/6ac15f01f1b9a0dda8d7abdd6189c3d4d2d1aa27.png)  
Option 1 black on blue, Option 2 black on blue  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/d/2/d268e29ea8a1edd38a636aff267f79e3d0dc017a.png)  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/4/e/4e8f9c7b6af46b83a65b4e57a6b37ea0b17f4b91.png)  
Finally if I reorder the 2 options  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/3/0/3034c8f7dfcacf788425c5caf95e116ccbed2bb0.png)  
and change Full v2 back to Full  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/3/6/36d4efef1c739dca7d9cb17e3bf1943051104121.png)  
Now Options 1 and 2 are both black on blue unlike the initial case where the first option was white on blue  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/5/9/59669ef19aa5d1a6ee218cd93166ad03ede350e6.png)  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/7/b/7bba1f53de5fa426333bea055ff29143a20c62d4.png)

This is what I mean by consistent (though if I had an option I prefer white on blue in this case).

Please don't take this the wrong way as I love the multiswitch and have workarounds for my corner cases that it does not support.

---

<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:** [28 September 2021 21:38 UTC](https://discourse.nodered.org/t/announce-node-red-contrib-ui-multistate-switch-1-2-0/50464/30 "2021-09-28T21:38:42Z")

</div>

OK .Must check for that. This is inconsistent for sure. Will see if I can reproduce. Seems like situation based on default light theme?

---

<div class="post-metadata">

**Author:** ![tmichaeltx](https://avatars.discourse-cdn.com/v4/letter/t/73ab20/32.png) [@tmichaeltx](https://discourse.nodered.org/u/tmichaeltx)\
**Post date:** [28 September 2021 22:07 UTC](https://discourse.nodered.org/t/announce-node-red-contrib-ui-multistate-switch-1-2-0/50464/31 "2021-09-28T22:07:58Z")

</div>

Yes, though I may have picked the blue color  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/8/8/880d3ab8622cfaeb23b2a4e5e41e313c27ca914f.png)

---

<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:** [29 September 2021 05:48 UTC](https://discourse.nodered.org/t/announce-node-red-contrib-ui-multistate-switch-1-2-0/50464/32 "2021-09-29T05:48:30Z")

</div>

Bug confirmed. Pushed fix to the master. Routines to test as usual - install from git repository.

---

<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:** [11 October 2021 05:44 UTC](https://discourse.nodered.org/t/announce-node-red-contrib-ui-multistate-switch-1-2-0/50464/33 "2021-10-11T05:44:06Z")

</div>

Version _ **1.2.1** _ is now available in the Node-RED palette:

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/0/5/0567c70e71b15f57d64fd431db09064bde2be6b5.png)

The [release notes](https://github.com/bartbutenaers/node-red-contrib-ui-multistate-switch/releases) contain a list of what has been implemented.

---

<div class="post-metadata">

**Author:** ![craigcurtin](https://avatars.discourse-cdn.com/v4/letter/c/94ad74/32.png) [@craigcurtin](https://discourse.nodered.org/u/craigcurtin)\
**Post date:** [28 October 2021 02:14 UTC](https://discourse.nodered.org/t/announce-node-red-contrib-ui-multistate-switch-1-2-0/50464/34 "2021-10-28T02:14:12Z")

</div>

Great work Bart et al

I have a problem with the control though

See screenshot below

You can see i have implemented 3 of the multi state objects and they are over writing portions of other dashboard objects.

I am runnign NR 2.1.1 in a VM on Ubuntu 20.04 - dashboard 3.0.4 and 1.2.1 of multistate switch

Google Chrome on Windows 10

This same behaviour was in place with 1.3.5 of NR

Any ideas on why i am getting this over writing ?

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/4/d/4d235a179493d1969d0a7f556d3e2724723f4f95.png)

Craig

---

<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:** [28 October 2021 07:34 UTC](https://discourse.nodered.org/t/announce-node-red-contrib-ui-multistate-switch-1-2-0/50464/35 "2021-10-28T07:34:27Z")

</div>

I have seen this kind of failure before. Can't be sure we can blame the widget here. If you can test it by replacing the multistate switches with some other dashboard widgets but leaving the sizes of the groups and widgets same, and see if it works, then it is definitely somehow related to widget.

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [28 October 2021 18:49 UTC](https://discourse.nodered.org/t/announce-node-red-contrib-ui-multistate-switch-1-2-0/50464/36 "2021-10-28T18:49:49Z")

</div>

Indeed. The overall layout algorithm sometimes fails when there are groups of differing widths

---

<div class="post-metadata">

**Author:** ![craigcurtin](https://avatars.discourse-cdn.com/v4/letter/c/94ad74/32.png) [@craigcurtin](https://discourse.nodered.org/u/craigcurtin)\
**Post date:** [28 October 2021 23:20 UTC](https://discourse.nodered.org/t/announce-node-red-contrib-ui-multistate-switch-1-2-0/50464/37 "2021-10-28T23:20:36Z")

</div>

OK thanks guys - will follow the advice and report back

Craig

---

<div class="post-metadata">

**Author:** ![interscope101](https://avatars.discourse-cdn.com/v4/letter/i/a88e4f/32.png) [@interscope101](https://discourse.nodered.org/u/interscope101)\
**Post date:** [4 November 2022 14:27 UTC](https://discourse.nodered.org/t/announce-node-red-contrib-ui-multistate-switch-1-2-0/50464/38 "2022-11-04T14:27:20Z")

</div>

Hi, I am trying to use your switch and struggling with the following:

> [@Multi-state switch + passthrough / msg parts](https://discourse.nodered.org/t/multi-state-switch-passthrough-msg-parts/70069):
>
> Hi there, I've been going in circles trying to get this (seemingly simple) config. I have a UI input template sending data to UI text node display. From the same input there is going to be two independent sets of data, one flow.set in memory (A) the other in filesystem (B) depending on a state of a toggle switch. In other words if the switch is set in A position the data that's being entered/submitted is getting stored in set A and the UI text node is showing that set. You can toggle b…

Wondering if you could assist? Thanks!

---

<div class="post-metadata">

**Author:** ![Paul-Reed](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/paul-reed/32/66906_2.png) [@Paul-Reed](https://discourse.nodered.org/u/Paul-Reed)\
**Post date:** [4 November 2022 17:40 UTC](https://discourse.nodered.org/t/announce-node-red-contrib-ui-multistate-switch-1-2-0/50464/39 "2022-11-04T17:40:11Z")

</div>

Let's try and keep the discussion in one topic please!

---

<div class="post-metadata">

**Author:** ![Paul-Reed](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/paul-reed/32/66906_2.png) [@Paul-Reed](https://discourse.nodered.org/u/Paul-Reed)\
**Post date:** [4 November 2022 17:40 UTC](https://discourse.nodered.org/t/announce-node-red-contrib-ui-multistate-switch-1-2-0/50464/40 "2022-11-04T17:40:16Z")

</div>



[Previous page](https://discourse.nodered.org/t/announce-node-red-contrib-ui-multistate-switch-1-2-0/50464.md?page=1)
