The last post managed to get the Maplin RSL366T switches under the control of NodeRed. However, I don't want to be clicking things on and off through the laptop, by clicking an "inject" node... How much more useful it would be to have, for example, a web page that showed the state of the switches and allowed them to be toggled ON and OFF.
The NodeRed add-ons suggested in
tech.scargill.org include the NodeRed Dashboard nodes. Let's take a look...
|
Dashboard Input Fields |
|
Dashboard Output Fields |
There are two sets of widgets in the Dashboard selection - input and output, shown in the nearby screenshots. What did I need? Since this was a learning experience, I decided a On and Off button for each of the 3 switches, and a field to report the current status of the switch.
In a new Flow Tab, I added
- 6 buttons
- 3 text fields
- linking two buttons to
- each text field
- a Link node that links to the TriState Control widget on another tab
|
Simple Dashboard Input (Buttons) and Output (Text) Flow |
Here's the resulting Flow Tab contents. The buttons are just like HTML buttons, so they have properties associated with them i.e. code, channel and state - pretty handy for the TriState Control input! Then I pointed my browser at the NodeRed server, with the URI /ui, and bingo...
|
NodeRed Dashboard Example |
Now I can switch the switches on and off from anywhere in the house. Excellent! In fact, so excellent the 3.5 year old twins were screaming with delight every time I switched the light in the back room on or off remotely, standing around waiting for it to change... sad but fun!
Comments
Post a Comment