From 5fd18a0bc7701d5c475a3c5634a765b16d34e7e3 Mon Sep 17 00:00:00 2001 From: Maciej Bieniek Date: Fri, 27 Dec 2024 12:56:27 +0000 Subject: [PATCH] Add support for Pro 3EM-3CT63 (#546) * Add support for Pro 3EM-3CT63 * Update docs * Bump version --- README.md | 1 + info.md | 1 + python_scripts/shellies_discovery_gen2.py | 40 ++++++++++++++++++++++- 3 files changed, 41 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 4f8284b..0d3b742 100644 --- a/README.md +++ b/README.md @@ -69,6 +69,7 @@ Shellies Discovery Gen2 will automatically install/update the script on your She - Shelly Pro 3 - Shelly Pro 3EM - Shelly Pro 3EM Switch Add-on +- Shelly Pro 3EM-3CT63 - Shelly Pro 3EM-400 - Shelly Pro 4PM - Shelly Pro Dimmer 2 diff --git a/info.md b/info.md index 6a8a579..a30fdf9 100644 --- a/info.md +++ b/info.md @@ -62,6 +62,7 @@ Shellies Discovery Gen2 will automatically install/update the script on your She - Shelly Pro 3 - Shelly Pro 3EM - Shelly Pro 3EM Switch Add-on +- Shelly Pro 3EM-3CT63 - Shelly Pro 3EM-400 - Shelly Pro 4PM - Shelly Pro Dimmer 2 diff --git a/python_scripts/shellies_discovery_gen2.py b/python_scripts/shellies_discovery_gen2.py index 9686ae0..6d75754 100644 --- a/python_scripts/shellies_discovery_gen2.py +++ b/python_scripts/shellies_discovery_gen2.py @@ -1,6 +1,6 @@ """This script adds MQTT discovery support for Shellies Gen2 devices.""" -VERSION = "3.6.1" +VERSION = "3.7.0" ATTR_BATTERY_POWERED = "battery_powered" ATTR_BINARY_SENSORS = "binary_sensors" @@ -222,6 +222,7 @@ MODEL_PRO_2PM = "shellypro2pm" MODEL_PRO_3 = "shellypro3" MODEL_PRO_3EM = "shellypro3em" +MODEL_PRO_3EM_3CT63 = "shellypro3em63" MODEL_PRO_3EM_400 = "shellypro3em400" MODEL_PRO_3EM_MONOPHASE = "shellypro3em-monophase" MODEL_PRO_4PM = "shellypro4pm" @@ -2874,6 +2875,43 @@ def get_component_ids(component: str, config): }, ATTR_MIN_FIRMWARE_DATE: 20231219, }, + MODEL_PRO_3EM_3CT63: { + ATTR_NAME: "Shelly Pro 3EM-3CT63", + ATTR_MODEL_ID: "SPEM-003CEBEU63", + ATTR_EMETERS: 1, + ATTR_EMETER_PHASES: ["a", "b", "c"], + ATTR_BINARY_SENSORS: {SENSOR_CLOUD: DESCRIPTION_SENSOR_CLOUD}, + ATTR_BUTTONS: {BUTTON_RESTART: DESCRIPTION_BUTTON_RESTART}, + ATTR_SENSORS: { + SENSOR_ETH_IP: DESCRIPTION_SENSOR_ETH_IP, + SENSOR_LAST_RESTART: DESCRIPTION_SENSOR_LAST_RESTART, + SENSOR_SSID: DESCRIPTION_SENSOR_SSID, + SENSOR_WIFI_IP: DESCRIPTION_SENSOR_WIFI_IP, + SENSOR_WIFI_SIGNAL: DESCRIPTION_SENSOR_WIFI_SIGNAL, + SENSOR_N_CURRENT: DESCRIPTION_SENSOR_N_CURRENT, + SENSOR_DEVICE_TEMPERATURE: DESCRIPTION_SENSOR_DEVICE_TEMPERATURE, + SENSOR_TOTAL_CURRENT: DESCRIPTION_SENSOR_TOTAL_CURRENT, + SENSOR_TOTAL_ACTIVE_POWER: DESCRIPTION_SENSOR_EMETER_TOTAL_ACTIVE_POWER, + SENSOR_TOTAL_APPARENT_POWER: DESCRIPTION_SENSOR_EMETER_TOTAL_APPARENT_POWER, + SENSOR_TOTAL_ACTIVE_ENERGY: DESCRIPTION_SENSOR_EMETER0_TOTAL_ACTIVE_ENERGY, + SENSOR_TOTAT_ACTIVE_RETURNED_ENERGY: DESCRIPTION_SENSOR_EMETER0_TOTAL_ACTIVE_RETURNED_ENERGY, + }, + ATTR_EMETER_SENSORS: { + SENSOR_ACTIVE_POWER: DESCRIPTION_SENSOR_EMETER_PHASE_ACTIVE_POWER, + SENSOR_APPARENT_POWER: DESCRIPTION_SENSOR_EMETER_PHASE_APPARENT_POWER, + SENSOR_CURRENT: DESCRIPTION_SENSOR_EMETER_PHASE_CURRENT, + SENSOR_POWER_FACTOR: DESCRIPTION_SENSOR_EMETER_PHASE_POWER_FACTOR, + SENSOR_TOTAL_ACTIVE_ENERGY: DESCRIPTION_SENSOR_EMETER_PHASE_TOTAL_ACTIVE_ENERGY, + SENSOR_TOTAT_ACTIVE_RETURNED_ENERGY: DESCRIPTION_SENSOR_EMETER_PHASE_TOTAL_ACTIVE_RETURNED_ENERGY, + SENSOR_VOLTAGE: DESCRIPTION_SENSOR_EMETER_PHASE_VOLTAGE, + SENSOR_FREQUENCY: DESCRIPTION_SENSOR_EMETER_PHASE_FREQUENCY, + }, + ATTR_UPDATES: { + UPDATE_FIRMWARE: DESCRIPTION_UPDATE_FIRMWARE, + UPDATE_FIRMWARE_BETA: DESCRIPTION_UPDATE_FIRMWARE_BETA, + }, + ATTR_MIN_FIRMWARE_DATE: 20241011, + }, MODEL_PRO_3EM_400: { ATTR_NAME: "Shelly Pro 3EM-400", ATTR_MODEL_ID: "SPEM-003CEBEU400",