HandyHat / ha-hildebrandglow-dcc

Home Assistant integration for UK SMETS (Smart) meters pulling data from the DCC via the Hildebrand Glow API
MIT License
231 stars 33 forks source link

Entities units of measurement + more #88

Closed robertalexa closed 2 years ago

robertalexa commented 2 years ago

Hi @HandyHat and @ColinRobbins

A few bits that i found wrong with the entities:

  1. sensor.electric_consumption_today and sensor.gas_consumption_today are missing the unit of measurement (kWh) - this is in the graph image image

  2. same applies to sensor.electric_consumption_year and sensor.gas_consumption_year image image

  3. sensor.electric_cost_today and sensor.gas_cost_today are missing the unit of measurement (currency as per instance setting?) - this is in the graph. This works fine for standing charge entities image image image

  4. sensor.electric_consumption_year_cost and sensor.gas_consumption_year_cost 4.1 have the wrong unit of measurement. For me the graph is showing EUR. This is not the case for standing charge. I must admit that i forgot to change my currency to GBP before installing the integration. Could this be the issue? image image

4.2 Wouldn't the name Electric Cost (Yearly) be better? This will match Electric Cost (Today) image

4.3 They do not have unique_id, so they can't be edited in HA - all the others are fine image image

I am not sure if some of these were by design (or even limitations) or not, so please don't think i am throwing stones. But if they were not by design maybe they have just been overlooked. I know how it is when you stare at your own code for hours, you are starting to miss things.

Let me know if I can be of any further help

Version What version of the integration and what version of Home Assistant are you running? HA 2021.11.5 Integration v0.5.2

ColinRobbins commented 2 years ago

Point 1-4, the units are showing fine for me. This could be related to the point you made about having the wrong units configured at the start.

4.2, changing the name would be a breaking change at this point.

Yes, 4.3 is probably a bug.

robertalexa commented 2 years ago

Thanks for taking the time to reply @ColinRobbins Much appreciated.

Would you suggest that i remove the integration and add it again? Are there any "leftovers" that i need to consider cleaning before the reinstall?

ColinRobbins commented 2 years ago

It depends how much you need any historic data in HA (across all integrations). If you don’t need ANY history data, you could delete the Database, which has worked for me in the past. … take this suggestion at your own risk, I am not a HA expert, and there maybe side effects I am now aware of in your environment.

robertalexa commented 2 years ago

That would be a hard pass :)

I shall go have a play with this and report my findings.

ColinRobbins commented 2 years ago

I can’t track 4.3 down - everything in The DCC integration has a unique ID as far as I can see. Is this sensor created by the HA energy/long term stats?

robertalexa commented 2 years ago

Right so I have reinstalled everything, got new sensors and set the up the energy as per our discussion on the HA forum.

Points 1 to 3 are still happening, and hopefully I am not misunderstanding them. What i mean is that the unit of measurement does not appear on the graph. But this might actually be a frontend issue because when i inspect the entities i can see the correct information. So possibly scrap this, issue might be with HA. image

The entities at point 4 have not yet been recreated by the integration. I am guessing instead of being created at the time of the integration install, they get created further down the line? image

So i can't validate my points above based on this. I will give it some more time for the entities to hopefully be created? I do not know for sure who created these entities, earlier they belonged to the meter devices, so i am guessing the integration does that rather than HA, but you would know this much better than me? If it is the integration, would it not be better for the entities to be created right from the get go, and have a value of 0 initially? Also, these entities are not mentioned in the Readme, making it even weirder:

image

But they are the entities which if renamed will create a breaking change, so i assume they belong to the integration indeed

ColinRobbins commented 2 years ago

The sensors you are showing here are the only ones created by this integration. Any other sensors are created by the Energy integration. They all have ‘unit_of_measurement’ set as far as I can see. On my system the units show up in the graph too.

robertalexa commented 2 years ago

Any other sensors are created by the Energy integration.

Right, i understand what you mean. Was not aware of that :)

Weird about the unit of measurement not showing on the graph. Not due to screen size or selected theme.

I will close this issue as it is clearly far off from what i first wrote. Should I discover more about the graph scale i will make sure to let you know.

Sorry to have wasted your time with this, i appreciate your help

ColinRobbins commented 2 years ago

No problem, and “no waste of time”, it all contributes to our understanding of how all this works!

robertalexa commented 2 years ago

Hey @ColinRobbins

Just found another one, but can't figure out if this is an integration issue or a Frontend issue (i am inclined towards the Frontend)

If I add either sensor.gas_tariff_rate or sensor.electric_tariff_rate in a entities card in Lovelace, i get a console error (everytime the entity is loaded in the view)

image

I was wondering if this is happening at your end too?

LE: of course the currency code looks right, this led me to test both energy and gas entities, thinking that it might be only the gas one, given HA still is working multi unit tracking. But turns out both of them are affected

LE2: my suspicion might be relating to the number of decimals, but I am not 100% sure. maybe the fact there are 4 decimals is throwing lovelace off

ColinRobbins commented 2 years ago

Fixed by PR https://github.com/HandyHat/ha-hildebrandglow-dcc/pull/77