Hi,
we are using the influxdb component to register all our sensors data to database.
That works fine and is pretty cool!
The problem is with the influxdb measurement names generated.
Measurements names are generated equal to sensors ids; sensor ids are named by ha with a ‘sensor.’ prefix generated under the hood.
That generates a problem trying to querying influxdb data, because influxdb interprets the ‘.’ character as a policy to measurement separator.
Example:
-
In ha, I create a sensor.froniusinv_getapiversion_apiversion sensor
‘froniusinv_getapiversion_apiversion.’ is created by me;
‘sensor.’ is added somehow under the hood by ha; - The influxdb component creates a sensor.froniusinv_getapiversion_apiversion influxdb measurement and takes care of populating it with the sensor data.
- In influxdb, when I try to query ‘SELECT * from sensor.froniusinv_getapiversion_apiversion’, I get a ‘Server returned error: retention policy not found: fronius’ error.
How can I prevent this?
Can I intercept the ‘sensor.’ string generation in ha and change it let’s say to ‘sensor_’?
If yes, how could I implement this?
I tried to figure it out, but I could not find where and how to do it.
Or what other option do I have at my disposal?
Thank you very much,
Andrea