Update intervals for sensors

Hi all,
I have home assistant supervised running on rasbarian on pi4. I have an issue with update times for my sensors when I look at the state history some are 20mins old. Both mqtt and esphome are doing this.
Any ideas on what would cause this, is this normal if it don’t specify update time. I never have and they used to stay pretty close say no more than 1 min.
Thanks
Paul

Are the values actually changing?

Do you have any errors in your log?

Specifically database errors.

Yeah the value is changing I’ve been having issues with the data base after I added a ssd I re installed rasbarian and restored from my google drive backup. Few days after I had database corruption. I installed mariaDB and it started working again.
This in logs : (not sure what it’s about)

Log Details (ERROR)
Logger: homeassistant.components.websocket_api.http.connection.2773611952
Source: components/websocket_api/http.py:98
Integration: websocket_api (documentation, issues)
First occurred: 3:52:13 PM (1 occurrences)
Last logged: 3:52:13 PM

Client exceeded max pending messages [2]: 512

ESPHome sensors have a setting for that.

force_update ( Optional , boolean): If true, this option will force the frontend (usually Home Assistant) to create a state changed event when the sensor updates even if the value stayed the same. Some applications like Grafana require this when working with Home Assistant, but beware it can significantly increase the database size. Defaults to false .

Yes I have used that option in esphome for a some sensors. What is the default action if you don’t though? Only update when they change value?
What about the mqtt ones that come from tasmota do I need to force them to update too?

I believe so. :roll_eyes:
It doesn’t say so specifically but that is what I believe.

Have no clue.

That depends on the integration. If you look to the right hand column of an integration’s documentation page you will see things like, cloud polling, local polling, local push etc…

Polling integrations have an interval hard coded (30sec or so usually).

Push integrations only update when there is a change. Much more efficient, and faster to respond.

Still doesn’t explain why I have sensors that are 20mins old. Not going to be great for a thermostat.
Found this in the mosquitto logs: (there’s lots of them)

1589601459: New client connected from 192.168.20.25 as DVES_8798D3 (p2, c1, k30, u’Pas940’).
1589601505: Socket error on client DVES_8798D3, disconnecting.

That’s your problem. The broker is not accepting update messages from the clients.

Any idea what a socket error is? It works sometimes like up dates every 5 to 20 odd minutes. If I send a message to it, it responds instantly.

The client is not configured to connect correctly.