#For grid consumption, cant pick entity with device_class = power

1 messages ยท Page 1 of 1 (latest)

modern lava
#

I tried to set the device_class to energy, but it doesnt seem to save.
Help?

#

I hit "set state" after editing, but it does not save it.

craggy hill
#

that's for modifying states only, not sensor attributes

#

if you want to create an energy sensor from a power sensor you need the integration helper

modern lava
#

is that under add-ons?

craggy hill
#

under settings -> devices and services

#

it's called integral sensor

modern lava
#

Which method should i use?

craggy hill
#

Depends what kind of device it is

#

If its offline for long periods then you want left Riemann sum

#

Otherwise trapezoidal

modern lava
#

Been trying to do something with this... because I need to make the value positive, but I am not getting anything

#

The helper worked.. but setting it as grid consumption entity gave me an error about it wanting a positive value.

modern lava
craggy hill
craggy hill
#

if yes, then it will cause issues with the trapezoidal method

modern lava
#

the number itself is updating

#

but it has that error

robust lodge
#

Don't put quotes in the template editor

#

Remove the first and last " in your value template

#

Anyway what are you trying to do there? You can't change a power sensor to an energy sensor with a template.

modern lava
#

that worked to fix that str error

#

i hope i can

robust lodge
#

no

#

it's completely mathematically incorrect

#

If your power sensor is negative, then you can use a template to negate it, but it's still a power sensor.

#

You then use an integral helper on that inverted power sensor.

modern lava
#

ah ok.. i'll try that...but its good to see numbers now

robust lodge
#

Make that sensor power and W (not Wh), then integrate that, and you'll be good

modern lava
robust lodge
#

no sensor with the word power in it should be there

#

and what sensor is that anyway

modern lava
#

shelly pro 3em

robust lodge
#

(technically that's misnamed, it's grid energy, not grid power)

#

Delete that sensor and make a new one, using grid sensor.positive_grid_power_usage as the source

#

wait for one update from sensor.positive_grid_power_usage and it should get a postiive value and device_class: energy

modern lava
#

all this look correct?

robust lodge
#

erase the sub interval, you don't need it (with fast updating sensors)

#

otherwise it's fine

modern lava
#

I dont think it got the class for energy this time

#

its not listed as an option

robust lodge
#

it will learn it automatically from the source sensor

#

if you give it a device class power sensor, after the first update, it will become device_class energy

modern lava
#

this seems to be logging data and not graphing numbers...

robust lodge
#

show me developer-tools/states for that entity

#

it looks messed up, it should have a line graph

#

not that multicolored thing

modern lava
#

the number the integral is giving out is way lower than the positive grid power

robust lodge
#

Well it would because it's Watt-Hours.

#

If you use 3000 W for 1 hour it will be 3000 Wh.
If you use 3000 W for 1 minute it will be much less than that in Wh.

modern lava
#

the integral vs the positive

robust lodge
#

looks correct to me

modern lava
robust lodge
#

The template is missing device class power

#

You can add that in the template settings

modern lava
#

I thought it had to be set to energy to be usable for grid consumption?

#

the HVAC kicked on and this graph is still basically flat...

#

and this graph looks how i expect

#

well it does say energy now.. but its not in the list as an option yet..

robust lodge
#

The template sensor is the power, the integration of power is energy.

modern lava
#

Do i just have to wait a while before I can use it?

craggy hill
#

all the wrong configs have probably caused issues

#

check dev tools -> statistics for broken sensors

#

I dont understand how this is so much trouble, Q10 in the FAQ tells you exactly what to do ๐Ÿ˜‚

modern lava
#

There was a fix issue warning that showed up under settings

#

after it ran a while.. the data started to work

#

and I can use it now for grid consumption

#

Thanks

#

BTW is there a way to reset the number every night....
Or would that break how grid consumption works?
It seems like that number ever increasing would be confusing if i try use this graph

robust lodge
#

BTW is there a way to reset the number every night....

Utility meter helper.

craggy hill
modern lava
#

Thanks y'all. I guess I have more reading to do ๐Ÿ™‚

versed grove
modern lava
#

there is... but it is giving me very small numbers that dont make any sense

versed grove
#

Can you show us and explain why it doesn't make sense?

I see so many PEBCAK with energy and because of the power vs energy confusion above I can't help but suspect the same here.

modern lava
#

talking about the sensor output for energy.. explain more later

modern lava
#

thats why it doesnt make sense

#

@versed grove

#

even if i look at the one for a specific phase

versed grove
#

As a start I don't see anything wrong. It's only a bit low. What kind of devices does it measure?

#

and as there are tons of people using the Shelly for energy I only see two options. Or de device is defective. In that case I would also certainly not trust the power metering as well. Or it's nog connected the right way. Two very important point is that the Vx input mataches the Cx of the CT (aka, same number). And that the CT is oriented correctly. And the fact you see negative power I put my bet on that ๐Ÿ˜„

#

Or there is a sensor for the other direction as well. But for normal flow it should read positive for both energy and power.

modern lava
#

well when the power entity is showing me number that match what I expect... and the energy entity is showing 0.00xx numbers... doesnt seem right

versed grove
#

The height of the power doesn't need to match with the energy as an important factor is the time. But granted, the energy seems a bit low. But again, tons of people use the Shelly. And as you also have negative power you either have the wrong sensor of installed it wrong. Aka, you ignored basically everything I said ๐Ÿ˜‰

modern lava
#

What did I ignore? forgive me if i did.
I did try to use the energy entity to start with for grid consumption.
I tried to follow the little diagram that came with it, but there was no text that described how to orient the CTs

versed grove
#

The whole fact there is something wrong ๐Ÿ˜„ Did you check any of the given points?

Can you show all energy entities (or all entities all together) of that device?

And it's a while I used a Shelly EM and I don't have a 3EM, but from the top of my head there is an arrow or the marking K-L on it. L should point in the direction of the power flow aka to the load.

And did you verify the CT and the Vx connection do match?

modern lava
#

Whats a Vx connection?

#

lol i guess the returned energy is why that other one is so low

craggy hill
#

you expect active energy to be positive and active returned to be 0?

#

confusing sensor names

versed grove
#

Yep, which makes sense as your power is negative. Aka, the CT is installed backwards