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

Shelly 3EM, PlugS, Plus PlugS, PM MINI Gen3 - added model ids, discov… #2902

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

michalk-k
Copy link
Contributor

@michalk-k michalk-k commented Jan 6, 2025

No new measurements per se.
Changes to already existing profiles (not power measurements)

All devices get:

  • alias containing model id
  • discovery_by attribute
    • mini pm gen3 -> device
    • others entity (unchanged behavior)
  • only_self_usage attribute
    • mini pm gen3 -> true
    • others false (unchanged behavior)

on top of that:

  • mini pm gen3 - removed fixed_config entry since not needed
  • Shelly Plus Plug S - added V2 to the profile (as aliases). The manufacturer reports changes in mechanical properties only. We can separate them once someone measures V2

PS. If you don't mind, I reordered attributes to group them by the meaning

"device_type": "smart_switch",
"calculation_strategy": "fixed",
"only_self_usage": false,
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs to be true for smart switches with built-in powermeter. See https://docs.powercalc.nl/library/device-types/smart-switch/#smart-switch-with-built-in-powermeter

Copy link
Contributor Author

@michalk-k michalk-k Jan 7, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shelly 3EM has 4 clamps for phase measurement, and on top of that, it has a relay. This relay is not equipped with measurement capabilities. Hence we should add an option to the user to add fixed consumption.

Note, I didn't change smart_switch into power_meter intentionally. Not even provided profiles (even though we were discussing such an option). I decided that based on the fact, that the relay is an integral part of the Shelly 3EM, it's discovered by core HA integration as well as Shelly MQTT Discovery script. If the maintainer who is configuring it via yaml (like me) wants to use the full capabilities of PowerCalc, it should add a switch to the device.
Otherwise, we would face a lack of feature, in case such a user decides to add the switch later - we have no configuration flow to change the profile alone.

IMO it's cleaner to make this requirement from the beginning.

This device however decides to re-measure, to distinguish self-consumption with and without relay on. I'm gonna do that in the near future, since right now I have both my 3EMs installed in the switchboard (planned to be replaced by Pro 3EM)

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see and agree, need to give it some thought.
This device does have only 1 switch entity in HA, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

correct

profile_library/shelly/Shelly 3EM/model.json Outdated Show resolved Hide resolved
profile_library/shelly/Shelly 3EM/model.json Show resolved Hide resolved
profile_library/shelly/shelly plug s/model.json Outdated Show resolved Hide resolved
profile_library/shelly/shelly plus plug s/model.json Outdated Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants