Utility Meter as source of Solar Production in Emergy Dashboard

I have a measurement of the power in W being generated by my Solar PV which I want to use in my Energy Dashboard. I have created a Utility Meter using the helper called Solar_PV_Energy_today. This doesn’t show in the “add Solar Production” dropdown box. It has attributes:

last_reset: 2022-10-21T etc 
device_class: *missing*
state_class: total_increasing

I have read in another post here from @tom_l that in order to be used as for Solar Production these have to be:

last_reset: 1970-01-01 etc
device_class: energy
state_class: measurement

It just seems bizarre that I can’t use an HA generated utility meter as a source here. Any ideas?

You can’t use power sensors (W or kW) with the utility meter. It has to be an energy sensor (Wh or kWh).

If you don’t have one you will need to integrate your power sensor to get an energy sensor with this:

Use method: left

Thanks @tom_l .
I’m not trying to use the power sensor. I am trying to use the Utility Meter that I created from it.
But your right that the auto generated Utility Meter has
unit_of_measurement: W
which is probably another reason I can’t use it as well as the other wrong attributes.
I don’t seem to be able to create working Utility meters in YAML, so it looks like it’s “hello Herr Riemann”.

Read what I wrote:

I created a new sensor as below:

- platform: integration
  source: sensor.ct_30a
  name: Solar PV Energy hour
  unit_prefix: k
  round: 3
  unit_time: h
  method: left

and although this is in the dropdown list now. this is what I get:
image
However device_class isn’t an available attribute for integration sensors.

What are the attributes of sensor.ct_30a ?

@tom_l . Good question!
Sensor.ct_30a attributes are:

unit_of_measurement: W
icon: mdi:sine-wave
friendly_name: CT 30A

However as this comes to HA by MQTT from an Arduino Nano33 which I wrote the code for, I could change the autodiscovery. What should the attributes be?

Aha! How to define the device_class: energy for a riemann integration sensor?
“…if the source entity has a “power” device_class, the integrated entity will automatically have the “energy” device_class.”

1 Like

Yep. That’s what I was checking. Glad you worked it out :+1:

2 Likes