Jelajahi Sumber

Add support for SmartMCB Energy Meter.

Issue #110
Jason Rumney 4 tahun lalu
induk
melakukan
0a19351427

+ 1 - 1
ACKNOWLEDGEMENTS.md

@@ -69,6 +69,6 @@ Further device support has been made with the assistance of users.  Please consi
  - [edwinyoo44](https://github.com/edwinyoo44) for contributing support for JJPro JPD01 dehumidifiers and assistance with Poiema One purifiers.
  - [mpetcuRO](https://github.com/mpetcuRO) for assistance with Hysen HT08WE-2 thermometers.
  - [Paul-C-S](https://github.com/Paul-C-S) for assistance with Ecostrad Accent iQ heaters.
- - [WildeRNS](https://github.com/WildeRNS) for assistance with Nashone MTS-700-WB thermostat smartplugs.
+ - [WildeRNS](https://github.com/WildeRNS) for assistance with Nashone MTS-700-WB thermostat smartplugs, SmartMCB Energy meter.
  - [ishioni](https://github.com/ishioni) for contributing support for Eberg Cooly C32HD air conditioner.
  - [Gekko47](https://github.com/Gekko47) for contributing support for ElectriQ CD12v2 dehumidifiers.

+ 3 - 0
README.md

@@ -116,6 +116,9 @@ the device will not work despite being listed below.
 - Eanons QT-JS2014 Purifying humidifier
 - Wetair WAW-H1210LW humidifier
 
+### Smart Meter/Circuit Breaker
+- SmartMCB SMT006 Energy Meter
+
 ### SmartPlugs/Wall sockets
 - Generic Smartplug with Energy monitoring (older models)
   _confirmed as working with Kogan and Blitzwolf Single Smartplugs_

+ 284 - 0
custom_components/tuya_local/devices/smartmcb_smt006_energymeter.yaml

@@ -0,0 +1,284 @@
+name: SmartMCB SMT006 Energy Meter
+products:
+  - id: ntwmuj82anq1l92i
+primary_entity:
+  entity: switch
+  dps:
+    - id: 6
+      type: string
+      name: phase_a
+    - id: 7
+      type: string
+      name: phase_b
+    - id: 8
+      type: string
+      name: phase_c
+    - id: 16
+      type: boolean
+      name: switch
+    - id: 19
+      type: string
+      name: breaker_number
+secondary_entities:
+  - entity: sensor
+    name: energy
+    class: energy
+    dps:
+      - id: 1
+        type: integer
+        name: sensor
+        class: total_increasing
+        unit: kWh
+        mapping:
+          - scale: 100
+  - entity: binary_sensor
+    name: Short Circuit
+    class: problem
+    category: diagnostic
+    dps:
+      - id: 9
+        type: bitfield
+        name: sensor
+        mapping:
+          - value: false
+          - dps_val: 1
+            value: true
+  - entity: binary_sensor
+    name: Surge
+    class: problem
+    category: diagnostic
+    dps:
+      - id: 9
+        type: bitfield
+        name: sensor
+        mapping:
+          - value: false
+          - dps_val: 2
+            value: true
+  - entity: binary_sensor
+    name: Overload
+    class: problem
+    category: diagnostic
+    dps:
+      - id: 9
+        type: bitfield
+        name: sensor
+        mapping:
+          - value: false
+          - dps_val: 4
+            value: true
+  - entity: binary_sensor
+    name: Leakage Current
+    class: safety
+    category: diagnostic
+    dps:
+      - id: 9
+        type: bitfield
+        name: sensor
+        mapping:
+          - value: false
+          - dps_val: 8
+            value: true
+  - entity: binary_sensor
+    name: High Temperature
+    class: heat
+    category: diagnostic
+    dps:
+      - id: 9
+        type: bitfield
+        name: sensor
+        mapping:
+          - value: false
+          - dps_val: 16
+            value: True
+  - entity: binary_sensor
+    name: Fire
+    class: smoke
+    category: diagnostic
+    dps:
+      - id: 9
+        type: bitfield
+        name: sensor
+        mapping:
+          - value: false
+          - dps_val: 32
+            value: true
+  - entity: binary_sensor
+    name: High Power
+    class: power
+    category: diagnostic
+    dps:
+      - id: 9
+        type: bitfield
+        name: sensor
+        mapping:
+          - value: false
+          - dps_val: 64
+            value: true
+  - entity: binary_sensor
+    name: Self Test
+    class: problem
+    category: diagnostic
+    dps:
+      - id: 9
+        type: bitfield
+        name: sensor
+        mapping:
+          - value: false
+          - dps_val: 128
+            value: true
+  - entity: binary_sensor
+    name: Overcurrent
+    class: problem
+    category: diagnostic
+    dps:
+      - id: 9
+        type: bitfield
+        name: sensor
+        mapping:
+          - value: false
+          - dps_val: 256
+            value: true
+  - entity: binary_sensor
+    name: Unbalanced
+    class: problem
+    category: diagnostic
+    dps:
+      - id: 9
+        type: bitfield
+        name: sensor
+        mapping:
+          - value: false
+          - dps_val: 512
+            value: true
+  - entity: binary_sensor
+    name: Overvoltage
+    class: problem
+    category: diagnostic
+    dps:
+      - id: 9
+        type: bitfield
+        name: sensor
+        mapping:
+          - value: false
+          - dps_val: 1024
+            value: true
+  - entity: binary_sensor
+    name: Undervoltage
+    class: problem
+    category: diagnostic
+    dps:
+      - id: 9
+        type: bitfield
+        name: sensor
+        mapping:
+          - value: false
+          - dps_val: 2048
+            value: true
+  - entity: binary_sensor
+    name: Phase fault
+    class: problem
+    category: diagnostic
+    dps:
+      - id: 9
+        type: bitfield
+        name: sensor
+        mapping:
+          - value: false
+          - dps_val: 4096
+            value: true
+  - entity: binary_sensor
+    name: Outage
+    class: power
+    category: diagnostic
+    dps:
+      - id: 9
+        type: bitfield
+        name: sensor
+        mapping:
+          - value: true
+          - dps_val: 8192
+            value: false
+  - entity: binary_sensor
+    name: Magnetism
+    class: problem
+    category: diagnostic
+    dps:
+      - id: 9
+        type: bitfield
+        name: sensor
+        mapping:
+          - value: false
+          - dps_val: 16384
+            value: true
+  - entity: binary_sensor
+    name: Low Credit
+    class: battery
+    category: diagnostic
+    dps:
+      - id: 9
+        type: bitfield
+        name: sensor
+        mapping:
+          - value: false
+          - dps_val: 32768
+            value: true
+  - entity: binary_sensor
+    name: Credit
+    class: plug
+    category: diagnostic
+    dps:
+      - id: 9
+        type: bitfield
+        name: sensor
+        mapping:
+          - value: true
+          - dps_val: 65536
+            value: false
+  - entity: switch
+    name: Prepay
+    category: config
+    icon: "mdi:hand-coin"
+    dps:
+      - id: 11
+        type: boolean
+        name: switch
+  - entity: select
+    name: Energy Reset
+    category: config
+    icon: "mdi:cog-refresh"
+    dps:
+      - id: 12
+        type: string
+        name: option
+        mapping:
+          - dps_val: ""
+            value: ""
+          - dps_val: empty
+            value: Reset
+  - entity: sensor
+    name: Balance Energy
+    category: diagnostic
+    class: energy
+    icon: "mdi:home-lightning-bolt"
+    dps:
+      - id: 13
+        type: integer
+        name: sensor
+        unit: kWh
+        class: total
+        mapping:
+          - scale: 100
+  - entity: number
+    name: Charge Energy
+    category: config
+    icon: "mdi:home-lightning-bolt"
+    dps:
+      - id: 14
+        type: integer
+        name: value
+        range:
+          min: 0
+          max: 999999
+        mapping:
+          - scale: 100

+ 41 - 1
custom_components/tuya_local/translations/en.json

@@ -40,6 +40,22 @@
                     "binary_sensor_tank": "Include tank as a binary_sensor entity",
                     "binary_sensor_valve": "Include valve as a binary_sensor entity",
                     "binary_sensor_water_flow": "Include water flow warning as a binary_sensor entity",
+		    "binary_sensor_short_circuit": "Include short circuit as a binary_sensor entity",
+		    "binary_sensor_surge": "Include surge detection as a binary_sensor entity",
+		    "binary_sensor_overload": "Include overload detection as a binary_sensor entity",
+		    "binary_sensor_leakage_current": "Include leakage current as a binary_sensor entity",
+		    "binary_sensor_fire": "Include fire detection as a binary_sensor entity",
+		    "binary_sensor_high_power": "Include high power detection as a binary_sensor entity",
+		    "binary_sensor_self_test": "Include self test as a binary_sensor entity",
+		    "binary_sensor_overcurrent": "Include overcurrent detection as a binary_sensor entity",
+		    "binary_sensor_unbalanced": "Include unbalanced detection as a binary_sensor entity",
+		    "binary_sensor_overvoltage": "Include overvoltage detection as a binary_sensor entity",
+		    "binary_sensor_undervoltage": "Include undervoltage detection as a binary_sensor entity",
+		    "binary_sensor_phase_fault": "Include phase fault detection as a binary_sensor entity",
+		    "binary_sensor_outage": "Include outage detection as a binary_sensor entity",
+		    "binary_sensor_magnetism": "Include magnetism detection as a binary_sensor entity",
+		    "binary_sensor_low_credit": "Include low credit as a binary_sensor entity",
+		    "binary_sensor_credit": "Include credit as a binary_sensor entity",
                     "climate_dehumidifier_as_climate": "Include a climate entity for the dehumidifier (deprecated, recommend using humidifier and fan instead)",
                     "fan_intensity": "Include intensity as a fan entity",
                     "light_aq_indicator": "Include AQ indicator as a light entity",
@@ -54,6 +70,7 @@
                     "number_calibration_swing": "Include calibration swing as a number entity",
                     "number_calibration_swing_external": "Include calibration swing for external sensor as a number entity",
                     "number_calibration_swing_internal": "Include calibration swing for internal sensor as a number entity",
+		    "number_charge_energy": "Include charge energy as a number entity",
                     "number_continuous_heat_hours": "Include Continuous Heating Time as a number entity",
                     "number_fan_runtime": "Include fan run time as a number entity",
                     "number_high_temperature_limit": "Include High Temperature Limit as a number entity",
@@ -70,6 +87,7 @@
                     "number_timer_3": "Include timer 3 as a number entity",
                     "number_usb_timer": "Include timer USB as a number entity",
                     "select_configuration": "Include configuration as a select entity",
+		    "select_energy_reset": "Include energy reset as a select entity",
                     "select_initial_state": "Include initial state as a select entity",
                     "select_installation": "Include installation as a select entity",
                     "select_schedule": "Include schedule as a select entity",
@@ -78,6 +96,7 @@
                     "select_temperature_unit": "Include temerature unit as a select entity",
                     "sensor_active_filter_life": "Include active filter life as a sensor entity",
                     "sensor_air_quality": "Include air quality as a sensor entity",
+		    "sensor_balance_energy": "Include balance energy as a sensor_entity",
                     "sensor_charcoal_filter_life": "Include charcoal filter life as a sensor entity",
                     "sensor_current": "Include current as a sensor entity",
                     "sensor_current_humidity": "Include current humidity as a sensor entity",
@@ -115,6 +134,7 @@
                     "switch_outlet_2": "Include outlet 2 as a switch entity",
                     "switch_outlet_3": "Include outlet 3 as a switch entity",
                     "switch_overcharge_cutoff": "Include overcharge cutoff as a switch entity",
+		    "switch_prepay": "Include prepay as a switch entity",
                     "switch_sleep": "Include sleep mode as a switch entity",
                     "switch_sound": "Include sound mute as a switch entity",
                     "switch_usb_switch": "Include USB as a switch entity",
@@ -157,6 +177,22 @@
                     "binary_sensor_tank": "Include tank as a binary_sensor entity",
                     "binary_sensor_valve": "Include valve as a binary_sensor entity",
                     "binary_sensor_water_flow": "Include water flow warning as a binary_sensor entity",
+		    "binary_sensor_short_circuit": "Include short circuit as a binary_sensor entity",
+		    "binary_sensor_surge": "Include surge detection as a binary_sensor entity",
+		    "binary_sensor_overload": "Include overload detection as a binary_sensor entity",
+		    "binary_sensor_leakage_current": "Include leakage current as a binary_sensor entity",
+		    "binary_sensor_fire": "Include fire detection as a binary_sensor entity",
+		    "binary_sensor_high_power": "Include high power detection as a binary_sensor entity",
+		    "binary_sensor_self_test": "Include self test as a binary_sensor entity",
+		    "binary_sensor_overcurrent": "Include overcurrent detection as a binary_sensor entity",
+		    "binary_sensor_unbalanced": "Include unbalanced detection as a binary_sensor entity",
+		    "binary_sensor_overvoltage": "Include overvoltage detection as a binary_sensor entity",
+		    "binary_sensor_undervoltage": "Include undervoltage detection as a binary_sensor entity",
+		    "binary_sensor_phase_fault": "Include phase fault detection as a binary_sensor entity",
+		    "binary_sensor_outage": "Include outage detection as a binary_sensor entity",
+		    "binary_sensor_magnetism": "Include magnetism detection as a binary_sensor entity",
+		    "binary_sensor_low_credit": "Include low credit as a binary_sensor entity",
+		    "binary_sensor_credit": "Include credit as a binary_sensor entity",
                     "climate_dehumidifier_as_climate": "Include a climate entity for the dehumidifier (deprecated, recommend using humidifier and fan instead)",
                     "fan_intensity": "Include intensity as a fan entity",
                     "light_aq_indicator": "Include AQ indicator as a light entity",
@@ -171,6 +207,7 @@
                     "number_calibration_swing": "Include calibration swing as a number entity",
                     "number_calibration_swing_external": "Include calibration swing for external sensor as a number entity",
                     "number_calibration_swing_internal": "Include calibration swing for internal sensor as a number entity",
+		    "number_charge_energy": "Include charge energy as a number entity",
                     "number_continuous_heat_hours": "Include Continuous Heating Time as a number entity",
                     "number_fan_runtime": "Include fan run time as a number entity",
                     "number_high_temperature_limit": "Include High Temperature Limit as a number entity",
@@ -187,6 +224,7 @@
                     "number_timer_3": "Include timer 3 as a number entity",
                     "number_usb_timer": "Include timer USB as a number entity",
                     "select_configuration": "Include configuration as a select entity",
+		    "select_energy_reset": "Include energy reset as a select entity",
                     "select_initial_state": "Include initial state as a select entity",
                     "select_installation": "Include installation as a select entity",
                     "select_schedule": "Include schedule as a select entity",
@@ -195,6 +233,7 @@
                     "select_temperature_unit": "Include temerature unit as a select entity",
                     "sensor_active_filter_life": "Include active filter life as a sensor entity",
                     "sensor_air_quality": "Include air quality as a sensor entity",
+		    "sensor_balance_energy": "Include balance energy as a sensor_entity",
                     "sensor_charcoal_filter_life": "Include charcoal filter life as a sensor entity",
                     "sensor_current": "Include current as a sensor entity",
                     "sensor_current_humidity": "Include current humidity as a sensor entity",
@@ -231,10 +270,11 @@
                     "switch_outlet_1": "Include outlet 1 as a switch entity",
                     "switch_outlet_2": "Include outlet 2 as a switch entity",
                     "switch_outlet_3": "Include outlet 3 as a switch entity",
-                    "switch_usb_switch": "Include USB as a switch entity",
                     "switch_overcharge_cutoff": "Include overcharge cutoff as a switch entity",
+		    "switch_prepay": "Include prepay as a switch entity",
                     "switch_sleep": "Include sleep mode as a switch entity",
                     "switch_sound": "Include sound mute as a switch entity",
+                    "switch_usb_switch": "Include USB as a switch entity",
                     "switch_uv_sterilization": "Include UV sterilization as a switch"
                 }
             }

+ 14 - 0
tests/const.py

@@ -875,3 +875,17 @@ NASHONE_MTS700WB_THERMOSTAT_PAYLOAD = {
     "41": "cancel",
     "42": 0,
 }
+
+SMARTMCB_SMT006_METER_PAYLOAD = {
+    "1": 139470,
+    "6": "CHoAQgQADlwAAA==",
+    "7": "AAAAAAAAAAAAAA==",
+    "8": "AAAAAAAAAAAAAA==",
+    "9": 0,
+    "11": False,
+    "12": "",
+    "13": 0,
+    "14": 0,
+    "16": True,
+    "19": "FSE-F723C46A04FC6C",
+}

+ 251 - 0
tests/devices/test_smartmcb_smt006_energymeter.py

@@ -0,0 +1,251 @@
+"""Tests for the SmartMCB SMT006 Energy Meter"""
+from homeassistant.components.binary_sensor import (
+    DEVICE_CLASS_BATTERY,
+    DEVICE_CLASS_HEAT,
+    DEVICE_CLASS_PLUG,
+    DEVICE_CLASS_POWER,
+    DEVICE_CLASS_PROBLEM,
+    DEVICE_CLASS_SAFETY,
+    DEVICE_CLASS_SMOKE,
+)
+from homeassistant.components.sensor import (
+    STATE_CLASS_TOTAL,
+    STATE_CLASS_TOTAL_INCREASING,
+)
+from homeassistant.const import (
+    DEVICE_CLASS_ENERGY,
+    ENERGY_KILO_WATT_HOUR,
+)
+
+from ..const import SMARTMCB_SMT006_METER_PAYLOAD
+from ..mixins.binary_sensor import MultiBinarySensorTests
+from ..mixins.number import BasicNumberTests
+from ..mixins.select import BasicSelectTests
+from ..mixins.sensor import MultiSensorTests
+from ..mixins.switch import MultiSwitchTests
+from .base_device_tests import TuyaDeviceTestCase
+
+TOTALENERGY_DPS = "1"
+PHASEA_DPS = "6"
+PHASEB_DPS = "7"
+PHASEC_DPS = "8"
+ERROR_DPS = "9"
+PREPAY_DPS = "11"
+RESET_DPS = "12"
+BALANCE_DPS = "13"
+CHARGE_DPS = "14"
+SWITCH_DPS = "16"
+SERIAL_DPS = "19"
+
+
+class TestSmartMcbSMT006EnergyMeter(
+    MultiBinarySensorTests,
+    BasicNumberTests,
+    BasicSelectTests,
+    MultiSensorTests,
+    MultiSwitchTests,
+    TuyaDeviceTestCase,
+):
+    __test__ = True
+
+    def setUp(self):
+        self.setUpForConfig(
+            "smartmcb_smt006_energymeter.yaml",
+            SMARTMCB_SMT006_METER_PAYLOAD,
+        )
+
+        self.setUpMultiSwitch(
+            [
+                {
+                    "name": "switch",
+                    "dps": SWITCH_DPS,
+                },
+                {
+                    "name": "switch_prepay",
+                    "dps": PREPAY_DPS,
+                },
+            ],
+        )
+        self.setUpMultiSensors(
+            [
+                {
+                    "name": "sensor_energy",
+                    "dps": TOTALENERGY_DPS,
+                    "device_class": DEVICE_CLASS_ENERGY,
+                    "unit": ENERGY_KILO_WATT_HOUR,
+                    "state_class": STATE_CLASS_TOTAL_INCREASING,
+                    "testdata": (123456, 1234.56),
+                },
+                {
+                    "name": "sensor_balance_energy",
+                    "dps": BALANCE_DPS,
+                    "device_class": DEVICE_CLASS_ENERGY,
+                    "unit": ENERGY_KILO_WATT_HOUR,
+                    "state_class": STATE_CLASS_TOTAL,
+                    "testdata": (123456, 1234.56),
+                },
+            ],
+        )
+        self.setUpMultiBinarySensors(
+            [
+                {
+                    "name": "binary_sensor_short_circuit",
+                    "dps": ERROR_DPS,
+                    "device_class": DEVICE_CLASS_PROBLEM,
+                    "testdata": (1, 0),
+                },
+                {
+                    "name": "binary_sensor_surge",
+                    "dps": ERROR_DPS,
+                    "device_class": DEVICE_CLASS_PROBLEM,
+                    "testdata": (2, 0),
+                },
+                {
+                    "name": "binary_sensor_overload",
+                    "dps": ERROR_DPS,
+                    "device_class": DEVICE_CLASS_PROBLEM,
+                    "testdata": (4, 0),
+                },
+                {
+                    "name": "binary_sensor_leakage_current",
+                    "dps": ERROR_DPS,
+                    "device_class": DEVICE_CLASS_SAFETY,
+                    "testdata": (8, 0),
+                },
+                {
+                    "name": "binary_sensor_high_temperature",
+                    "dps": ERROR_DPS,
+                    "device_class": DEVICE_CLASS_HEAT,
+                    "testdata": (16, 0),
+                },
+                {
+                    "name": "binary_sensor_fire",
+                    "dps": ERROR_DPS,
+                    "device_class": DEVICE_CLASS_SMOKE,
+                    "testdata": (32, 0),
+                },
+                {
+                    "name": "binary_sensor_high_power",
+                    "dps": ERROR_DPS,
+                    "device_class": DEVICE_CLASS_POWER,
+                    "testdata": (64, 0),
+                },
+                {
+                    "name": "binary_sensor_self_test",
+                    "dps": ERROR_DPS,
+                    "device_class": DEVICE_CLASS_PROBLEM,
+                    "testdata": (128, 0),
+                },
+                {
+                    "name": "binary_sensor_overcurrent",
+                    "dps": ERROR_DPS,
+                    "device_class": DEVICE_CLASS_PROBLEM,
+                    "testdata": (256, 0),
+                },
+                {
+                    "name": "binary_sensor_unbalanced",
+                    "dps": ERROR_DPS,
+                    "device_class": DEVICE_CLASS_PROBLEM,
+                    "testdata": (512, 0),
+                },
+                {
+                    "name": "binary_sensor_overvoltage",
+                    "dps": ERROR_DPS,
+                    "device_class": DEVICE_CLASS_PROBLEM,
+                    "testdata": (1024, 0),
+                },
+                {
+                    "name": "binary_sensor_undervoltage",
+                    "dps": ERROR_DPS,
+                    "device_class": DEVICE_CLASS_PROBLEM,
+                    "testdata": (2048, 0),
+                },
+                {
+                    "name": "binary_sensor_phase_fault",
+                    "dps": ERROR_DPS,
+                    "device_class": DEVICE_CLASS_PROBLEM,
+                    "testdata": (4096, 0),
+                },
+                {
+                    "name": "binary_sensor_outage",
+                    "dps": ERROR_DPS,
+                    "device_class": DEVICE_CLASS_POWER,
+                    "testdata": (0, 8192),
+                },
+                {
+                    "name": "binary_sensor_magnetism",
+                    "dps": ERROR_DPS,
+                    "device_class": DEVICE_CLASS_PROBLEM,
+                    "testdata": (16384, 0),
+                },
+                {
+                    "name": "binary_sensor_low_credit",
+                    "dps": ERROR_DPS,
+                    "device_class": DEVICE_CLASS_BATTERY,
+                    "testdata": (32768, 0),
+                },
+                {
+                    "name": "binary_sensor_credit",
+                    "dps": ERROR_DPS,
+                    "device_class": DEVICE_CLASS_PLUG,
+                    "testdata": (0, 65536),
+                    "unit": ENERGY_KILO_WATT_HOUR,
+                },
+            ],
+        )
+        self.setUpBasicNumber(
+            CHARGE_DPS,
+            self.entities.get("number_charge_energy"),
+            max=9999.99,
+            scale=100,
+            step=0.01,
+        )
+        self.setUpBasicSelect(
+            RESET_DPS,
+            self.entities.get("select_energy_reset"),
+            {
+                "": "",
+                "empty": "Reset",
+            },
+        )
+        self.mark_secondary(
+            [
+                "binary_sensor_credit",
+                "binary_sensor_fire",
+                "binary_sensor_high_power",
+                "binary_sensor_high_temperature",
+                "binary_sensor_leakage_current",
+                "binary_sensor_low_credit",
+                "binary_sensor_magnetism",
+                "binary_sensor_outage",
+                "binary_sensor_overcurrent",
+                "binary_sensor_overload",
+                "binary_sensor_overvoltage",
+                "binary_sensor_phase_fault",
+                "binary_sensor_self_test",
+                "binary_sensor_short_circuit",
+                "binary_sensor_surge",
+                "binary_sensor_unbalanced",
+                "binary_sensor_undervoltage",
+                "number_charge_energy",
+                "select_energy_reset",
+                "sensor_balance_energy",
+                "switch_prepay",
+            ]
+        )
+
+    def test_multi_switch_state_attributes(self):
+        self.dps[PHASEA_DPS] = "Phase A"
+        self.dps[PHASEB_DPS] = "Phase B"
+        self.dps[PHASEC_DPS] = "Phase C"
+        self.dps[SERIAL_DPS] = "Breaker Number"
+
+        self.assertDictEqual(
+            self.multiSwitch["switch"].extra_state_attributes,
+            {
+                "phase_a": "Phase A",
+                "phase_b": "Phase B",
+                "phase_c": "Phase C",
+                "breaker_number": "Breaker Number",
+            },
+        )