InfluxDb doesn't receive data when I am off

Hello everyone, I am newer in Home assistant. I did my installation and everything workfs fine. I love grafana so i use it with influxDB to make some graphics of consommation or sensor.

However, when I’m not connected to home assistant with my pc, tablet or phone, InfluxDb doesn"t receive any data so this is useless. I need to be on the interface to receive data and display it on grafana. Anyone know this issue and how can i resolve it ? I send you a picture of a switch which receive data when I’m on.

Can you please show your influxdb configuration in Home Assistant? How did you set it up? Do you use the add-on or do you have a separate influxdb sonewhere that you point HA to?

I use the add-on.

influxdb:
  host: a0d7b954-influxdb
  port: 8086
  database: homeassistant
  username: homeassistant
  password: XXXXXXXXXXX
  max_retries: 3
  default_measurement: state

Configuration add-on :

auth: true
reporting: true
ssl: false
certfile: fullchain.pem
keyfile: privkey.pem
envvars: []

Looks correct to me. But I don’t understand your Grafana chart. Are you plotting the mean of a switch? A switch is either on or off, so I don’t think it makes any sense to plot the mean of this, but probably I juwt don’t understand your chart :upside_down_face:

1 Like

No it’s for the example. I have the robot and i follow his battery percentage and the result is the same. If I’m not on Home assistant. I don’t receive any values

That sounds really strange. Do you get history data for this robot in Home Assistant?

How can I check that ?

When you click on the entity, there should be a popup showibg history and other info.

Yes I only have the status historic : on his base by example

I have a feeling I know what is going on. It’s not that InfluxDB isn’t receiving data when you’re not on the HA frontend, what’s most likely happening is that your devices aren’t changing state that often, so InfluxDB doesn’t get updates. Basically, (as I understand it), when an entity’s state doesn’t change, HA doesn’t send any updates to InfluxDB.

As an example, the battery level on a device may not be reported or changed for 12+ hours (the device determines when it sends a battery level update to HA) and I’ve seen some devices that only report their battery status once every 24 hours. So, HA won’t send any update to InfluxDB and you’ll end up with gaps in your graphs. The easiest way to account for this is to pad the data in your query using fill(previous) or fill(none) in your where clause.

The other thing you can do is check the InfluxDB logs to see if requests are actually being sent using the command sudo journalctl -u influxdb.service.

2 Likes

Thanks a lot for this response. That is a possibility in fact. I will launch my robot and see if battery level decrease. Thanks a lot for your time.

2 Likes