Climate thermostat's not tacked in Influxdb

First the formalities:
Hi I am Arendal. New to this forum (first post!) and relatively new to Home Assistant.
I am immensely grateful for the wast amount of documentation and user contributions in this forum - It really made it easy to start using Home Assistant on quite an advanced level.
Thanks!


Now on to my problem I have not been able to find a solution for in the documentation nor this forum.

The last couple of days I have been playing around with influxdb.

I started out by using the import script $ hass --script influxdb_import ... to import data from my database.
Everything went smooth and I used it to get to know Chronograf and Grafana. Once satisfied with the interface I dropped and recreated the database in Influxdb and put the following configuration into the home assistant configuration:

influxdb:
    host: localhost
    port: 8086
    database: home_assistant
    username: hass
    password: !secret influxdb_password
    max_retries: 10
    tags:
        source: hass

After a restart of home assistant data started to flow into Influxdb. But I could no longer see my climate.thermostat’s which were there when I used the import script.

I am still a n00b when it comes to Home Assistant but I took a look in the Influxdb-component code and it looks like it only “records” state change events.
Looking at my climate.thermostat device:

{
    "current_temperature": null,
    "min_temp": 7,
    "max_temp": 35,
    "temperature": 16,
    "node_id": 2,
    "value_index": 1,
    "value_instance": 1,
    "value_id": "72057594076774418",
    "old_entity_id": "climate.danfoss_z_thermostat_heating_1_2_1",
    "new_entity_id": "climate.danfoss_z_thermostat_heating_1",
    "unit_of_measurement": "°C",
    "friendly_name": "Bedroom Thermostat",
    "supported_features": 1,
    "icon": "mdi:radiator"
}

I see it has no state - and probably therefor also no state changes. Could this be the issue?
And if it is, how can I fix/work around this?

As a side-note the Danfoss thermostat does report the current_temperature, only the temperature setting it is on.

I hope I have supplied enough information for you to be able to help me.
Thanks in advance

I’m having the same issue. Importing the DB lets me access the temperature field via Grafana, but no new values are stored.

Is a “virtual” sensor the only solution?

Hi @sibbl

I am afraid so. The influx component is not a recorder component and therefor it only listen to state changes.
and by state change I mean an event with a state property that has changed.

So yes, I you want to “record” events that is not at state change you have to create some kind of proxy.
I have not gone down this road yet. So I have no experience to share I’m afraid.

Regards Arendal

I played around to get it working yesterday. For now I use a template sensor and filed an issue as manually overriding the state to work some while ago: https://github.com/home-assistant/home-assistant/issues/12482

Hi,

Any progress on that?
I have several Danfoss (or Popp or Devolo) thermostats that have the same problem. But I have also 2 Eurotronic devices that appear in influxdb while they do not have state neither (even if it seems HA assimilates state to their hvac_mode.