# Monitor using the dashboard node

**URL:** <https://discourse.nodered.org/t/monitor-using-the-dashboard-node/46305>\
**Category:** Dashboard\
**Created:** [26 May 2021 21:25 UTC](https://discourse.nodered.org/t/monitor-using-the-dashboard-node/46305 "2021-05-26T21:25:31Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![fikerplunk](https://avatars.discourse-cdn.com/v4/letter/f/e19b73/32.png) [@fikerplunk](https://discourse.nodered.org/u/fikerplunk)\
**Post date:** [26 May 2021 21:25 UTC](https://discourse.nodered.org/t/monitor-using-the-dashboard-node/46305/1 "2021-05-26T21:25:31Z")

</div>

Hello everyone!

I am trying to make an "IamAlive" monitor in which my arduino device publishes an "OK" message every 30 seconds in a mqtt topic and every time it is published, the day and time is indicated in a graph on the Dashboard node. I would also like to make a led for when I no longer send the message to the topic, the led would turn red, but I'm not able to do it, I thought of some ways but it doesn't work.

Would anyone have an idea how I could do this?

The flow

```auto
[{"id":"24c867d.13a0c98","type":"tab","label":"Flow 5","disabled":false,"info":""},{"id":"a288d7e8.92c538","type":"mqtt in","z":"24c867d.13a0c98","name":"","topic":"esp32/test/alive","qos":"2","datatype":"auto","broker":"4c966331.a132ec","x":100,"y":180,"wires":[["6a4b2e5.f0a0ed"]]},{"id":"6a4b2e5.f0a0ed","type":"function","z":"24c867d.13a0c98","name":"","func":"if(msg.payload == \"OK\")\n{\n msg.payload = 1;\n}\nelse\n{\n msg.payload = 0;\n}\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":300,"y":180,"wires":[["e88ab21d.7c41a","74fba7b6.e0ff48"]]},{"id":"e88ab21d.7c41a","type":"ui_chart","z":"24c867d.13a0c98","name":"","group":"81478044.b9caf","order":3,"width":"6","height":"6","label":"Test","chartType":"line","legend":"false","xformat":"D/M/Y - HH:mm:ss","interpolate":"linear","nodata":"","dot":false,"ymin":"0","ymax":"1","removeOlder":"1","removeOlderPoints":"","removeOlderUnit":"3600","cutout":0,"useOneColor":false,"useUTC":false,"colors":["#1f77b4","#aec7e8","#e16e09","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"outputs":1,"useDifferentColor":false,"x":490,"y":120,"wires":[[]]},{"id":"74fba7b6.e0ff48","type":"ui_led","z":"24c867d.13a0c98","order":3,"group":"81478044.b9caf","width":0,"height":0,"label":"Status: ","labelPlacement":"left","labelAlignment":"left","colorForValue":[{"color":"#ff0000","value":"0","valueType":"num"},{"color":"#008000","value":"1","valueType":"num"}],"allowColorForValueInMessage":false,"shape":"circle","showGlow":true,"name":"","x":490,"y":220,"wires":[]},{"id":"4c966331.a132ec","type":"mqtt-broker","name":"","broker":"test.mosquitto.org","port":"1883","clientid":"","usetls":false,"compatmode":true,"keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthPayload":"","closeTopic":"","closeQos":"0","closePayload":"","willTopic":"","willQos":"0","willPayload":""},{"id":"81478044.b9caf","type":"ui_group","name":"PlaceTest","tab":"8e0a919b.4d71f","order":1,"disp":true,"width":"6","collapse":false},{"id":"8e0a919b.4d71f","type":"ui_tab","name":"Test","icon":"dashboard","disabled":false,"hidden":false}]

```

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/e/b/eb69203480ba2fac96bff143072707d332302a82.png)

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/2/6/263090e022ee3e89d6241acee65b928a99cbebb7.png)

---

<div class="post-metadata">

**Author:** ![E1cid](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/e1cid/32/77971_2.png) [@E1cid](https://discourse.nodered.org/u/E1cid)\
**Post date:** [26 May 2021 22:06 UTC](https://discourse.nodered.org/t/monitor-using-the-dashboard-node/46305/2 "2021-05-26T22:06:47Z")

</div>

Use a trigger node and a change node. e.g.

```auto
[{"id":"a288d7e8.92c538","type":"mqtt in","z":"24c867d.13a0c98","name":"","topic":"esp32/test/alive","qos":"2","datatype":"auto","broker":"4c966331.a132ec","x":160,"y":140,"wires":[["8d37b44a.418378","e4b45a98.beaa18"]]},{"id":"8d37b44a.418378","type":"trigger","z":"24c867d.13a0c98","name":"","op1":"","op2":"0","op1type":"nul","op2type":"num","duration":"35","extend":true,"overrideDelay":false,"units":"s","reset":"","bytopic":"all","topic":"topic","outputs":1,"x":400,"y":200,"wires":[["e88ab21d.7c41a","1b999449.10732c"]]},{"id":"e4b45a98.beaa18","type":"change","z":"24c867d.13a0c98","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"1","tot":"num"}],"action":"","property":"","from":"","to":"","reg":false,"x":420,"y":140,"wires":[["e88ab21d.7c41a","1b999449.10732c"]]},{"id":"e88ab21d.7c41a","type":"ui_chart","z":"24c867d.13a0c98","name":"","group":"81478044.b9caf","order":3,"width":"6","height":"6","label":"Test","chartType":"line","legend":"false","xformat":"D/M/Y - HH:mm:ss","interpolate":"linear","nodata":"","dot":false,"ymin":"0","ymax":"1","removeOlder":"1","removeOlderPoints":"","removeOlderUnit":"3600","cutout":0,"useOneColor":false,"useUTC":false,"colors":["#1f77b4","#aec7e8","#e16e09","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"outputs":1,"useDifferentColor":false,"x":650,"y":120,"wires":[[]]},{"id":"1b999449.10732c","type":"debug","z":"24c867d.13a0c98","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":670,"y":200,"wires":[]},{"id":"4c966331.a132ec","type":"mqtt-broker","name":"","broker":"test.mosquitto.org","port":"1883","clientid":"","usetls":false,"compatmode":true,"keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthPayload":"","closeTopic":"","closeQos":"0","closePayload":"","willTopic":"","willQos":"0","willPayload":""},{"id":"81478044.b9caf","type":"ui_group","name":"PlaceTest","tab":"8e0a919b.4d71f","order":1,"disp":true,"width":"6","collapse":false},{"id":"8e0a919b.4d71f","type":"ui_tab","name":"Test","icon":"dashboard","disabled":false,"hidden":false}]

```

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [26 May 2021 22:16 UTC](https://discourse.nodered.org/t/monitor-using-the-dashboard-node/46305/3 "2021-05-26T22:16:47Z")

</div>

If you have the arduino set with a LWT, you could monitor that topic in a flow to control the led.

---

<div class="post-metadata">

**Author:** ![fikerplunk](https://avatars.discourse-cdn.com/v4/letter/f/e19b73/32.png) [@fikerplunk](https://discourse.nodered.org/u/fikerplunk)\
**Post date:** [27 May 2021 15:03 UTC](https://discourse.nodered.org/t/monitor-using-the-dashboard-node/46305/4 "2021-05-27T15:03:03Z")

</div>

Thank you for every answer! 🙂

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [10 June 2021 15:04 UTC](https://discourse.nodered.org/t/monitor-using-the-dashboard-node/46305/5 "2021-06-10T15:04:05Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
