main
← Terdious:Added-support-for-shellypro3em-triphase
opened 08:59PM - 03 Jun 25 UTC
# [shelly] Add full support for Shelly Pro3EM in three-phase mode
## Descript…ion
This PR extends Matterbridge's support for the Shelly Pro3EM by adding full three-phase (triphase) support.
It builds upon the previous work for monophase (see [#38](https://github.com/Luligu/matterbridge-shelly/pull/38)), and now enables:
- **Automatic detection and handling of three-phase Pro3EM devices**
- **Separation of each total, phase and neutral as individual PowerMeter components** (`em:0`, `em:1`, `em:2`, `em:3`, `em:4`)
- **Correct mapping of all phase-prefixed properties** (`total_`, `a_`, `b_`, `c_`, `n_`) for both power and cumulative energy
- **Consistent update logic** for both real-time and cumulative data, matching the 3EM behavior
- **Backward compatibility** with monophase and other Shelly devices
## Details
- The code now parses the single object returned by Pro3EM in triphase mode, splitting it into five virtual components (total + one per phase + neutral).
- Updates and status are mapped to the correct component, ensuring UI and API consistency.
- The component IDs remain stable (`em:0`, `em:1`, `em:2`, `em:3`, `em:4`) regardless of which phases are present, for robust integration.
- The implementation is fully backward compatible with the previous monophase support and other Shelly 3EM devices.

## Motivation
This change allows users to monitor and control each phase of their Pro3EM devices individually, just like with the 3EM, and to benefit from accurate, phase-specific energy and power readings in all Matterbridge integrations.
## Related
- Builds on the monophase support introduced in [#38](https://github.com/Luligu/matterbridge-shelly/pull/38)
*Feel free to edit or add more technical details if needed!*