-
Notifications
You must be signed in to change notification settings - Fork 0
Description
Today the docker containers running the AmpelController and the SpaceAPI-Service were restarted. Since then the lastchange attribute in the delivered SpaceAPI json is set to the value 1234 which as a Unix Timestamp translates to the obviously wrong 1st of January 1970 at 1:20 am. This is the same value we get as retained value from the MQTT broker in our current setup. Not sure how it got there, but the SpaceAPI service picks it up and happily puts it into the json output (see attached file). I suspect the problem to be the AmpelController, which has no lastchange value to publish until the first actual change happens.
Consumers of our spaceapi record display that value, e.g. like this:
Several options to solve this were discussed already:
- persist the lastchange value over application restarts, maybe in a cache file?
- publish certain values like lastchange with a retained flag to MQTT
- (only publish those values as retained on app shutdown, otherwise normally)
Maybe some other solution is possible?
Attachment: spaceapi.json