Import InfluxDB data as sensor in Home Assistant

I tried the same thing and came to the conclusion that this all does not work, by definition. A sensor can only have one single state, not a history. The docs read:

The influxdb sensor allows you to use values from an InfluxDB database to populate a sensor state.

“A” sensor “state”. Meaning you cannot create a history within a sensor. The sensor creates history itself via HA’s history function. AFAIK there is no function yet to retrieve history from other sources that the in-built HA history that itself writes the influxdb long term history.