Any advice on how to create a visitor log? Say I have a bunch of presence sensors attached to different people, and I’m looking to end up with a dashboard widget that looks something like:
# Yesterday
Andrew 14:15 - 17:23 (3hrs 7 mins)
Andrew 08:00 - 08:14 (14 mins)
Jane Present all day
# Wednesday
Andrew 14:15 - 17:23 (3hrs 7 mins)
So I know I can trigger automations when people arrive and leave. I’m thinking that in Node-RED I could set a context variable for the arrival time for each person, and then when they leave I can get both timestamps and create some kind of record, but where? Is there an event log I could write that to, and how might this be queried to create the report widget?
Anyone seen anything like this before, or any tips on where to start?
Update: so I have been playing around with custom components have have hacked together a fork of logbook-card, which fetches events from the history API and displays them as above. I’ve also made a heatmap-style thing for tracking my Gym attendance!
No exactly this level of details as you require, but I made sort of such log to record events that happens at my house. Basically I use 20 input_text entities and script that:
a) rotate entries by one (e.g. value of 19th is copied to 20th, value of 18th is copied to 19th… value of 1st is copied to 2nd) and then
b) set value of 1st with most recent value I want to log.
c) for all events I want to track I added in specific automation call to this script with proper parameter.
Here is the code I use:
I guess it can be done in more elegant way, not such brute force, but I’m using it mostly for debuging, so no need for something more fancy. I hope this might be sort of starting point for you.
I’m a little late to the game here, but I would love to se your code for this. was about to embark on my own journey to make almost exactly this for a habit/chore tracker.