Guys,
I have created a Tab with a seperate group - i want this group to display status information from a connected microcontroller (Arduino). I have the Arduino sending in MQTT streams fine.
This particular stream is a 3 digit number between 128 and 208 with each increment in 16. So there are values of 128, 144, 160, 176 etc etc
I am capturing this (which is obviously at point of capture being treated as a String, in the format of 128.00) as it was converted from a float at the Arduino end prior to sending
Each of the value is representing a certain State of various output pins on the Arduino - so 160 for example, might be Boiler on, Circulating pump off, Solar Off
I want to interpret each of these and then based on the value that is received place a value on the Dashboard along the lines of Boiler on, Circulating pump off, Solar Off, or another combination might be Solar on, Boiler Off, Circulating Pump on etc etc
I want the output to go into a Status box and for there to only be one output showing at any time (as they are mutually exclusive) - i started trying to do this with the Switch node and then each of the outputs from it putting a Text message onto the Group in the dashboard - but rather than them overwriting each other so only one is visible - they are all treated as being active and their text is displayed on the screen.
So my question is - is the switch Object the right one to use (and is there a way to achieve what i want) or should i just go build a case function (i am familiar with C++ but a babe in the wood with JS) (but happy to learn)
Craig