Multi Digital Messages from Micro:bit

Is there a way to display multi digital information from a Micro:bit as a single message?

Two examples are using two Digital Inputs on a Micro:bit.

Check that a Shed Door is Closed using a Microswitch. Allowing for Fail Safe reading using both the N.O. Contact and the N.C. Contact.

Pin 0 Pin 1 Message
FALSE FALSE FAILED
TRUE FALSE CLOSED
FALSE TRUE OPEN
TRUE TRUE FAULT

Check the Water Level in a Tank using two Level Probes and an Earth Probe (3 wires).

Pin 0 Pin 1 Message
FALSE FALSE EMPTY
TRUE FALSE HALF FULL
FALSE TRUE FAULT
TRUE TRUE FULL

First question: How are you connection to WebThings Gateway?
Second question: What framework are you using to program Micro:bit?

Do you have any working code that presents this data, either serially, via HTTP, or otherwise.

For more information checkout: https://github.com/search?q=webthings
for the WebThings Arduino examples, also read through
https://webthings.io/docs/
These would be a good start.

Good luck.

In a web thing I would model those values as a property with type string and an enum which enumerates possible values.

Thank you for your replies.

I was hoping to use MicroBlocks or Make Code to program the Micro:bit. Having one “Master” Micro:bit connected via USB to a Raspberry Pi. The “remote” Micro:bits would use Radio to send their Data back to this “Master”.

But by the looks of things the Data would need to be Grouped together into one Message in the “Master” to be sent to Webthings. As I can only connect one Micro:bit to Webthings at a time.

So I think I will look further into sending Strings to Webthings. But that opens up another thought about how to group the Message so that it reflects different Messages from different Mico:bits.

The reason for using Micro:bits is that they can be housed in a small waterproof box and placed around the Garden. Including powered by AA Cells where no Mains Power is available.

For example the “message” might show as any one of the following examples?

“Pond Comms Normal/Failed”
“Pond Battery Normal/Low”
“Pond Level Normal/Half Full”
“Pond Level Normal/Empty”

“Shed Comms Normal/Failed”
“Shed Power Normal/Failed”
“Shed Door Open/Not Open”
“Shed Door Closed/Not Closed”
“Shed Door Normal/Fault”

Can these separate sources be shown as separate devices in Webthings such as “Pond …” and “Shed …”. Or can I only show one long message detailing all the separate messages all at once?

I don’t have experience with programming Micro:bits, but in theory you could have the master Micro:bit expose multiple web things which represent each individual remote Micro:bit.

Each web thing would have its own Thing Description and set of properties.

I’ve had good luck using the “Virtual Things” addon to add custom things to WT and then wrote remote sw to alter their properties using http API calls. Works well to trigger events within webthings.

Used the Run Program option to kludge communication from a Virtual Thing to a remote device. Not ideal, but it prevented me from having to write another addon.