Line voltage in Home Assistant not in recorder

@enbickar FYI

I noticed that the L1 and L2 line voltage sensors are not in the recorder and thus not in the statistics card.
Looks like several of the Sense sensors are not associated with the Sense, and not in recorder.

Any ideas on how to add them to Recorder?

If I had to guess I’d say the integration is missing the required attributes: Sensor Entity | Home Assistant Developer Docs

Reason for asking is my UPS’s started alerting me that the voltage is too high, looks like occasionally I get 127V+ where 127V is the acceptable top end. I was looking in statistics, and could not find any history recorded for L1 and L2.

@pieter ,
That’s weird. L1 and L2 are offered up as Entities from my Sense integration, with full histories. Nothing custom. Maybe a version thing ?? Are you up-to-date ?

I actually have 2 sets of L1/L2 because I have 2 Sense monitors in my home.

The history is there in HA

@enbickar, it would be really nice to have built-in support for frequency as well, but I do understand that HA doesn’t have many sensors that output in Hz units.

Yes, same here, but the entities are not available in statistics.

Try to add a “statistics graph”, or go to [developer tools][statistics], and notice that the sensor values are missing.

In the code looks like the sensor does not have the required attribute “measurement” state class.

I temporarily worked around it by manually adding the entities:

# Sense Voltage Measurement
# https://www.home-assistant.io/integrations/statistics/
# https://developers.home-assistant.io/docs/core/entity/sensor/#long-term-statistics
# https://www.home-assistant.io/integrations/sense
- platform: statistics
  name: "Sense L1 Voltage Mean"
  entity_id: sensor.l1_voltage
  state_characteristic : mean
  max_age:
    days: 31
- platform: statistics
  name: "Sense L1 Voltage Max"
  entity_id: sensor.l1_voltage
  state_characteristic : value_max
  max_age:
    days: 31
- platform: statistics
  name: "Sense L1 Voltage Min"
  entity_id: sensor.l1_voltage
  state_characteristic : value_min
  max_age:
    days: 31
- platform: statistics
  name: "Sense L2 Voltage Mean"
  entity_id: sensor.l2_voltage
  state_characteristic : mean
  max_age:
    days: 31
- platform: statistics
  name: "Sense L2 Voltage Max"
  entity_id: sensor.l2_voltage
  state_characteristic : value_max
  max_age:
    days: 31
- platform: statistics
  name: "Sense L2 Voltage Min"
  entity_id: sensor.l2_voltage
  state_characteristic : value_min
  max_age:
    days: 31

No data yet, so not sure how it would graph?

1 Like

Sorry, Thanks for the clarification.

I’ll have to try using the statistics dashboard Lovelace template in HA. Generally I do the statistics work in InfluxDB or Grafana because the scripting and builtin are better and more flexible in those.

FYI, for tracking: Sense sensors not recording in statistics · Issue #92915 · home-assistant/core · GitHub

1 Like

Looks like you took care of it, thanks for that!

Yes, my first PR for HA, do I just wait for the merge, or anything more to be done for approval?