# \[ANNOUNCE\] node-red-contrib-ui-multistate-switch: v1.1.0 beta

**URL:** https://discourse.nodered.org/t/announce-node-red-contrib-ui-multistate-switch-v1-1-0-beta/41265
**Category:** Share Your Nodes
**Created:** [18 February 2021 23:01 UTC](https://discourse.nodered.org/t/announce-node-red-contrib-ui-multistate-switch-v1-1-0-beta/41265 "2021-02-18T23:01:54Z")
**Posts on this page:** 20
**Page:** 2

<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: [19 February 2021 22:29 UTC](https://discourse.nodered.org/t/announce-node-red-contrib-ui-multistate-switch-v1-1-0-beta/41265/21 "2021-02-19T22:29:25Z")

</div>

That’s confusing ! ( but at least it’s optional)

---

<div class="post-metadata">

### Author: ![apricotfarm](https://avatars.discourse-cdn.com/v4/letter/a/779978/32.png) [@apricotfarm](https://discourse.nodered.org/u/apricotfarm)
#### Post date: [21 February 2021 19:47 UTC](https://discourse.nodered.org/t/announce-node-red-contrib-ui-multistate-switch-v1-1-0-beta/41265/22 "2021-02-21T19:47:36Z")

</div>

This looks awesome. And THANK YOU for having a color option for the different options!!

---

<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: [2 March 2021 22:05 UTC](https://discourse.nodered.org/t/announce-node-red-contrib-ui-multistate-switch-v1-1-0-beta/41265/23 "2021-03-02T22:05:13Z")

</div>

After spending quite some quality time together with @hotNipi, we are very pleased to announce the last new additions for this beta version:

1. Some basic validation has been added for the editableList, e.g. an error of duplicate button values are being used. This will be extended in future versions.

2. Bug fixed about colorpickers not showed.

3. A button node displayed on multiple dashboard at the same moment will now be synced visually across those dashboards.

4. Two typedinputs have been added on the config screen:

5. The switch can be disabled via the input messages:

6. Fix to keep the switch state after a tabsheet change.

7. Now the button text color will stand out.

We would appreciate if some folks could test this, so we can publish it on npm within the next two days!

---

<div class="post-metadata">

### Author: ![OldMike](https://avatars.discourse-cdn.com/v4/letter/o/90db22/32.png) [@OldMike](https://discourse.nodered.org/u/OldMike)
#### Post date: [3 March 2021 16:45 UTC](https://discourse.nodered.org/t/announce-node-red-contrib-ui-multistate-switch-v1-1-0-beta/41265/24 "2021-03-03T16:45:19Z")

</div>

Works well with Safari on my dashboard, thanks guys... particularly the state save.

---

<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: [3 March 2021 18:33 UTC](https://discourse.nodered.org/t/announce-node-red-contrib-ui-multistate-switch-v1-1-0-beta/41265/25 "2021-03-03T18:33:30Z")

</div>

Oh dear...  
System crash when I try and change the state of the button using the ui.

```auto
3 Mar 18:31:44 - [red] Uncaught Exception:
3 Mar 18:31:44 - TypeError: Cannot read property 'indexOf' of undefined
at Object.setMessageProperty (/usr/lib/node_modules/node-red/node_modules/@node-red/util/lib/util.js:365:14)
at Object.beforeSend (/home/opc/.node-red/node_modules/node-red-contrib-ui-multistate-switch/multistate_switch.js:205:38)
at EventEmitter.handler (/home/opc/.node-red/node_modules/node-red-dashboard/ui.js:285:22)
at EventEmitter.emit (events.js:326:22)
at Socket.emit (events.js:314:20)
at /home/opc/.node-red/node_modules/socket.io/lib/socket.js:528:12
at processTicksAndRejections (internal/process/task_queues.js:79:11)
nodered.service: main process exited, code=exited, status=1/FAILURE
Unit nodered.service entered failed state.
nodered.service failed.
nodered.service holdoff time over, scheduling restart.
Stopped Node-RED graphical event wiring tool.

```

---

<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: [3 March 2021 18:43 UTC](https://discourse.nodered.org/t/announce-node-red-contrib-ui-multistate-switch-v1-1-0-beta/41265/26 "2021-03-03T18:43:22Z")

</div>

Please add the flow so we can see behind the corners ...

---

<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: [3 March 2021 18:44 UTC](https://discourse.nodered.org/t/announce-node-red-contrib-ui-multistate-switch-v1-1-0-beta/41265/27 "2021-03-03T18:44:47Z")

</div>

It's only the node and a debug node, but here it is.

```auto
[{"id":"97cffe7f.d228d","type":"debug","z":"a4801683.1c0448","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":490,"y":2870,"wires":[]},{"id":"af981bc3.6aecf8","type":"ui_multistate_switch","z":"a4801683.1c0448","name":"Test","group":"e68a1b8a.416f18","order":1,"width":"8","height":1,"label":"Drive sensor","rounded":true,"useThemeColors":true,"hideSelectedLabel":false,"options":[{"label":"ON","value":"on","valueType":"str","color":"#009933"},{"label":"OFF","value":"off","valueType":"str","color":"#999999"}],"x":320,"y":2870,"wires":[["97cffe7f.d228d"]]},{"id":"e68a1b8a.416f18","type":"ui_group","name":"Default","tab":"6952137b.75c85c","order":1,"disp":false,"width":16,"collapse":false},{"id":"6952137b.75c85c","type":"ui_tab","name":"Home","icon":"dashboard","order":12}]

```

---

<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: [3 March 2021 18:52 UTC](https://discourse.nodered.org/t/announce-node-red-contrib-ui-multistate-switch-v1-1-0-beta/41265/28 "2021-03-03T18:52:59Z")

</div>

Hmm. Was it that you had version 1.0 installed and just installed the beta and tested straight with it?

---

<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: [3 March 2021 18:54 UTC](https://discourse.nodered.org/t/announce-node-red-contrib-ui-multistate-switch-v1-1-0-beta/41265/29 "2021-03-03T18:54:40Z")

</div>

Yes, but I restarted node-RED after the update, and before testing.

---

<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: [3 March 2021 18:55 UTC](https://discourse.nodered.org/t/announce-node-red-contrib-ui-multistate-switch-v1-1-0-beta/41265/30 "2021-03-03T18:55:24Z")

</div>

And if you flush browser cache ...

---

<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: [3 March 2021 19:07 UTC](https://discourse.nodered.org/t/announce-node-red-contrib-ui-multistate-switch-v1-1-0-beta/41265/31 "2021-03-03T19:07:13Z")

</div>

Yes, and tried a different browser. Same result.

But... I've just completely removed the flow, and the node, rebooted, and then installed the node again, and now it works OK.  
For some reason it didn't like installing the new version over the old.

---

<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: [3 March 2021 19:12 UTC](https://discourse.nodered.org/t/announce-node-red-contrib-ui-multistate-switch-v1-1-0-beta/41265/32 "2021-03-03T19:12:06Z")

</div>

From the stacktrace (line 205) I need to initialize the typedinputfield values at server side for existing v1.0.0 nodes.  
Now paul has created a new node from scratch which circumvents this problem. But I need to fix it to have no impact on existing flows...  
But first doing homework with my son...

---

<div class="post-metadata">

### Author: ![SonoraTechnical](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/sonoratechnical/32/20033_2.png) [@SonoraTechnical](https://discourse.nodered.org/u/SonoraTechnical)
#### Post date: [3 March 2021 19:17 UTC](https://discourse.nodered.org/t/announce-node-red-contrib-ui-multistate-switch-v1-1-0-beta/41265/33 "2021-03-03T19:17:43Z")

</div>

Guys, this is getting better all of the time. I suspect that alighment problem with the MAC was also appearing in Chrome on RaspberryPi OS. Cant wait to use the release 1.1 version.

---

<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: [3 March 2021 19:29 UTC](https://discourse.nodered.org/t/announce-node-red-contrib-ui-multistate-switch-v1-1-0-beta/41265/34 "2021-03-03T19:29:59Z")

</div>

Just pushed some minor fixes also. Keep the label in one line and a bit improved the dark/light button text breaking point.

---

<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: [3 March 2021 19:39 UTC](https://discourse.nodered.org/t/announce-node-red-contrib-ui-multistate-switch-v1-1-0-beta/41265/35 "2021-03-03T19:39:49Z")

</div>

Got to say well done guys, for the visual effect when the node is disabled (dotted line & fading).  
It would be great if that could become a standard template for all nodes that are similarly disabled.

---

<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: [3 March 2021 20:48 UTC](https://discourse.nodered.org/t/announce-node-red-contrib-ui-multistate-switch-v1-1-0-beta/41265/36 "2021-03-03T20:48:58Z")

</div>

Little fingers worked fast and I hope we addressed all the traps to avoid issues on upgrade.

---

<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: [3 March 2021 22:02 UTC](https://discourse.nodered.org/t/announce-node-red-contrib-ui-multistate-switch-v1-1-0-beta/41265/37 "2021-03-03T22:02:59Z")

</div>

Just pulled the latest...  
Should the label colours be different? (using theme colours)

![switch](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/5/a/5ad1bbdf0352fe32b440d382f874a716b1760515.gif)

```auto
[{"id":"dae09dca.11a71","type":"ui_multistate_switch","z":"a4801683.1c0448","name":"","group":"e68a1b8a.416f18","order":20,"width":"6","height":0,"label":"switch","stateField":"payload","enableField":"enable","rounded":true,"useThemeColors":true,"hideSelectedLabel":false,"options":[{"label":"Option 0","value":"option_0","valueType":"str","color":"#009933"},{"label":"Option 1","value":"option_1","valueType":"str","color":"#999999"},{"label":"Option 2","value":"option_2","valueType":"str","color":"#ff6666"}],"x":350,"y":2850,"wires":[["73bcfc74.4a12e4"]]},{"id":"73bcfc74.4a12e4","type":"debug","z":"a4801683.1c0448","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":520,"y":2850,"wires":[]},{"id":"c6c6b976.b51278","type":"inject","z":"a4801683.1c0448","name":"disable","props":[{"p":"enable","v":"false","vt":"bool"},{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"str","x":120,"y":2850,"wires":[["dae09dca.11a71"]]},{"id":"2120c435.0f0acc","type":"inject","z":"a4801683.1c0448","name":"enable","props":[{"p":"enable","v":"true","vt":"bool"},{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"str","x":120,"y":2890,"wires":[["dae09dca.11a71"]]},{"id":"48d3e8fb.3720c8","type":"inject","z":"a4801683.1c0448","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"option_2","payloadType":"str","x":110,"y":2930,"wires":[["dae09dca.11a71"]]},{"id":"e68a1b8a.416f18","type":"ui_group","name":"Default","tab":"6952137b.75c85c","order":1,"disp":false,"width":16,"collapse":false},{"id":"6952137b.75c85c","type":"ui_tab","name":"Home","icon":"dashboard","order":12}]

```

---

<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: [4 March 2021 05:28 UTC](https://discourse.nodered.org/t/announce-node-red-contrib-ui-multistate-switch-v1-1-0-beta/41265/38 "2021-03-04T05:28:00Z")

</div>

No they should not. Will investigate.  
The story behind is that as you can choose any color for state, we need to figure out if the text on top of the state is still readable. So we change the text color button by button in case of they both are light or dark.

---

<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: [4 March 2021 06:54 UTC](https://discourse.nodered.org/t/announce-node-red-contrib-ui-multistate-switch-v1-1-0-beta/41265/39 "2021-03-04T06:54:04Z")

</div>

Now fixed.

---

<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 March 2021 09:36 UTC](https://discourse.nodered.org/t/announce-node-red-contrib-ui-multistate-switch-v1-1-0-beta/41265/40 "2021-03-04T09:36:32Z")

</div>

Sorry guys, I can't find any more bugs 🤭

Works great here now, nice work.

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

[Next page](https://discourse.nodered.org/t/announce-node-red-contrib-ui-multistate-switch-v1-1-0-beta/41265.md?page=3)
