diff --git a/CHANGELOG.md b/CHANGELOG.md index 46cb72d9a..9d69dd56c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,9 +1,10 @@ # Changelog -## Ongoing +## v1.8.0 - Test/validate for Python 3.14 - Fix entity_item counting, refresh/complete test-data-json files via [#794](https://github.com/plugwise/python-plugwise/pull/794) +- Add initial support for the new Emma via [#797](https://github.com/plugwise/python-plugwise/pull/797) ## v1.7.8 diff --git a/README.md b/README.md index c5787429d..cc3dd4e75 100644 --- a/README.md +++ b/README.md @@ -62,17 +62,17 @@ Module providing interfacing with the Plugwise devices: ### Smile - [x] Adam - - [x] Lisa + - [x] Emma (only tested as ZigBee device connected to Adam) - [x] Jip - - [x] Floor - - [x] Tom + - [x] Lisa + - [x] Tom/Floor - [x] Koen (a Koen always comes with a Plug, the Plug is the active part) - [x] Plug - [x] Aqara Plug -- [x] Anna -- [x] Smile P1 -- [x] Stretch -- [ ] Some of the equipment mentioned in USB when in use via Stretch or Adam +- [x] Anna (v1.8 and later firmware versions) +- [ ] Anna P1 +- [x] Smile P1 (v2.0 and later firmware versions) +- [x] Stretch (only with Circles, please help out with other devices) - [x] [Home-Assistant](https://home-assistant.io) via - [x] Native supporting networked Plugwise products diff --git a/fixtures/adam_anna_new_2/data.json b/fixtures/adam_anna_new_2/data.json new file mode 100644 index 000000000..8e3c4892e --- /dev/null +++ b/fixtures/adam_anna_new_2/data.json @@ -0,0 +1,304 @@ +{ + "056ee145a816487eaa69243c3280f8bf": { + "available": true, + "binary_sensors": { + "dhw_state": false, + "flame_state": false, + "heating_state": false + }, + "dev_class": "heater_central", + "location": "bc93488efab249e5bc54fd7e175a6f91", + "maximum_boiler_temperature": { + "lower_bound": 25.0, + "resolution": 0.01, + "setpoint": 50.0, + "upper_bound": 95.0 + }, + "model": "Generic heater", + "name": "OpenTherm", + "sensors": { + "intended_boiler_temperature": 0.0, + "water_temperature": 34.0 + }, + "switches": { + "dhw_cm_switch": false + } + }, + "14df5c4dc8cb4ba69f9d1ac0eaf7c5c6": { + "available": true, + "dev_class": "zone_thermostat", + "hardware": "1", + "location": "f2bf9048bef64cc5b6d5110154e33c81", + "model": "Emma", + "model_id": "170-01", + "name": "Emma", + "sensors": { + "humidity": 61.8, + "setpoint": 15.0, + "temperature": 21.9 + }, + "temperature_offset": { + "lower_bound": -2.0, + "resolution": 0.1, + "setpoint": 0.0, + "upper_bound": 2.0 + }, + "vendor": "Plugwise", + "zigbee_mac_address": "60EFABFFFE89965C" + }, + "1772a4ea304041adb83f357b751341ff": { + "available": true, + "binary_sensors": { + "low_battery": false + }, + "dev_class": "thermostatic_radiator_valve", + "firmware": "2020-11-04T01:00:00+01:00", + "hardware": "1", + "location": "f871b8c4d63549319221e294e4f88074", + "model": "Tom/Floor", + "model_id": "106-03", + "name": "Tom Badkamer", + "sensors": { + "battery": 60, + "setpoint": 12.0, + "temperature": 19.1, + "temperature_difference": -0.4, + "valve_position": 0.0 + }, + "temperature_offset": { + "lower_bound": -2.0, + "resolution": 0.1, + "setpoint": 0.1, + "upper_bound": 2.0 + }, + "vendor": "Plugwise", + "zigbee_mac_address": "000D6F000C8FF5EE" + }, + "2568cc4b9c1e401495d4741a5f89bee1": { + "available": true, + "dev_class": "hometheater_plug", + "firmware": "2020-11-10T01:00:00+01:00", + "location": "f2bf9048bef64cc5b6d5110154e33c81", + "model": "Plug", + "model_id": "160-01", + "name": "Plug MediaTV", + "sensors": { + "electricity_consumed": 15.6, + "electricity_consumed_interval": 4.0, + "electricity_produced": 0.0, + "electricity_produced_interval": 0.0 + }, + "switches": { + "lock": false, + "relay": true + }, + "vendor": "Plugwise", + "zigbee_mac_address": "000D6F000D13CCFD" + }, + "29542b2b6a6a4169acecc15c72a599b8": { + "available": true, + "dev_class": "water_heater_vessel_plug", + "firmware": "2020-11-10T01:00:00+01:00", + "location": "8201a2ac4d1b4303bf994e18d67311eb", + "model": "Plug", + "model_id": "160-01", + "name": "Plug Thermex Boiler", + "sensors": { + "electricity_consumed": 0.69, + "electricity_consumed_interval": 0.0, + "electricity_produced": 0.0, + "electricity_produced_interval": 0.0 + }, + "switches": { + "lock": true, + "relay": true + }, + "vendor": "Plugwise", + "zigbee_mac_address": "000D6F000D13CA9A" + }, + "854f8a9b0e7e425db97f1f110e1ce4b3": { + "available": true, + "dev_class": "central_heating_pump_plug", + "firmware": "2020-11-10T01:00:00+01:00", + "location": "f2bf9048bef64cc5b6d5110154e33c81", + "model": "Plug", + "model_id": "160-01", + "name": "Plug Vloerverwarming", + "sensors": { + "electricity_consumed": 0.0, + "electricity_consumed_interval": 0.0, + "electricity_produced": 0.0, + "electricity_produced_interval": 0.0 + }, + "switches": { + "relay": false + }, + "vendor": "Plugwise", + "zigbee_mac_address": "000D6F000D13CB6F" + }, + "ad4838d7d35c4d6ea796ee12ae5aedf8": { + "dev_class": "thermostat", + "location": "f2bf9048bef64cc5b6d5110154e33c81", + "model": "ThermoTouch", + "model_id": "143.1", + "name": "Anna", + "sensors": { + "setpoint": 15.0, + "temperature": 19.5 + }, + "vendor": "Plugwise" + }, + "da224107914542988a88561b4452b0f6": { + "binary_sensors": { + "plugwise_notification": false + }, + "dev_class": "gateway", + "firmware": "3.9.0", + "gateway_modes": ["away", "full", "vacation"], + "hardware": "AME Smile 2.0 board", + "location": "bc93488efab249e5bc54fd7e175a6f91", + "mac_address": "D40FB2019891", + "model": "Gateway", + "model_id": "smile_open_therm", + "name": "Adam", + "notifications": {}, + "regulation_modes": ["bleeding_cold", "heating", "off", "bleeding_hot"], + "select_gateway_mode": "full", + "select_regulation_mode": "heating", + "sensors": { + "outdoor_temperature": 13.9 + }, + "vendor": "Plugwise", + "zigbee_mac_address": "000D6F000D5A168D" + }, + "da575e9e09b947e281fb6e3ebce3b174": { + "available": true, + "binary_sensors": { + "low_battery": false + }, + "dev_class": "zone_thermometer", + "firmware": "2020-09-01T02:00:00+02:00", + "hardware": "1", + "location": "f2bf9048bef64cc5b6d5110154e33c81", + "model": "Jip", + "model_id": "168-01", + "name": "Jip", + "sensors": { + "battery": 100, + "humidity": 63.9, + "setpoint": 15.0, + "temperature": 18.8 + }, + "vendor": "Plugwise", + "zigbee_mac_address": "70AC08FFFEE16437" + }, + "e2f4322d57924fa090fbbc48b3a140dc": { + "available": true, + "binary_sensors": { + "low_battery": false + }, + "dev_class": "zone_thermostat", + "firmware": "2016-10-10T02:00:00+02:00", + "hardware": "255", + "location": "f871b8c4d63549319221e294e4f88074", + "model": "Lisa", + "model_id": "158-01", + "name": "Lisa Badkamer", + "sensors": { + "battery": 71, + "setpoint": 12.0, + "temperature": 18.8 + }, + "temperature_offset": { + "lower_bound": -2.0, + "resolution": 0.1, + "setpoint": 0.0, + "upper_bound": 2.0 + }, + "vendor": "Plugwise", + "zigbee_mac_address": "000D6F000C869B61" + }, + "e8ef2a01ed3b4139a53bf749204fe6b4": { + "dev_class": "switching", + "members": [ + "2568cc4b9c1e401495d4741a5f89bee1", + "29542b2b6a6a4169acecc15c72a599b8" + ], + "model": "Switchgroup", + "name": "Test", + "switches": { + "relay": true + }, + "vendor": "Plugwise" + }, + "f2bf9048bef64cc5b6d5110154e33c81": { + "active_preset": "vacation", + "available_schedules": [ + "Badkamer", + "Vakantie", + "Weekschema", + "Test", + "off" + ], + "climate_mode": "heat", + "control_state": "idle", + "dev_class": "climate", + "model": "ThermoZone", + "name": "Living room", + "preset_modes": ["vacation", "no_frost", "asleep", "home", "away"], + "select_schedule": "off", + "sensors": { + "electricity_consumed": 15.6, + "electricity_produced": 0.0, + "temperature": 18.8 + }, + "thermostat": { + "lower_bound": 1.0, + "resolution": 0.01, + "setpoint": 15.0, + "upper_bound": 35.0 + }, + "thermostats": { + "primary": [ + "ad4838d7d35c4d6ea796ee12ae5aedf8", + "14df5c4dc8cb4ba69f9d1ac0eaf7c5c6", + "da575e9e09b947e281fb6e3ebce3b174" + ], + "secondary": [] + }, + "vendor": "Plugwise" + }, + "f871b8c4d63549319221e294e4f88074": { + "active_preset": "vacation", + "available_schedules": [ + "Badkamer", + "Vakantie", + "Weekschema", + "Test", + "off" + ], + "climate_mode": "heat", + "control_state": "idle", + "dev_class": "climate", + "model": "ThermoZone", + "name": "Bathroom", + "preset_modes": ["vacation", "no_frost", "asleep", "home", "away"], + "select_schedule": "off", + "sensors": { + "electricity_consumed": 0.0, + "electricity_produced": 0.0, + "temperature": 18.8 + }, + "thermostat": { + "lower_bound": 0.0, + "resolution": 0.01, + "setpoint": 12.0, + "upper_bound": 99.9 + }, + "thermostats": { + "primary": ["e2f4322d57924fa090fbbc48b3a140dc"], + "secondary": ["1772a4ea304041adb83f357b751341ff"] + }, + "vendor": "Plugwise" + } +} diff --git a/plugwise/constants.py b/plugwise/constants.py index 1eb657c88..941b53718 100644 --- a/plugwise/constants.py +++ b/plugwise/constants.py @@ -50,6 +50,7 @@ "158-01": "Lisa", "160-01": "Plug", "168-01": "Jip", + "170-01": "Emma", "038500": "Stick", "070085": "Stick", "120002": "Stick Legrand", diff --git a/pyproject.toml b/pyproject.toml index 05c85198d..e495fc355 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "plugwise" -version = "1.7.8" +version = "1.8.0" license = "MIT" description = "Plugwise Smile (Adam/Anna/P1) and Stretch module for Python 3." readme = "README.md" diff --git a/tests/data/adam/adam_anna_new_2.json b/tests/data/adam/adam_anna_new_2.json new file mode 100644 index 000000000..5b075dc9f --- /dev/null +++ b/tests/data/adam/adam_anna_new_2.json @@ -0,0 +1,306 @@ +{ + "devices": { + "056ee145a816487eaa69243c3280f8bf": { + "available": true, + "binary_sensors": { + "dhw_state": false, + "flame_state": false, + "heating_state": false + }, + "dev_class": "heater_central", + "location": "bc93488efab249e5bc54fd7e175a6f91", + "maximum_boiler_temperature": { + "lower_bound": 25.0, + "resolution": 0.01, + "setpoint": 50.0, + "upper_bound": 95.0 + }, + "model": "Generic heater", + "name": "OpenTherm", + "sensors": { + "intended_boiler_temperature": 0.0, + "water_temperature": 34.0 + }, + "switches": { + "dhw_cm_switch": false + } + }, + "14df5c4dc8cb4ba69f9d1ac0eaf7c5c6": { + "available": true, + "dev_class": "zone_thermostat", + "hardware": "1", + "location": "f2bf9048bef64cc5b6d5110154e33c81", + "model": "Emma", + "model_id": "170-01", + "name": "Emma", + "sensors": { + "humidity": 61.8, + "setpoint": 15.0, + "temperature": 21.9 + }, + "temperature_offset": { + "lower_bound": -2.0, + "resolution": 0.1, + "setpoint": 0.0, + "upper_bound": 2.0 + }, + "vendor": "Plugwise", + "zigbee_mac_address": "60EFABFFFE89965C" + }, + "1772a4ea304041adb83f357b751341ff": { + "available": true, + "binary_sensors": { + "low_battery": false + }, + "dev_class": "thermostatic_radiator_valve", + "firmware": "2020-11-04T01:00:00+01:00", + "hardware": "1", + "location": "f871b8c4d63549319221e294e4f88074", + "model": "Tom/Floor", + "model_id": "106-03", + "name": "Tom Badkamer", + "sensors": { + "battery": 60, + "setpoint": 12.0, + "temperature": 19.1, + "temperature_difference": -0.4, + "valve_position": 0.0 + }, + "temperature_offset": { + "lower_bound": -2.0, + "resolution": 0.1, + "setpoint": 0.1, + "upper_bound": 2.0 + }, + "vendor": "Plugwise", + "zigbee_mac_address": "000D6F000C8FF5EE" + }, + "2568cc4b9c1e401495d4741a5f89bee1": { + "available": true, + "dev_class": "hometheater_plug", + "firmware": "2020-11-10T01:00:00+01:00", + "location": "f2bf9048bef64cc5b6d5110154e33c81", + "model": "Plug", + "model_id": "160-01", + "name": "Plug MediaTV", + "sensors": { + "electricity_consumed": 15.6, + "electricity_consumed_interval": 4.0, + "electricity_produced": 0.0, + "electricity_produced_interval": 0.0 + }, + "switches": { + "lock": false, + "relay": true + }, + "vendor": "Plugwise", + "zigbee_mac_address": "000D6F000D13CCFD" + }, + "29542b2b6a6a4169acecc15c72a599b8": { + "available": true, + "dev_class": "water_heater_vessel_plug", + "firmware": "2020-11-10T01:00:00+01:00", + "location": "8201a2ac4d1b4303bf994e18d67311eb", + "model": "Plug", + "model_id": "160-01", + "name": "Plug Thermex Boiler", + "sensors": { + "electricity_consumed": 0.69, + "electricity_consumed_interval": 0.0, + "electricity_produced": 0.0, + "electricity_produced_interval": 0.0 + }, + "switches": { + "lock": true, + "relay": true + }, + "vendor": "Plugwise", + "zigbee_mac_address": "000D6F000D13CA9A" + }, + "854f8a9b0e7e425db97f1f110e1ce4b3": { + "available": true, + "dev_class": "central_heating_pump_plug", + "firmware": "2020-11-10T01:00:00+01:00", + "location": "f2bf9048bef64cc5b6d5110154e33c81", + "model": "Plug", + "model_id": "160-01", + "name": "Plug Vloerverwarming", + "sensors": { + "electricity_consumed": 0.0, + "electricity_consumed_interval": 0.0, + "electricity_produced": 0.0, + "electricity_produced_interval": 0.0 + }, + "switches": { + "relay": false + }, + "vendor": "Plugwise", + "zigbee_mac_address": "000D6F000D13CB6F" + }, + "ad4838d7d35c4d6ea796ee12ae5aedf8": { + "dev_class": "thermostat", + "location": "f2bf9048bef64cc5b6d5110154e33c81", + "model": "ThermoTouch", + "model_id": "143.1", + "name": "Anna", + "sensors": { + "setpoint": 15.0, + "temperature": 19.5 + }, + "vendor": "Plugwise" + }, + "da224107914542988a88561b4452b0f6": { + "binary_sensors": { + "plugwise_notification": false + }, + "dev_class": "gateway", + "firmware": "3.9.0", + "gateway_modes": ["away", "full", "vacation"], + "hardware": "AME Smile 2.0 board", + "location": "bc93488efab249e5bc54fd7e175a6f91", + "mac_address": "D40FB2019891", + "model": "Gateway", + "model_id": "smile_open_therm", + "name": "Adam", + "notifications": {}, + "regulation_modes": ["bleeding_cold", "heating", "off", "bleeding_hot"], + "select_gateway_mode": "full", + "select_regulation_mode": "heating", + "sensors": { + "outdoor_temperature": 13.9 + }, + "vendor": "Plugwise", + "zigbee_mac_address": "000D6F000D5A168D" + }, + "da575e9e09b947e281fb6e3ebce3b174": { + "available": true, + "binary_sensors": { + "low_battery": false + }, + "dev_class": "zone_thermometer", + "firmware": "2020-09-01T02:00:00+02:00", + "hardware": "1", + "location": "f2bf9048bef64cc5b6d5110154e33c81", + "model": "Jip", + "model_id": "168-01", + "name": "Jip", + "sensors": { + "battery": 100, + "humidity": 63.9, + "setpoint": 15.0, + "temperature": 18.8 + }, + "vendor": "Plugwise", + "zigbee_mac_address": "70AC08FFFEE16437" + }, + "e2f4322d57924fa090fbbc48b3a140dc": { + "available": true, + "binary_sensors": { + "low_battery": false + }, + "dev_class": "zone_thermostat", + "firmware": "2016-10-10T02:00:00+02:00", + "hardware": "255", + "location": "f871b8c4d63549319221e294e4f88074", + "model": "Lisa", + "model_id": "158-01", + "name": "Lisa Badkamer", + "sensors": { + "battery": 71, + "setpoint": 12.0, + "temperature": 18.8 + }, + "temperature_offset": { + "lower_bound": -2.0, + "resolution": 0.1, + "setpoint": 0.0, + "upper_bound": 2.0 + }, + "vendor": "Plugwise", + "zigbee_mac_address": "000D6F000C869B61" + }, + "e8ef2a01ed3b4139a53bf749204fe6b4": { + "dev_class": "switching", + "members": [ + "2568cc4b9c1e401495d4741a5f89bee1", + "29542b2b6a6a4169acecc15c72a599b8" + ], + "model": "Switchgroup", + "name": "Test", + "switches": { + "relay": true + }, + "vendor": "Plugwise" + }, + "f2bf9048bef64cc5b6d5110154e33c81": { + "active_preset": "vacation", + "available_schedules": [ + "Badkamer", + "Vakantie", + "Weekschema", + "Test", + "off" + ], + "climate_mode": "heat", + "control_state": "idle", + "dev_class": "climate", + "model": "ThermoZone", + "name": "Living room", + "preset_modes": ["vacation", "no_frost", "asleep", "home", "away"], + "select_schedule": "off", + "sensors": { + "electricity_consumed": 15.6, + "electricity_produced": 0.0, + "temperature": 18.8 + }, + "thermostat": { + "lower_bound": 1.0, + "resolution": 0.01, + "setpoint": 15.0, + "upper_bound": 35.0 + }, + "thermostats": { + "primary": [ + "ad4838d7d35c4d6ea796ee12ae5aedf8", + "14df5c4dc8cb4ba69f9d1ac0eaf7c5c6", + "da575e9e09b947e281fb6e3ebce3b174" + ], + "secondary": [] + }, + "vendor": "Plugwise" + }, + "f871b8c4d63549319221e294e4f88074": { + "active_preset": "vacation", + "available_schedules": [ + "Badkamer", + "Vakantie", + "Weekschema", + "Test", + "off" + ], + "climate_mode": "heat", + "control_state": "idle", + "dev_class": "climate", + "model": "ThermoZone", + "name": "Bathroom", + "preset_modes": ["vacation", "no_frost", "asleep", "home", "away"], + "select_schedule": "off", + "sensors": { + "electricity_consumed": 0.0, + "electricity_produced": 0.0, + "temperature": 18.8 + }, + "thermostat": { + "lower_bound": 0.0, + "resolution": 0.01, + "setpoint": 12.0, + "upper_bound": 99.9 + }, + "thermostats": { + "primary": ["e2f4322d57924fa090fbbc48b3a140dc"], + "secondary": ["1772a4ea304041adb83f357b751341ff"] + }, + "vendor": "Plugwise" + } + } +} diff --git a/tests/test_adam.py b/tests/test_adam.py index 4a6268cdf..ba8a71095 100644 --- a/tests/test_adam.py +++ b/tests/test_adam.py @@ -181,6 +181,28 @@ async def test_connect_adam_plus_anna_new(self): await api.close_connection() await self.disconnect(server, client) + @pytest.mark.asyncio + async def test_connect_adam_anna_new_2(self): + """Test extended Adam (firmware 3.9) with Emma setup.""" + self.smile_setup = "adam_anna_new_2" + + testdata = await self.load_testdata(SMILE_TYPE, self.smile_setup) + server, api, client = await self.connect_wrapper() + assert api.smile.hostname == "smile000000" + + self.validate_test_basics( + _LOGGER, + api, + smile_type=None, + smile_version="3.9.0", + ) + + await self.device_test(api, "2025-10-12 00:00:01", testdata) + assert self.entity_items == 195 + + await api.close_connection() + await self.disconnect(server, client) + @pytest.mark.asyncio async def test_connect_adam_plus_anna_new_regulation_off(self): """Test regultaion_mode off with control_state key missing for Adam.""" diff --git a/userdata/adam_anna_new_2/core.domain_objects.xml b/userdata/adam_anna_new_2/core.domain_objects.xml new file mode 100644 index 000000000..798be0f7c --- /dev/null +++ b/userdata/adam_anna_new_2/core.domain_objects.xml @@ -0,0 +1,2439 @@ + + + + Badkamer + +