question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Utility meter for domain group not working

See original GitHub issue

I upgraded powercalc to v0.24.6 from v0.22.something and my utility meter for my lights domain group is now broken. It was previously working fine.

Config:

powercalc:
  enable_autodiscovery: true
  create_domain_groups:
    - light
  create_utility_meters: true
  utility_meter_types:
    - daily

Debug log:

2022-08-04 19:44:52 DEBUG (MainThread) [custom_components.powercalc] Setting up domain based group sensors..
2022-08-04 19:44:52 DEBUG (MainThread) [custom_components.powercalc.sensors.group] Creating grouped power sensor: All light power
2022-08-04 19:44:52 DEBUG (MainThread) [custom_components.powercalc.sensors.group] Creating grouped energy sensor: All light energy
2022-08-04 19:44:52 DEBUG (MainThread) [custom_components.powercalc.sensors.utility_meter] Creating utility_meter sensor: All light energy daily (entity_id=sensor.all_light_energy_2_daily)

I suspect the last line is revealing because sensor.all_light_energy_2_daily does not exist. The correct sensor to use should be sensor.all_light_energy_daily.

The only place I could find reference to the wrong sensor via a grep was in .storage/core.restore_state:

            "state": {
                "entity_id": "sensor.all_light_energy_daily",
                "state": "0",
                "attributes": {
                    "state_class": "total_increasing",
                    "source": "sensor.all_light_energy_2",
                    "status": "collecting",
                    "last_period": "0.4340",
                    "meter_period": "daily",
                    "cron pattern": "0 0 * * *",
                    "last_reset": "2022-08-03T14:00:00.071537+00:00",
                    "unit_of_measurement": "kWh",
                    "device_class": "energy",
                    "icon": "mdi:counter",
                    "friendly_name": "All light energy daily"
                },

Again, that source sensor.all_light_energy_2 does not exist. It should be sensor.all_light_energy. I have tried stopping my HASS docker container then manually editing that source line and removing the “_2” from the entity_id but it does not fix anything and is later overwritten. Looking at the code maybe it is appending “_2” as a utility meter type but I couldn’t parse any more than that by just reading the code.

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:16 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
wigstercommented, Aug 28, 2022

I’ve had the fixed version running since yesterday. Seems to work fine and survive reboots

1reaction
wigstercommented, Aug 24, 2022

Just thought I would add that utlity meters created by powercalc for powercalc light groups work fine, so it seems to be just the domain one.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Active Directory security groups | Microsoft Learn
Learn about Windows Server Active Directory security groups, group scope, and group functions.
Read more >
Fix Active Directory group retrieval issue ... - Cisco
This document describes how to workaround the problem with Active Directory (AD) group retrieval during authentication, while this error is ...
Read more >
Ad Integration - Group list not showing all groups?
Open the registry editor; Navigate to HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Paessler\PRTG Network Monitor\Server\Core; Create a new DWORD key ...
Read more >
Nested Domain Local Groups not Working - OpenText Forums
I am trying to get Teamsite working using Nested Domain Local Groups, and I am having a problem. I created Domain Global Groups...
Read more >
Serv-U domain groups - SolarWinds Documentation
In order for this to work properly, the user must not be locked in their home directory. Select the Administration Privilege for this...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found