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...
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgpGj5toeY6e9G9sKFi7oaieC2Vk7y6oZQSFKO0VPjlXeWGKod_worHy9Lbkmeyg-BAM95_6pejC5tFChu2X3X3fBx1Oxjg870abGdeqvO0qKY4CrChnIMwM6xZIXvCpeWHTdbkzW-oQzJf/s320/Screen+Shot+2018-01-01+at+20.23.32.png) |
Dashboard Input Fields |
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjFCD6ZqmQULi_H4T748Dh9jVjqnlaeNkBYV76BCNbk1xoqZfDJgzk-4JzkcRCcaOP7m4uKzt2rtTrh6jaEWuJuY30hqvgx5JmQOGioKYuG2uaDSMZhC_MPGPWpCjbwrHsE3IjIzFS0-9YO/s320/Screen+Shot+2018-01-01+at+20.23.53.png) |
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
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjtA8sSIrv7ZJ0EteDYTyJGm2z7bgmNviBUV_HhjZ6UAndImcAhWrm17Seg647Emb-uvWMB2AdiLAMombOdxLZYrDRdE4nN6WxgTHrXApcFEKDqeSdFLGXOVdI0iBE8Cpd8LaHL8skxGQWM/s640/Screen+Shot+2018-01-01+at+19.43.42.png) |
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...
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgtzPYtcj3nGb_KsJNAh2rtshUfm-dYIu_v7d10A3oFiPYKjvficW3FAJwjGOa0G3LhXQSVYgGXajKCzRzh7i7EuSC1TfjM1kb0oOSfP-x_ybYSTABXA1J53oNBFeeIXa-9YRoLkZFMwgfL/s640/Screen+Shot+2018-01-01+at+20.41.58.png) |
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