Statistics Graphing - inconsistencies

Ok having had the Node Red Companion having issues sending data from Node Red back to Home Assistant (ie keeps changing the name of the device, ie increments its name by adding a +1 on the end ie CH-DeltaT becomes CH-Delta_1 then CH-Delta_2 and breaks automations and Dashboards moved to something, hopefully, more stable.

ie Export data from NR to MQTT and then add the sensor into configuration.yaml

Seems to work, I can check the state and they are getting updated.

I can use them in Dashboards for small graphing but not Statistical graphing

Look nice but these sensors don’t appear to exist for statistical graphs - Home Assistant just declares these sensors non existent.

Is there something else I need to add to configuration.yaml than

      
    - name: "CH-EnsuiteDelta"
      state_topic: "NodeRed/hass/Tado/CH-EnsuiteDelta"
      unit_of_measurement: "c"

To enable the bigger graphs or is this a limitation of importing data from mqtt?

Any ideas much appreciated

Your sensors need a correct state class if you want to generate LTS (long term statistics).

It is also best to add the correct device class but c is not a unit of measurement recognised by home assistant device classes so that needs fixing too:

    - name: "CH-EnsuiteDelta"
      state_topic: "NodeRed/hass/Tado/CH-EnsuiteDelta"
      unit_of_measurement: "°C"
      device_class: temperature
      state_class: measurement
1 Like

Ok so updated to this

mqtt:
  sensor:
    - name: "CH-DeltaT"
      state_topic: "NodeRed/hass/CH-DetaT"
      unit_of_measurement: "°C"
      device_class: tempereature
      state_class: measurement
      

And get this error

Failed to reload configuration

Validation error: Invalid config for 'sensor' at configuration.yaml, line 43: expected SensorDeviceClass or one of 'date', 'enum', 'timestamp', 'absolute_humidity', 'apparent_power', 'aqi', 'area', 'atmospheric_pressure', 'battery', 'blood_glucose_concentration', 'carbon_monoxide', 'carbon_dioxide', 'conductivity', 'current', 'data_rate', 'data_size', 'distance', 'duration', 'energy', 'energy_distance', 'energy_storage', 'frequency', 'gas', 'humidity', 'illuminance', 'irradiance', 'moisture', 'monetary', 'nitrogen_dioxide', 'nitrogen_monoxide', 'nitrous_oxide', 'ozone', 'ph', 'pm1', 'pm10', 'pm25', 'pm4', 'power_factor', 'power', 'precipitation', 'precipitation_intensity', 'pressure', 'reactive_energy', 'reactive_power', 'signal_strength', 'sound_pressure', 'speed', 'sulphur_dioxide', 'temperature', 'temperature_delta', 'volatile_organic_compounds', 'volatile_organic_compounds_parts', 'voltage', 'volume', 'volume_storage', 'volume_flow_rate', 'water', 'weight', 'wind_direction', 'wind_speed' for dictionary value 'device_class', got 'tempereature', please check the docs at https://www.home-assistant.io/integrations/mqtt

Then I spotted the test you put into it to see if I was paying attention :slight_smile:

Many thanks for your help here

Spelling mistake:

Should be temperature

OK most appear to be working, or at least Home Assistant not complaining about them

Will start staying to create statistical graphs

Thanks for all your help!