Unit of measurement - help

Just reinstalled hassio after a break of 6 months - must admit it was so much easier this time round.

I’m struggling with one of my RFXTRX sensors - the owl electricity monitor is showing but I can’t seem to give it a UoM.
I’ve tried customize.yaml and added device_class: power, unit_of_measurement: W
Also tried adding the above to config.yaml
Also tried using the set state function
All I need is a graph card to work

Any help much appreciated - I have spent many hours trying to do this!

Peter

customize should have worked…

What is the output state of your energy monitor (in dev tools > states)? Is it just a number?

Can you post your RFXTRX config and your customize section for it here?

Wow Jim - that was quick!

See screenshots…customize rfx config

Make Power lowecase in your configuration.yaml :slight_smile:

and same for ‘Unit_of_measurement’

Pretty much everything in HA is case sensitive.

Hi Jim,

Thanks for your help - hope all is well for you during lockdown.

Changed to lower case w in customize but config.yaml doesn’t accept UoM. Still not working.
I also think the ‘power’ thing is not meant for a sensor - I think it’s to detect power at a switch.
The electricity monitor isn’t a binary sensor I expect.config not valid

Oh, sorry.

I meant change “Unit_of_measurement” to “unit_of_measurement”. Leave it as a capital ‘W’.

Even with lower case u and uppercase W still get the config.yaml error.

I tried deleting the entity and re-finding it via automatic_add true but still no joy.

I changed the customize to the upper and lower case as you suggested and it shows ‘w’ now on the badge but the history graph is still just showing the coloured bar - as before, not a graph.

Thanks again - but to be honest it’s not that important for me at the moment, I’m still learning and at least the gauge works!

OK just checked again and it seems to be working! Although I’ve now got the colour bar AND a graph!

graph and gauge

Thanks Jim.

1 Like

I believe that after a while it will settle down to just one type of graph.

Thanks Ahmad

Yes it did! - just the colour bar unfortunately!

that most likely means that HA doesn’t see unit of measurement.

after reading the docs it should be enough to add data_type: Energy usage (or Total usage).
if it does not work as expected, open a new issue on Github.
in the meantime, create a template sensor that returns state of your sensor and add

device_class: power
unit_of_measurement: W

Thanks Ahmad, I will put this issue on hold for the time being, it’s not that vital to me at the moment.
It’s still very ‘flaky’ - works sometimes with a graph but the graph only shows the last few minutes. It did really slow my HA down dramatically, not sure why - when I deleted the card HA speeded up.

I really appreciate your help, I think I need to learn more. If I find a solution I will post it here.

strange. can you post your card’s config?

Sorry Ahmad - I deleted the card so the config is gone