I would like to learn how to show sensor events in Grafana, where initial the value is either text (in this case "vibration", or true/false). I was thinking a bar chart with time across the bottom.
In this example. three window vibration sensors are feeding into influxDB:
That is ok, you shouuld use === here though, did not the editor suggest that? Also you can make it a bit more concise using msg.payload = msg.payload.action === "vibration" ? 1 : 0
Note that you will have to drop the existing measurement in influx in order to change the field type from string to number
Ah that's what I remember too. For now I just changed the key value to "vibration" and will ignore the "action" one.
Next, I need to fix it in Grafana so it shows more of a square wave (if that makes sense), rather than filling in the gaps between 1's and 0's like this:
In case anyone searches in the future, it was fixed by using staircase option as suggested by Colin, and setting fill to "none", where it was previously "linear" - doh!