Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow adding a device to the PowerCalc Standard group #2896

Open
3 tasks done
michalk-k opened this issue Jan 6, 2025 · 6 comments
Open
3 tasks done

Allow adding a device to the PowerCalc Standard group #2896

michalk-k opened this issue Jan 6, 2025 · 6 comments
Assignees
Labels
Milestone

Comments

@michalk-k
Copy link
Contributor

Checklist

  • I have filled out the template to the best of my ability.
  • This only contains 1 feature request (if you have multiple feature requests, open one feature request for each feature request).
  • This issue is not a duplicate feature request of previous feature requests.

Is your feature request related to a problem? Please describe.

Working recently with self-consumption, I found that in a lot of cases, single appliance might have provide multiple power/energy sensors.

For example: a dumb bulb turned controlled by Shelly 1PM.
In such a case we can have:

  1. Shelly self consumption
  2. the bulb consumption measured by the Shelly sensor

Shelly sensor is a member of HA Shelly device.
When adding self-consumption with use of library, PowerCalc integrates this value in form of new sensor into the mentioned device.

So, the devices becomes aggregator of all power sensors measuring an appliance.

What not possible, is to include such a device when creating PowerCalc groups.
To achieve that, group require to add power sensor from the device, powerCalc entity defining self-consumption

It would be nice to be able to add complete device to PowerCalc group

Describe the solution you'd like

Extend the PowerCalc Standard group with the ability to add a device, then use all device power sensors (or energy sensors if selected) for group output.

Describe alternatives you've considered

  1. current state. Works but is confusing, requires more clicks to achieve, and might be error prone (ie adding/remocing only part of energy coming from the device)
  2. adding power/energy sensors to PowerCalc self-consumption entity. It could play analogical function to "constant consumption" attribute already available. But this grouping seems to be redundant to what device provides

Additional context

N/A

@michalk-k michalk-k added the enhancement New feature or request label Jan 6, 2025
@bramstroker
Copy link
Owner

Good idea, but need to have a look at how to do this cleanly, as we add another dropdown to the standard group dialog.
It already contains a lot of dropdowns and configuration possibilities.
So might get more confusing for users.

@bramstroker bramstroker self-assigned this Jan 8, 2025
@bramstroker bramstroker added this to the 1.18 milestone Jan 10, 2025
@bramstroker
Copy link
Owner

Implemented with #3012

@bramstroker
Copy link
Owner

This is part of v1.17.5 btw.
Would be nice if you could give it a test run.

@michalk-k
Copy link
Contributor Author

will take a look. thank you.

@michalk-k
Copy link
Contributor Author

Hello @bramstroker.
Adding PC devices and summing their energy works. However, I encountered an issue after reconfiguring an existing group.
The situation was

  • I had a group summing member powercalc sensors

Image

  • I reconfigured them to use devices

Image

For a reason, total energy jumped by about 2kWh. I found that this is a value equal to the current self-consumption energy of "PC room light" entry, which uses PC library (Shelly 1) and sets up the fixed amount of power consumed by an appliance

Image

The image above shows this change and subsequent change back, made by me with use of a service call.

However, it brings 2 questions:

  1. why self-consumption has been added to previous energy? Shouldn't the member powercalc sensors entry contain this energy already?
  2. Should PC add energy found on device energy sensors to group energy at the moment of adding? I can feel it might have unwanted side-effects. Like huge changes in actual energy state, just by reconfiguration of PC entries.

@bramstroker
Copy link
Owner

  1. why self-consumption has been added to previous energy? Shouldn't the member powercalc sensors entry contain this energy already?

Hard to say with this information if the same energy sensor which has been added now with the devices was part of this group before already.
You can check the exact individual sensors which are part of the group by looking at the state attributes. The individual sensors should be summarized there.
Or use this action: https://docs.powercalc.nl/sensor-types/group/custom/#action-get_group_entities.

  1. Should PC add energy found on device energy sensors to group energy at the moment of adding? I can feel it might have unwanted side-effects. Like huge changes in actual energy state, just by reconfiguration of PC entries.

Powercalc will start with initial state of member energy sensor(s) when starting a new group or adding sensor to a group.
I have very recently added a toggle to prevent that #2979.
When you set this to start at zero it will not add the current member energy sensor amount to the group on initialization but add delta of 0.
I see why this might be unwanted behaviour by default, but this has been the case since the beginning of powercalc group implementation. Might change the default behaviour in the future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants