Dashboard - Display timestamp of last matching value

I have created a feed which records users WiFi presence sent from node-red as described here: presence detection

This all works and I have created a dashboard which shows family members presence in the house via a chart and an LED widget (Green if at home).

 

What I would like to do though is display the timestamp when the feed value was last "1", meaning when they were last home. I could drill down into the chart and figure this out but would be good to easily see when each of us were last at home.

 

I can't find anyway to display custom text like this with a calculated value in a dashboard, any help appreciated I'm very new to emoncms.

ukmoose's picture

Re: Dashboard - Display timestamp of last matching value

Steve,

I can't think of a way of doing this in EmonCMS at the moment.  But you could do it in Node-red.

If you look at the documentation http://nodered.org/docs/writing-functions.html and look at the Global Context section.

You could store the time when status is 1 for each person e.g. context.global.status.bob

and then use a separate " http in > function to call context.global.status.* > http  out " flow to create the page.

 

 

One thing for iPhone users to note is that the presence detection doesn't work for iPhones as the wifi is switched off if not used to save battery power.

 

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.