Adding control of data insertion in influxdb

In an attempt to solve my own problems in this thread:

I enhanced the influxdb component to allow me to alter data as it is inserted into influxdb. The purpose is that all the data I may want to visualize in influxdb should be numeric, since it is assumed by both influxdb and grafana.

I added a new configuration option into the configuration.yaml file as follows:


influxdb:
value_map:
- V_STATUS:
- “on” : 1
- “off” : 0
- “climate.my_ecobee3.operation$”:
- idle : 0
- fan : 1
- heat : 2

This has the affect of taking any variable named V_STATUS for any entity and sending ‘0’ when the value of ‘off’ and ‘1’ when the value is on. Additionally it maps the ‘operation’ variable of my ecobee3 such that ‘idle’=> 0, ‘fan’=>1, and ‘heat’=> 2.

I can supply the code, but it needs some cleanup since I don’t yet understand how the config_validation works. I wanted to use wildcards for the keys, and settled on regex, but I’m not sure that is really the best option, since it doesn’t seem consistent with the rest of home_assistant.

Regardless, if there is an interest in the patch, let me know.

Do you still have the code or does it still work? I just found that influxdb doesn’t track the operation state of my Ecobee thermostats. Would love for that data to be available. If you still have the code, I would love to see it.

1 Like