InfluxDB - is it possible to log expressions as well as entities?
-
The reason for my question is a rather long story involving a virtual thermostat on my Hubitat and using InfluxDB and Grafana to graph the state of the thermostat.
The TL;DR version is that it would be helpful if I could send MSR expressions (variables) to InfluxDB. I don't currently see any way to do that, and if it isn't a current capability of MSR it might be useful as a future enhancement.
Long version: I have a rule in MSR that runs every minute to pull the thermostat information from my thermostat's cloud API. I parse the response into global variables, and then update a Hubitat virtual thermostat when those global variables change. I added the x_hubitat_Thermostat entity, along with selected capabilities, to my reactor.yaml in the InfluxDB section, 'default_capabilities', so the changes to the virtual thermostat get logged into the db.
It's working OK except when the API reports that the temperature has reached the setpoint but the system is still operating. For example, in the morning when the heat is turned up, the temp will climb until the setpoint == the temperature, but the system will continue heating for a while afterwards. It's a variable speed/heat system so it continues to run at very low output for quite a while after the temps match.
The issue I'm having is that when the temperature matches the setpoint, the Hubitat virtual thermostat switches to idle mode on it's own, despite the fact that the API is still reporting heating mode. When the virtual device sees that the setpoint has been reached, it automatically changes to idle, which makes sense as that's how you'd want a real thermostat to work .
I am working around this by having the rule that updates the temperature on the virtual device also update the operatingState. This fixes it, but for just a few milliseconds the virtual thermostat switches to idle before the rule sets it back to heat, and that state change shows up in Grafana.
If I could just directly log changes to the expressions to InfluxDB I could avoid the issue and get the same data into the database. Also I can see other applications for something like this with other APIs where MSR and InfluxDB could be used to log data without having any virtual device entities involved.
-
Not currently possible, but I'll add it to the wish list.
-
Checking in on this, because I'm still struggling with getting this data logged. My other option is to set up a logger in NodeRed where I already have all the data coming over by MQTT, and I would have to set up the database connection and queries to push the data over from there. How far down on the wish list is this? If it's not anywhere near the top, I will probably try the NodeRed route.
-
Now possible through VirtualEntityController.
-
T toggledbits locked this topic on