Feed expiry time?

Hi Folks,

Wondering if there is a way to set a value in a feed after a specific time where it hasn’t been updated. In other words, expire the data.

For example if my solar logger stops working (it uses MQTT to update emonhub inputs which then logs to a feed), I would like the PAC to go to zero. Similarly for other feeds.

My use case here is I read the feed data from emonhub into other things (openhab and load management software) and of course use the current export watts as PV_DIVERT input to openevse EV charger. If my logger software feeding emonhub stops for any reason, I’ve had scenarios where openevse thinks the sun is shinning and merrily charges the car on peak rate electricity as it is always reading the last logged value from the feed.

Openhab has an ‘expire’ option for most data it stores, wondering if there is a way to do this in emonhub?

Hello @alandpearson do you mean emoncms rather than emonhub? If so the only thing that I can think of that might work is if you can make use of the time last updated, but not sure if that’s going to come through to Openhab? does openhab use the emoncms feed/list.json API?

Thanks Trystan, I do mean emoncms.
I have openhab using the API to get the data and then post process the JSON response to extract the JSON value field. However having it also extract the time and then work out if it was stale is a bridge too far for me in Openhab3 (let’s just say the documentation is very bad).

In thinking about this, I may be missing the obvious… instead of querying emoncms and getting the FEED data, I could just grab the MQTT input directly (no emoncms involvement) and set openhab expiry on that. That would solve the problem for all but the openevse use case which does not have (or seem to implement at least) the concept of an expired reading for PV. The downside of this is it could miss any processing I perform on the input before it logs the final data to a feed.

Thanks for your reply, it has helped me think about the problem differently.

If you are sending the data from the logger by MQTT, why not simply get OpenHab to read that MQTT feed?

I use HA and I test the last updated property to check for stale sensors.