[ANNOUNCE]node-red-contrib-ui-multistate-switch: v1.0.0

Does the status coming back from the pump also give you the Auto/Manual state? If it does then you could use that to determine what to send to the switch. Then the actual on/off state is fed to the LED.

Colin, in my case YES. I trigger relays over i2c.. and I do get the actual status back from the device (...the relay latched..) It's that status that I feed back to the LED node that I place right next to my toggle switches....

So you could merge the auto/manual state with the on/off state to know whether to send on, off, or auto in the front of the switch node.

I'm not worried. I'll figure it out.

Thank you BartButenaers and hotNipi for your next great contribution.

I am already starting to include this in my home automation dashboard.
It's already improvement for me in it's current state.

One question or request - if possible make switching the state of switch only when a message arrives.
This would help making this both control for sending commands and a status displaying control - that show what the device actually returned (meaning it's current and confirmed state - even if state changes outside of automation)

This is under discussion if you read carefully whole thread. Most probably it will be available at some point. Just not yet concluded about what will be the actual implementation.

1 Like

I think I prefer the term pass through as that is used in the ui_switch and slider.

Initially I thought that one or more of those should only be available in non-passthrough, but having thought about it I agree, they can be available all the time.
The addition of the No Input mode is interesting as it still allows the switch to move under flow control but not under user control. Which is different to disabling the node. I think the word 'input' (as in Ignore inputs) is ambiguous as it might be talking about message inputs.
I am not sure about the wording. How about something like

Ignore clicks
Click sends message and moves switch
Click sends message but does not move switch

Though I can't get that excited about those. It isn't easy coming up with short phrases for features that really need a sentence or two.
Or it could be a drop down labelled 'On Click' with options
Do nothing
Send message, don't move switch position
Send message and move switch

Will those be selectable at run time? I can see the Do Nothing option being useful as a way of temporarily disabling the switch but keeping it as an indicator.

1 Like

Perhaps "No user input"?

Via an input msg could that be enabled or disabled

Excellent

Hi, thank you for this great switch! I don't know if this is working as intended: but I have a two state switch set up to choose either 250g or 500g. My interface has a second tab and whe I go to the second tab and come back the 500g value gets selected automatically, even if I had set 250g before going to the other layout.

There is no input wired to the switch, output sets a global variable. Option B is the second one.

v 1.0

Thanks!

EDIT:
So I did put an ui_control node on the flow that reacts to tab change and changed the message "change" to my global.weight in a switch node; so when I come back to my layout the global is rewritten to the switch, and to the set global after... Not very beautiful, but seems to work for the moment :smiley:

[{"id":"4c43bc79.3ebf74","type":"ui_multistate_switch","z":"f0cab7c7.b1df3","name":"Choix de poids","group":"69980645.578418","order":6,"width":5,"height":2,"label":"","options":[{"label":"250","value":"250","valueType":"num"},{"label":"500","value":"500","valueType":"num"}],"x":100,"y":260,"wires":[["806895b2.1715c"]]},{"id":"b076fa9a.0cb798","type":"change","z":"f0cab7c7.b1df3","name":"","rules":[{"t":"set","p":"desired_weight","pt":"global","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":530,"y":260,"wires":[["9a02fcd2.02fda8"]]},{"id":"806895b2.1715c","type":"show-value","z":"f0cab7c7.b1df3","name":"","path":"","x":290,"y":260,"wires":[["b076fa9a.0cb798"]]},{"id":"9a02fcd2.02fda8","type":"link out","z":"f0cab7c7.b1df3","name":"to calcul paliers","links":["f5795d83.ca0228","92935aa0.c7b04","ed17f4b4.988b38"],"x":715,"y":260,"wires":[]},{"id":"cbef1a40.00b25","type":"ui_ui_control","z":"f0cab7c7.b1df3","name":"","events":"change","x":80,"y":220,"wires":[["8ed925b1.fe953"]]},{"id":"8ed925b1.fe953","type":"change","z":"f0cab7c7.b1df3","name":"","rules":[{"t":"change","p":"payload","pt":"msg","from":"change","fromt":"str","to":"desired_weight","tot":"global"}],"action":"","property":"","from":"","to":"","reg":false,"x":260,"y":220,"wires":[["4c43bc79.3ebf74"]]},{"id":"69980645.578418","type":"ui_group","name":"Adam","tab":"69bfb17e.18e7c8","order":1,"disp":false,"width":"12","collapse":false},{"id":"69bfb17e.18e7c8","type":"ui_tab","name":"Home","icon":"dashboard","disabled":false,"hidden":false}]

Hi Paul,
I have added a fix on Github (not on NPM yet!) for your tab-switch issue, which you can install within your .node-red folder like this:

npm install bartbutenaers/node-red-contrib-ui-multistate-switch

Would be nice if you (or others) can test this, because I know from experience that this can have unwanted side effects: tab switches, deploys, ...

Oooh!, it didn't seem to like your last.

error

That is weird...
Had that also, but with @hotNipi 's fix from few days ago on Github it was solved.
Did a couple of tests afterwards and wasn't able to reproduce that behaviour again.
Will try again ...

1 Like

It's only appeared after your last commit a few minutes ago, never had it before.

Yes now I also have it again. So weird that it was solved temporarily.
In the last version I simply do storeFrontEndInputAsState: true, but I got the impression that this triggers an endless loop of messages between frontend and backend.
Will need to debug ...

2 Likes

Is it now solved?
P.S. I assume there will be no msg passthrough anymore now, but will have a look at that later ...

1 Like

Yes, and it retains its visual state when changing ui tabs.

1 Like

Works for me too, thanks!

1 Like