Set dashboard switch position by flow

1,174 views
Skip to first unread message

davidhui...@gmail.com

unread,
Jun 26, 2017, 12:58:47 AM6/26/17
to Node-RED
Hi,

Can you set the switch position for dashboard from a flow or global variable?

I have a control system and I want to have control from both a local touch screen and the web. The system is working and I can move update my 
controls on the display ok when Web input changes (switch clicked) BUT I cannot seem to do it the other way - ie. I change setting on display and then try to use new value to 
set the dashboard switch ON or OFF to reflect new state.

I tried using the serial display data to send "1" and "0" to switch input but this did not work. I also tried to set up a global variable and have a timer update the node inputs with the variable but
did not seem to be able to get this working either.

Colin Law

unread,
Jun 26, 2017, 3:14:42 AM6/26/17
to node...@googlegroups.com
To do this you have to pass in a payload with *exactly* the same
values that you specify in the switch node. So if, for example, you
have configured the switch to output String "0" and "1" then that is
what you must feed in. If however you have configured the switch to
output Number 0 and 1 then you must feed in numbers not strings.

Colin
> --
> http://nodered.org
>
> Join us on Slack to continue the conversation: http://nodered.org/slack
> ---
> You received this message because you are subscribed to the Google Groups
> "Node-RED" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to node-red+u...@googlegroups.com.
> To post to this group, send email to node...@googlegroups.com.
> Visit this group at https://groups.google.com/group/node-red.
> To view this discussion on the web, visit
> https://groups.google.com/d/msgid/node-red/4bc3c2ba-0051-4ce5-9a18-326ba07247a7%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

davidhui...@gmail.com

unread,
Jun 26, 2017, 5:14:29 PM6/26/17
to Node-RED

Thanks Colin,

I was sending text "1" and "0" but had switches set for true/false boolean. All working now
Reply all
Reply to author
Forward
0 new messages