External Python script data to HA InfluxDB

Hey guys,

I am tracking outside, as well as room temperatures and implemented some logic to control HVAC and window covers accordingly. Since HA does not allow for imports in scripts and my HA is running dockerized on a RaspberryPi, I decided to externalize some aspects of my smarthome.

More specifically, cron is triggering the script that tracks outside temperature, calls HA API to compare to room temperatures, shuts covers via Shelly API, sends notification to Discord, etc.

The next step for me would be to store longterm weather information and be able to downsample it. Currently I have Prometheus in place, however for downsampling Id have to go with a real Timeseries Database more than a monitoring tool, like Influxdb.

So at the moment I am trying to figure out how to write outside temperatures into the same measurement (?) as room temperatures. Reason being, is that I want to see both in the same graph in Grafana.
Does anyone know how HA is writing to influx? Via Telegraf? Is it even writing, or is Influx pulling? IoT class says local push, which seems a bit odd tbh.
Also, if I had a script that writes to Influx, wouldnt it be off sync with the sensor data from HA? Is that a problem, or can I have them sychronized somehow?

Thank you for any help!

You might be confused between the influxdb integration, that pushes states to the db, vs. the influxdb sensor, which pulls data from influxdb to feed sensor states.

The plain InfluxDB http API is used.

Thank you for your reply. I actually had the influxdb integration in mind. So the integration gets pushed to, making it “local push”. Take for instance a shelly roller shutter. Its also considered local push however, it promotes its status “pushing” to HA. Isnt one of them the wrong way round then?

In the meantime I had a look at the github repo and at my local deployment of HA. I wanted to find the connection between configuration.yaml and integrations in order to better understand how HA interacts with influx. So I searched through it locally in VS Code for the term “prometheus”, since I have it running. To my surprise though, the only place where this turns up is in my configuration.yaml?