LordMike / MBW.BlueRiiot2MQTT

Utility to map between Blue Riiots pool API, and Home Assistant MQTT
47 stars 2 forks source link

Occasional long update delay #60

Open danps1 opened 3 years ago

danps1 commented 3 years ago

I have your cloud polling/mqtt integration set up and working well - thanks very much for writing it! I have been tracking the “measurement delay” - the time between the reading being taken, and then showing up in MQTT / HA. On the whole it is less than 2 minute which is great, but occasionally it takes MUCH MUCH longer…

My guess is that the integration has polled just before the reading is taken, and then doesn’t retry again for quite some time? Is there some change that I could make to have this retry much sooner if there isn’t any updated value? Thanks Dan

LordMike commented 2 years ago

Could you be in a location with bad sigfox reception?

If that's the case, it could be that your BR device is missing its own checkins, meaning this updater will miss it too.

I believe the logic from me is that if an update is missed, then the tool will retry and gradually back off with increasing delays. So if I understand all this correctly - your device must not be making an update.

If you want to troubleshoot more, set this environment variable, and get me the logs on the next missed update :)

LoggingMinimumLevelMBW.BlueRiiot2MQTT.Service.PoolUpdater: Debug

danps1 commented 2 years ago

Hi, I'll set up the debug logging and see if I can capture what is happening. Just a quick comment on the sigfox reception - this is not at all impossible that I have bad signal, but I don't think is the issue here. The "measurement delay" that I am showing the the graph above is essentially the delta between the timestamp on the measurement, and the now() when the mqtt update is received. I think the issue could be related to the retry algorithm you mention, because if I force a sync or restart the add-on, I can get the value from the blueriiot cloud to sync quicker. Will attach the logs once captured. Thanks!

danps1 commented 2 years ago

Sorry - quick question - I am running the HASSIO Add-on - is there a way to set the logging level on there, or should I be setting up a seperate docker container instead?

LordMike commented 2 years ago

There's no way on the HASSIO container unfortunately.. :/