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

Implement auto populate multi switch entities #2876

Merged
merged 2 commits into from
Jan 2, 2025

Conversation

bramstroker
Copy link
Owner

No description provided.

@github-actions github-actions bot added documentation Improvements or additions to documentation enhancement New feature or request powerprofile labels Jan 2, 2025
@bramstroker bramstroker added config-flow enhancement New feature or request and removed documentation Improvements or additions to documentation enhancement New feature or request powerprofile labels Jan 2, 2025
@github-actions github-actions bot added documentation Improvements or additions to documentation powerprofile labels Jan 2, 2025
@bramstroker bramstroker merged commit cbd20e1 into master Jan 2, 2025
14 checks passed
@michalk-k
Copy link
Contributor

michalk-k commented Jan 2, 2025

@bramstroker I went through changes to find out how should the profile configuration for such a multiswitch looks like and how it works. Kudos to you for updating the documentation.

I found it in docs but it's not exactly explained how to interpret that:

"multi_switch_config": {
    "power": 0.8,
    "power_off": 0.25
  },

Could you elaborate, please?
I have measured Shelly 2.5.
It's consumption is:

  • 0.01W constant self-consumption
  • 0.00325W for each relay turned on. It has two relays.

So with one relay on the total consumption is 0.01 + 0.00325 = 0.01325W, for both relays on = 0.0165W

How should it be reflected in the new configuration section? how does it correlate with standby_power profile attribute?

@bramstroker
Copy link
Owner Author

Also have a look here:
https://docs.powercalc.nl/strategies/multi-switch/

You might try:

"standby_power": 0.01,
"multi_switch_config": {
    "power": 0.00325,
    "power_off": 0
  },

Or:

"multi_switch_config": {
    "power": 0.00325,
    "power_off": 0.005
  },

I think I prefer the first solution, but I did not test this configuration yet.

@bramstroker
Copy link
Owner Author

But I don't think your figures are correct, as all the shelly's at least consume 0.5W in standby.
As it are WiFi devices and typically these radio's consume more than zigbee and zwave.
0.5 at least.
Relay's typically also consume 0.3+ as long as it are no solid state relays, which I don't think the shelly 2.5 are.

@michalk-k
Copy link
Contributor

I would also prefer the first configuration. If both gives the same result, the first one is more self-explanatory.

Regarding the consumption of Shelly 2.5, thanks for the heads-up. Of course, those are bad numbers. I gave you current, instead of power. Just copy-paste error.

@michalk-k
Copy link
Contributor

@bramstroker let's update S2.5 values and discuss something.

So, standby power is 0.677W, then 0.324W per relay.
I assume we agreed on following representation:

"standby_power": 0.677,
"multi_switch_config": {
    "power": 0.324,
    "power_off": 0
  },

Just a note, that this is kind of not consistent with fixed and linear strategies, for example for Shelly 1PM I measured:

"calculation_strategy": "fixed",
  "standby_power": 0.739,
  "fixed_config": {
    "power": 1.0
  },

Note that "power" here represents a total measured power, while in the case of a multi-switch, we are putting the delta values there.
I can bet I saw some attribute that changes the behavior for fixed/linear to be more like multi switch. Anyway... it's something to keep in mind IMO.

@bramstroker
Copy link
Owner Author

bramstroker commented Jan 3, 2025

I did some testing using the preferred configuration but found some issues down the road.
I have fixed them now with #2877. will issue a new version shortly.
Also made the power_off optional, as it's not necessary when defining standby_power for the whole device.

So the configuration will look like:

{
    "standby_power": 0.677,
    "multi_switch_config": {
        "power": 0.324
    }
}

Regarding the inconsistency / example for fixed you gave this is old configuration.
Please see the docs for all the up to date and correct configurations to use now when making profiles for the library:
https://docs.powercalc.nl/library/device-types/smart-switch/
https://docs.powercalc.nl/library/device-types/power-meter/

Notice the addition of "only_self_usage": true which indicates the profile is only used to provide self usage consumption figures.
This will make sure the user is not asked to provide power values for the connected appliance.
Also I plan to utilize this information in the future to add power to the all_standby_power sensor, as it's missing the self usage of devices which are turned on.

I will update the current profiles in the library to all match the configuration examples in the docs and make them all consistent.
But I can only do that after v1.17 stable hit the road, and is installed by most users.

@bramstroker bramstroker deleted the feat/multi-switch-auto-entities branch January 5, 2025 13:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
config-flow documentation Improvements or additions to documentation enhancement New feature or request multi_switch strategy powerprofile
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants