diff --git a/CHANGELOG.md b/CHANGELOG.md index 042b4215f..a6ce22a6f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,13 @@ ## Versions from 0.40 and up +## v0.55.0 + +- **BREAKING change for Adam**: the existing device-based climate entities will be replaced by new zone-based climate entities, most likely with a different name. +- New Feature: implement zone-based climate entities for Adam, solving HA Core Issue [130597](https://github.com/home-assistant/core/issues/130597). +- Also new: add the provided zone sensors. +- Link to plugwise [v1.6.0](https://github.com/plugwise/python-plugwise/releases/tag/v1.6.0). + ## v0.54.3 - Bugfix for #768 via plugwise [v1.5.2](https://github.com/plugwise/python-plugwise/releases/tag/v1.5.2). diff --git a/README.md b/README.md index 6b5817933..ee2e44f12 100644 --- a/README.md +++ b/README.md @@ -52,7 +52,7 @@ Our [Changelog](CHANGELOG.MD) is available as a [separate file](CHANGELOG.md) in ### What do we support (in short)? - Thermostats - - Adam (firmware 2.x and 3.x) and the accompanying Lisa's, Tom's, Floor's, Koen's and Plugs. + - Adam (firmware 2.x and 3.x) and the accompanying Anna, Jip's, Lisa's, Tom's, Floor's and Plugs (Koen via a Plug). From v0.55.0 zones with one or more thermostats are represented as a single and separate climate-entity in HA. - Anna (firmware 1.x, 3.x and 4.x) - Notifications for both types - Power-related @@ -70,6 +70,7 @@ As such we ask USB users, who are tied in with the `custom_component` as there i ### What can I expect in HA Core from this component - `binary_sensor` and `sensor`: A number of sensoric values depending on your hardware: outdoor temperature, Anna's illuminance, Tom's valve position, Plug's and Circle/Stealth's power-values, P1 power- and gas-values, Plugwise Notifications. +- `button`: A reboot-button is available for the Gateways that support this function. - `climate`: A (number of) thermostat(s) visible in HA, including temperature, presets and heating-demand status, per thermostat. Also, setting of temperature, preset and switching the active schedule on and off. Cooling is only supported in combination with an Anna (fw 3.1 and 4.0). - `number`: Numerical indication on boiler setpoints. - `select`: Input selector to choose the active schedule. diff --git a/custom_components/plugwise/climate.py b/custom_components/plugwise/climate.py index 4d0a1c786..7a0d1d615 100644 --- a/custom_components/plugwise/climate.py +++ b/custom_components/plugwise/climate.py @@ -80,9 +80,18 @@ def _add_entities() -> None: return entities: list[PlugwiseClimateEntity] = [] + gateway_name = coordinator.data.gateway[SMILE_NAME] for device_id in coordinator.new_devices: device = coordinator.data.devices[device_id] - if device[DEV_CLASS] in MASTER_THERMOSTATS: + if gateway_name == "Adam": + if device[DEV_CLASS] == "climate": + entities.append( + PlugwiseClimateEntity( + coordinator, device_id, homekit_enabled + ) # pw-beta homekit emulation + ) + LOGGER.debug("Add climate %s", device[ATTR_NAME]) + elif device[DEV_CLASS] in MASTER_THERMOSTATS: entities.append( PlugwiseClimateEntity( coordinator, device_id, homekit_enabled @@ -118,6 +127,11 @@ def __init__( super().__init__(coordinator, device_id) self._homekit_enabled = homekit_enabled # pw-beta homekit emulation + + self._location = device_id + if (location := self.device.get(LOCATION)) is not None: + self._location = location + gateway_id: str = coordinator.data.gateway[GATEWAY_ID] self.gateway_data = coordinator.data.devices[gateway_id] @@ -273,7 +287,7 @@ async def async_set_temperature(self, **kwargs: Any) -> None: if mode := kwargs.get(ATTR_HVAC_MODE): await self.async_set_hvac_mode(mode) - await self.coordinator.api.set_temperature(self.device[LOCATION], data) + await self.coordinator.api.set_temperature(self._location, data) @plugwise_command async def async_set_hvac_mode(self, hvac_mode: HVACMode) -> None: @@ -286,7 +300,7 @@ async def async_set_hvac_mode(self, hvac_mode: HVACMode) -> None: if hvac_mode != HVACMode.OFF: await self.coordinator.api.set_schedule_state( - self.device[LOCATION], + self._location, STATE_ON if hvac_mode == HVACMode.AUTO else STATE_OFF, ) @@ -310,4 +324,4 @@ async def async_set_hvac_mode(self, hvac_mode: HVACMode) -> None: @plugwise_command async def async_set_preset_mode(self, preset_mode: str) -> None: """Set the preset mode.""" - await self.coordinator.api.set_preset(self.device[LOCATION], preset_mode) + await self.coordinator.api.set_preset(self._location, preset_mode) diff --git a/custom_components/plugwise/const.py b/custom_components/plugwise/const.py index df5a1b725..52e13c892 100644 --- a/custom_components/plugwise/const.py +++ b/custom_components/plugwise/const.py @@ -17,7 +17,6 @@ CONF_HOMEKIT_EMULATION: Final = "homekit_emulation" # pw-beta options CONF_REFRESH_INTERVAL: Final = "refresh_interval" # pw-beta options CONF_MANUAL_PATH: Final = "Enter Manually" -DEVICES: Final = "devices" GATEWAY: Final = "gateway" LOCATION: Final = "location" MAC_ADDRESS: Final = "mac_address" diff --git a/custom_components/plugwise/coordinator.py b/custom_components/plugwise/coordinator.py index f36242767..22aa78abc 100644 --- a/custom_components/plugwise/coordinator.py +++ b/custom_components/plugwise/coordinator.py @@ -78,7 +78,7 @@ async def _connect(self) -> None: version = await self.api.connect() self._connected = isinstance(version, Version) if self._connected: - self.api.get_all_devices() + self.api.get_all_gateway_entities() self.update_interval = DEFAULT_SCAN_INTERVAL.get( self.api.smile_type, timedelta(seconds=60) ) # pw-beta options scan-interval @@ -91,7 +91,7 @@ async def _connect(self) -> None: async def _async_update_data(self) -> PlugwiseData: """Fetch data from Plugwise.""" - data = PlugwiseData({}, {}) + data = PlugwiseData(devices={}, gateway={}) try: if not self._connected: await self._connect() @@ -148,7 +148,7 @@ async def async_remove_devices(self, data: PlugwiseData, entry: ConfigEntry) -> device_entry.id, remove_config_entry_id=entry.entry_id ) LOGGER.debug( - "Removed %s device %s %s from device_registry", + "Removed %s device/zone %s %s from device_registry", DOMAIN, device_entry.model, identifier[1], diff --git a/custom_components/plugwise/diagnostics.py b/custom_components/plugwise/diagnostics.py index 9d15ea4fe..47ff7d1a9 100644 --- a/custom_components/plugwise/diagnostics.py +++ b/custom_components/plugwise/diagnostics.py @@ -15,6 +15,6 @@ async def async_get_config_entry_diagnostics( """Return diagnostics for a config entry.""" coordinator = entry.runtime_data return { - "gateway": coordinator.data.gateway, "devices": coordinator.data.devices, + "gateway": coordinator.data.gateway, } diff --git a/custom_components/plugwise/entity.py b/custom_components/plugwise/entity.py index a96886a49..446c3603a 100644 --- a/custom_components/plugwise/entity.py +++ b/custom_components/plugwise/entity.py @@ -2,7 +2,7 @@ from __future__ import annotations -from plugwise.constants import DeviceData +from plugwise.constants import GwEntityData from homeassistant.const import ATTR_NAME, ATTR_VIA_DEVICE, CONF_HOST from homeassistant.helpers.device_registry import ( @@ -82,7 +82,7 @@ def __init__( def available(self) -> bool: """Return if entity is available.""" return ( - # Upstream: Do not change the AVAILABLE line below: some Plugwise devices + # Upstream: Do not change the AVAILABLE line below: some Plugwise devices and zones # Upstream: do not provide their availability-status! self._dev_id in self.coordinator.data.devices and (AVAILABLE not in self.device or self.device[AVAILABLE] is True) @@ -90,7 +90,7 @@ def available(self) -> bool: ) @property - def device(self) -> DeviceData: + def device(self) -> GwEntityData: """Return data for this device.""" return self.coordinator.data.devices[self._dev_id] diff --git a/custom_components/plugwise/manifest.json b/custom_components/plugwise/manifest.json index de0d5cb24..da1ba290c 100644 --- a/custom_components/plugwise/manifest.json +++ b/custom_components/plugwise/manifest.json @@ -7,7 +7,7 @@ "integration_type": "hub", "iot_class": "local_polling", "loggers": ["plugwise"], - "requirements": ["plugwise==1.5.2"], - "version": "0.54.3", + "requirements": ["plugwise==1.6.0"], + "version": "0.55.0", "zeroconf": ["_plugwise._tcp.local."] } diff --git a/custom_components/plugwise/select.py b/custom_components/plugwise/select.py index e0757ad09..ebc291314 100644 --- a/custom_components/plugwise/select.py +++ b/custom_components/plugwise/select.py @@ -105,6 +105,7 @@ def _add_entities() -> None: LOGGER.debug( "Add %s %s selector", device["name"], description.translation_key ) + async_add_entities(entities) _add_entities() @@ -124,8 +125,12 @@ def __init__( ) -> None: """Initialise the selector.""" super().__init__(coordinator, device_id) - self.entity_description = entity_description self._attr_unique_id = f"{device_id}-{entity_description.key}" + self.entity_description = entity_description + + self._location = device_id + if (location := self.device.get(LOCATION)) is not None: + self._location = location @property def current_option(self) -> str: @@ -141,10 +146,10 @@ def options(self) -> list[str]: async def async_select_option(self, option: str) -> None: """Change to the selected entity option. - self.device[LOCATION] and STATE_ON are required for the thermostat-schedule select. + Location ID and STATE_ON are required for the thermostat-schedule select. """ await self.coordinator.api.set_select( - self.entity_description.key, self.device[LOCATION], option, STATE_ON + self.entity_description.key, self._location, option, STATE_ON ) LOGGER.debug( "Set %s to %s was successful", diff --git a/custom_components/plugwise/sensor.py b/custom_components/plugwise/sensor.py index 365c8a09b..156d3ac1f 100644 --- a/custom_components/plugwise/sensor.py +++ b/custom_components/plugwise/sensor.py @@ -492,6 +492,7 @@ def _add_entities() -> None: LOGGER.debug( "Add %s %s sensor", device["name"], description.translation_key or description.key ) + async_add_entities(entities) _add_entities() diff --git a/tests/components/plugwise/conftest.py b/tests/components/plugwise/conftest.py index b9ed1b1e5..ccda62ffa 100644 --- a/tests/components/plugwise/conftest.py +++ b/tests/components/plugwise/conftest.py @@ -104,7 +104,7 @@ def mock_smile_adam() -> Generator[MagicMock]: smile = smile_mock.return_value smile.async_update.return_value = PlugwiseData( - all_data["gateway"], all_data["devices"] + all_data["devices"], all_data["gateway"] ) smile.connect.return_value = Version("3.0.15") smile.gateway_id = "fe799307f1624099878210aa0b9f1475" @@ -129,7 +129,7 @@ def mock_smile_adam_heat_cool(chosen_env: str) -> Generator[MagicMock]: smile = smile_mock.return_value smile.async_update.return_value = PlugwiseData( - all_data["gateway"], all_data["devices"] + all_data["devices"], all_data["gateway"] ) smile.connect.return_value = Version("3.6.4") smile.gateway_id = "da224107914542988a88561b4452b0f6" @@ -155,7 +155,7 @@ def mock_smile_adam_4() -> Generator[MagicMock]: smile = smile_mock.return_value smile.async_update.return_value = PlugwiseData( - all_data["gateway"], all_data["devices"] + all_data["devices"], all_data["gateway"] ) smile.connect.return_value = Version("3.2.8") smile.gateway_id = "b5c2386c6f6342669e50fe49dd05b188" @@ -180,7 +180,7 @@ def mock_smile_anna(chosen_env: str) -> Generator[MagicMock]: smile = smile_mock.return_value smile.async_update.return_value = PlugwiseData( - all_data["gateway"], all_data["devices"] + all_data["devices"], all_data["gateway"] ) smile.connect.return_value = Version("4.0.15") smile.gateway_id = "015ae9ea3f964e668e490fa39da3870b" @@ -205,7 +205,7 @@ def mock_smile_p1(chosen_env: str, gateway_id: str) -> Generator[MagicMock]: smile = smile_mock.return_value smile.async_update.return_value = PlugwiseData( - all_data["gateway"], all_data["devices"] + all_data["devices"], all_data["gateway"] ) smile.connect.return_value = Version("4.4.2") smile.gateway_id = gateway_id @@ -231,7 +231,7 @@ def mock_smile_legacy_anna() -> Generator[MagicMock]: smile = smile_mock.return_value smile.async_update.return_value = PlugwiseData( - all_data["gateway"], all_data["devices"] + all_data["devices"], all_data["gateway"] ) smile.connect.return_value = Version("1.8.22") smile.gateway_id = "0000aaaa0000aaaa0000aaaa0000aa00" @@ -257,7 +257,7 @@ def mock_stretch() -> Generator[MagicMock]: smile = smile_mock.return_value smile.async_update.return_value = PlugwiseData( - all_data["gateway"], all_data["devices"] + all_data["devices"], all_data["gateway"] ) smile.connect.return_value = Version("3.1.11") smile.gateway_id = "259882df3c05415b99c2d962534ce820" diff --git a/tests/components/plugwise/fixtures/adam_plus_anna_new/all_data.json b/tests/components/plugwise/fixtures/adam_plus_anna_new/all_data.json new file mode 100644 index 000000000..5aafe2fb7 --- /dev/null +++ b/tests/components/plugwise/fixtures/adam_plus_anna_new/all_data.json @@ -0,0 +1,323 @@ +{ + "devices": { + "056ee145a816487eaa69243c3280f8bf": { + "available": true, + "binary_sensors": { + "dhw_state": false, + "flame_state": true, + "heating_state": true + }, + "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": 23.9, + "water_temperature": 30.0 + }, + "switches": { + "dhw_cm_switch": false + } + }, + "10016900610d4c7481df78c89606ef22": { + "available": true, + "dev_class": "valve_actuator_plug", + "location": "d9786723dbcf4f19b5c629a54629f9c7", + "model_id": "TS0011", + "name": "Aanvoer water afsluiter (nous lz3)", + "switches": { + "relay": false + }, + "vendor": "_TZ3000_abjodzas", + "zigbee_mac_address": "A4C13862AF9917B1" + }, + "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": 99, + "setpoint": 18.0, + "temperature": 17.6, + "temperature_difference": -0.2, + "valve_position": 100 + }, + "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": 14.8, + "electricity_consumed_interval": 3.0, + "electricity_produced": 0.0, + "electricity_produced_interval": 0.0 + }, + "switches": { + "lock": true, + "relay": true + }, + "vendor": "Plugwise", + "zigbee_mac_address": "000D6F000D13CCFD" + }, + "29542b2b6a6a4169acecc15c72a599b8": { + "available": true, + "dev_class": "computer_desktop_plug", + "firmware": "2020-11-10T01:00:00+01:00", + "location": "f2bf9048bef64cc5b6d5110154e33c81", + "model": "Plug", + "model_id": "160-01", + "name": "Plug Werkplek", + "sensors": { + "electricity_consumed": 91.3, + "electricity_consumed_interval": 23.0, + "electricity_produced": 0.0, + "electricity_produced_interval": 0.0 + }, + "switches": { + "lock": false, + "relay": true + }, + "vendor": "Plugwise", + "zigbee_mac_address": "000D6F000D13CA9A" + }, + "67d73d0bd469422db25a618a5fb8eeb0": { + "available": true, + "dev_class": "heater_central_plug", + "location": "b4f211175e124df59603412bafa77a34", + "model": "Aqara Smart Plug", + "model_id": "lumi.plug.maeu01", + "name": "SmartPlug Floor 0", + "sensors": { + "electricity_consumed_interval": 0.0 + }, + "switches": { + "lock": false, + "relay": true + }, + "vendor": "LUMI", + "zigbee_mac_address": "54EF4410002C97F2" + }, + "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": 43.8, + "electricity_consumed_interval": 0.0, + "electricity_produced": 0.0, + "electricity_produced_interval": 0.0 + }, + "switches": { + "relay": true + }, + "vendor": "Plugwise", + "zigbee_mac_address": "000D6F000D13CB6F" + }, + "ad4838d7d35c4d6ea796ee12ae5aedf8": { + "dev_class": "thermostat", + "location": "f2bf9048bef64cc5b6d5110154e33c81", + "model": "ThermoTouch", + "model_id": "143.1", + "name": "Anna", + "sensors": { + "setpoint": 18.5, + "temperature": 18.4 + }, + "vendor": "Plugwise" + }, + "da224107914542988a88561b4452b0f6": { + "binary_sensors": { + "plugwise_notification": false + }, + "dev_class": "gateway", + "firmware": "3.7.8", + "gateway_modes": [ + "away", + "full", + "vacation" + ], + "hardware": "AME Smile 2.0 board", + "location": "bc93488efab249e5bc54fd7e175a6f91", + "mac_address": "012345679891", + "model": "Gateway", + "model_id": "smile_open_therm", + "name": "Adam", + "regulation_modes": [ + "bleeding_hot", + "bleeding_cold", + "off", + "heating" + ], + "select_gateway_mode": "full", + "select_regulation_mode": "heating", + "sensors": { + "outdoor_temperature": 9.19 + }, + "vendor": "Plugwise", + "zigbee_mac_address": "000D6F000D5A168D" + }, + "e2f4322d57924fa090fbbc48b3a140dc": { + "available": true, + "binary_sensors": { + "low_battery": true + }, + "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": 14, + "setpoint": 18.0, + "temperature": 16.5 + }, + "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": "home", + "available_schedules": [ + "Badkamer", + "Test", + "Vakantie", + "Weekschema", + "off" + ], + "climate_mode": "auto", + "control_state": "heating", + "dev_class": "climate", + "model": "ThermoZone", + "name": "Living room", + "preset_modes": [ + "no_frost", + "asleep", + "vacation", + "home", + "away" + ], + "select_schedule": "Weekschema", + "sensors": { + "electricity_consumed": 149.9, + "electricity_produced": 0.0, + "temperature": 18.4 + }, + "thermostat": { + "lower_bound": 1.0, + "resolution": 0.01, + "setpoint": 18.5, + "upper_bound": 35.0 + }, + "thermostats": { + "primary": [ + "ad4838d7d35c4d6ea796ee12ae5aedf8" + ], + "secondary": [] + }, + "vendor": "Plugwise" + }, + "f871b8c4d63549319221e294e4f88074": { + "active_preset": "home", + "available_schedules": [ + "Badkamer", + "Test", + "Vakantie", + "Weekschema", + "off" + ], + "climate_mode": "auto", + "control_state": "preheating", + "dev_class": "climate", + "model": "ThermoZone", + "name": "Bathroom", + "preset_modes": [ + "no_frost", + "asleep", + "vacation", + "home", + "away" + ], + "select_schedule": "Badkamer", + "sensors": { + "electricity_consumed": 0.0, + "electricity_produced": 0.0, + "temperature": 16.5 + }, + "thermostat": { + "lower_bound": 0.0, + "resolution": 0.01, + "setpoint": 18.0, + "upper_bound": 99.9 + }, + "thermostats": { + "primary": [ + "e2f4322d57924fa090fbbc48b3a140dc" + ], + "secondary": [ + "1772a4ea304041adb83f357b751341ff" + ] + }, + "vendor": "Plugwise" + } + }, + "gateway": { + "cooling_present": false, + "gateway_id": "da224107914542988a88561b4452b0f6", + "heater_id": "056ee145a816487eaa69243c3280f8bf", + "item_count": 177, + "notifications": {}, + "reboot": true, + "smile_name": "Adam" + } +} diff --git a/tests/components/plugwise/fixtures/anna_v4/all_data.json b/tests/components/plugwise/fixtures/anna_v4/all_data.json new file mode 100644 index 000000000..a9c312534 --- /dev/null +++ b/tests/components/plugwise/fixtures/anna_v4/all_data.json @@ -0,0 +1,107 @@ +{ + "devices": { + "01b85360fdd243d0aaad4d6ac2a5ba7e": { + "active_preset": "home", + "available_schedules": [ + "Standaard", + "Thuiswerken", + "off" + ], + "climate_mode": "heat", + "dev_class": "thermostat", + "firmware": "2018-02-08T11:15:53+01:00", + "hardware": "6539-1301-5002", + "location": "eb5309212bf5407bb143e5bfa3b18aee", + "model": "ThermoTouch", + "name": "Anna", + "preset_modes": [ + "vacation", + "no_frost", + "away", + "asleep", + "home" + ], + "select_schedule": "off", + "sensors": { + "illuminance": 60.0, + "setpoint": 20.5, + "temperature": 20.6 + }, + "temperature_offset": { + "lower_bound": -2.0, + "resolution": 0.1, + "setpoint": 0.0, + "upper_bound": 2.0 + }, + "thermostat": { + "lower_bound": 4.0, + "resolution": 0.1, + "setpoint": 20.5, + "upper_bound": 30.0 + }, + "vendor": "Plugwise" + }, + "0466eae8520144c78afb29628384edeb": { + "binary_sensors": { + "plugwise_notification": false + }, + "dev_class": "gateway", + "firmware": "4.0.15", + "hardware": "AME Smile 2.0 board", + "location": "94c107dc6ac84ed98e9f68c0dd06bf71", + "mac_address": "012345670001", + "model": "Gateway", + "model_id": "smile_thermo", + "name": "Smile Anna", + "sensors": { + "outdoor_temperature": 7.44 + }, + "vendor": "Plugwise" + }, + "cd0e6156b1f04d5f952349ffbe397481": { + "available": true, + "binary_sensors": { + "dhw_state": false, + "flame_state": false, + "heating_state": true + }, + "dev_class": "heater_central", + "location": "94c107dc6ac84ed98e9f68c0dd06bf71", + "max_dhw_temperature": { + "lower_bound": 30.0, + "resolution": 0.01, + "setpoint": 60.0, + "upper_bound": 60.0 + }, + "maximum_boiler_temperature": { + "lower_bound": 0.0, + "resolution": 1.0, + "setpoint": 70.0, + "upper_bound": 100.0 + }, + "model": "Generic heater", + "model_id": "2.32", + "name": "OpenTherm", + "sensors": { + "intended_boiler_temperature": 39.9, + "modulation_level": 0.0, + "return_temperature": 32.0, + "water_pressure": 2.2, + "water_temperature": 45.0 + }, + "switches": { + "dhw_cm_switch": false + }, + "vendor": "Bosch Thermotechniek B.V." + } + }, + "gateway": { + "cooling_present": false, + "gateway_id": "0466eae8520144c78afb29628384edeb", + "heater_id": "cd0e6156b1f04d5f952349ffbe397481", + "item_count": 58, + "notifications": {}, + "reboot": true, + "smile_name": "Smile Anna" + } +} diff --git a/tests/components/plugwise/fixtures/m_adam_cooling/all_data.json b/tests/components/plugwise/fixtures/m_adam_cooling/all_data.json index 90d9ab8d9..f594f07bb 100644 --- a/tests/components/plugwise/fixtures/m_adam_cooling/all_data.json +++ b/tests/components/plugwise/fixtures/m_adam_cooling/all_data.json @@ -31,7 +31,7 @@ "binary_sensors": { "low_battery": false }, - "dev_class": "thermo_sensor", + "dev_class": "thermostatic_radiator_valve", "firmware": "2020-11-04T01:00:00+01:00", "hardware": "1", "location": "f871b8c4d63549319221e294e4f88074", @@ -40,6 +40,7 @@ "name": "Tom Badkamer", "sensors": { "battery": 99, + "setpoint": 18.0, "temperature": 21.6, "temperature_difference": -0.2, "valve_position": 100 @@ -54,40 +55,16 @@ "zigbee_mac_address": "000D6F000C8FF5EE" }, "ad4838d7d35c4d6ea796ee12ae5aedf8": { - "active_preset": "home", "available": true, - "available_schedules": [ - "Badkamer", - "Test", - "Vakantie", - "Weekschema", - "off" - ], - "climate_mode": "cool", - "control_state": "cooling", "dev_class": "thermostat", "location": "f2bf9048bef64cc5b6d5110154e33c81", "model": "ThermoTouch", "model_id": "143.1", "name": "Anna", - "preset_modes": [ - "no_frost", - "asleep", - "vacation", - "home", - "away" - ], - "select_schedule": "off", "sensors": { "setpoint": 23.5, "temperature": 25.8 }, - "thermostat": { - "lower_bound": 1.0, - "resolution": 0.01, - "setpoint": 23.5, - "upper_bound": 35.0 - }, "vendor": "Plugwise" }, "da224107914542988a88561b4452b0f6": { @@ -123,20 +100,10 @@ "zigbee_mac_address": "000D6F000D5A168D" }, "e2f4322d57924fa090fbbc48b3a140dc": { - "active_preset": "home", "available": true, - "available_schedules": [ - "Badkamer", - "Test", - "Vakantie", - "Weekschema", - "off" - ], "binary_sensors": { "low_battery": true }, - "climate_mode": "auto", - "control_state": "preheating", "dev_class": "zone_thermostat", "firmware": "2016-10-10T02:00:00+02:00", "hardware": "255", @@ -144,14 +111,6 @@ "model": "Lisa", "model_id": "158-01", "name": "Lisa Badkamer", - "preset_modes": [ - "no_frost", - "asleep", - "vacation", - "home", - "away" - ], - "select_schedule": "Badkamer", "sensors": { "battery": 14, "setpoint": 23.5, @@ -163,12 +122,6 @@ "setpoint": 0.0, "upper_bound": 2.0 }, - "thermostat": { - "lower_bound": 0.0, - "resolution": 0.01, - "setpoint": 25.0, - "upper_bound": 99.9 - }, "vendor": "Plugwise", "zigbee_mac_address": "000D6F000C869B61" }, @@ -182,7 +135,92 @@ "name": "Test", "switches": { "relay": true - } + }, + "vendor": "Plugwise" + }, + "f2bf9048bef64cc5b6d5110154e33c81": { + "active_preset": "home", + "available_schedules": [ + "Badkamer", + "Test", + "Vakantie", + "Weekschema", + "off" + ], + "climate_mode": "cool", + "control_state": "cooling", + "dev_class": "climate", + "model": "ThermoZone", + "name": "Living room", + "preset_modes": [ + "no_frost", + "asleep", + "vacation", + "home", + "away" + ], + "select_schedule": "off", + "sensors": { + "electricity_consumed": 149.9, + "electricity_produced": 0.0, + "temperature": 25.8 + }, + "thermostat": { + "lower_bound": 1.0, + "resolution": 0.01, + "setpoint": 23.5, + "upper_bound": 35.0 + }, + "thermostats": { + "primary": [ + "ad4838d7d35c4d6ea796ee12ae5aedf8" + ], + "secondary": [] + }, + "vendor": "Plugwise" + }, + "f871b8c4d63549319221e294e4f88074": { + "active_preset": "home", + "available_schedules": [ + "Badkamer", + "Test", + "Vakantie", + "Weekschema", + "off" + ], + "climate_mode": "cool", + "control_state": "auto", + "dev_class": "climate", + "model": "ThermoZone", + "name": "Bathroom", + "preset_modes": [ + "no_frost", + "asleep", + "vacation", + "home", + "away" + ], + "select_schedule": "Badkamer", + "sensors": { + "electricity_consumed": 0.0, + "electricity_produced": 0.0, + "temperature": 23.9 + }, + "thermostat": { + "lower_bound": 0.0, + "resolution": 0.01, + "setpoint": 25.0, + "upper_bound": 99.9 + }, + "thermostats": { + "primary": [ + "e2f4322d57924fa090fbbc48b3a140dc" + ], + "secondary": [ + "1772a4ea304041adb83f357b751341ff" + ] + }, + "vendor": "Plugwise" } }, "gateway": { diff --git a/tests/components/plugwise/fixtures/m_adam_heating/all_data.json b/tests/components/plugwise/fixtures/m_adam_heating/all_data.json index 7e6a5a103..7b350dddb 100644 --- a/tests/components/plugwise/fixtures/m_adam_heating/all_data.json +++ b/tests/components/plugwise/fixtures/m_adam_heating/all_data.json @@ -36,7 +36,7 @@ "binary_sensors": { "low_battery": false }, - "dev_class": "thermo_sensor", + "dev_class": "thermostatic_radiator_valve", "firmware": "2020-11-04T01:00:00+01:00", "hardware": "1", "location": "f871b8c4d63549319221e294e4f88074", @@ -45,6 +45,7 @@ "name": "Tom Badkamer", "sensors": { "battery": 99, + "setpoint": 18.0, "temperature": 18.6, "temperature_difference": -0.2, "valve_position": 100 @@ -59,40 +60,16 @@ "zigbee_mac_address": "000D6F000C8FF5EE" }, "ad4838d7d35c4d6ea796ee12ae5aedf8": { - "active_preset": "home", "available": true, - "available_schedules": [ - "Badkamer", - "Test", - "Vakantie", - "Weekschema", - "off" - ], - "climate_mode": "heat", - "control_state": "preheating", "dev_class": "thermostat", "location": "f2bf9048bef64cc5b6d5110154e33c81", "model": "ThermoTouch", "model_id": "143.1", "name": "Anna", - "preset_modes": [ - "no_frost", - "asleep", - "vacation", - "home", - "away" - ], - "select_schedule": "off", "sensors": { "setpoint": 20.0, "temperature": 19.1 }, - "thermostat": { - "lower_bound": 1.0, - "resolution": 0.01, - "setpoint": 20.0, - "upper_bound": 35.0 - }, "vendor": "Plugwise" }, "da224107914542988a88561b4452b0f6": { @@ -127,20 +104,10 @@ "zigbee_mac_address": "000D6F000D5A168D" }, "e2f4322d57924fa090fbbc48b3a140dc": { - "active_preset": "home", "available": true, - "available_schedules": [ - "Badkamer", - "Test", - "Vakantie", - "Weekschema", - "off" - ], "binary_sensors": { "low_battery": true }, - "climate_mode": "auto", - "control_state": "off", "dev_class": "zone_thermostat", "firmware": "2016-10-10T02:00:00+02:00", "hardware": "255", @@ -148,14 +115,6 @@ "model": "Lisa", "model_id": "158-01", "name": "Lisa Badkamer", - "preset_modes": [ - "no_frost", - "asleep", - "vacation", - "home", - "away" - ], - "select_schedule": "Badkamer", "sensors": { "battery": 14, "setpoint": 15.0, @@ -167,12 +126,6 @@ "setpoint": 0.0, "upper_bound": 2.0 }, - "thermostat": { - "lower_bound": 0.0, - "resolution": 0.01, - "setpoint": 15.0, - "upper_bound": 99.9 - }, "vendor": "Plugwise", "zigbee_mac_address": "000D6F000C869B61" }, @@ -186,7 +139,92 @@ "name": "Test", "switches": { "relay": true - } + }, + "vendor": "Plugwise" + }, + "f2bf9048bef64cc5b6d5110154e33c81": { + "active_preset": "home", + "available_schedules": [ + "Badkamer", + "Test", + "Vakantie", + "Weekschema", + "off" + ], + "climate_mode": "heat", + "control_state": "preheating", + "dev_class": "climate", + "model": "ThermoZone", + "name": "Living room", + "preset_modes": [ + "no_frost", + "asleep", + "vacation", + "home", + "away" + ], + "select_schedule": "off", + "sensors": { + "electricity_consumed": 149.9, + "electricity_produced": 0.0, + "temperature": 19.1 + }, + "thermostat": { + "lower_bound": 1.0, + "resolution": 0.01, + "setpoint": 20.0, + "upper_bound": 35.0 + }, + "thermostats": { + "primary": [ + "ad4838d7d35c4d6ea796ee12ae5aedf8" + ], + "secondary": [] + }, + "vendor": "Plugwise" + }, + "f871b8c4d63549319221e294e4f88074": { + "active_preset": "home", + "available_schedules": [ + "Badkamer", + "Test", + "Vakantie", + "Weekschema", + "off" + ], + "climate_mode": "auto", + "control_state": "off", + "dev_class": "climate", + "model": "ThermoZone", + "name": "Bathroom", + "preset_modes": [ + "no_frost", + "asleep", + "vacation", + "home", + "away" + ], + "select_schedule": "Badkamer", + "sensors": { + "electricity_consumed": 0.0, + "electricity_produced": 0.0, + "temperature": 17.9 + }, + "thermostat": { + "lower_bound": 0.0, + "resolution": 0.01, + "setpoint": 15.0, + "upper_bound": 99.9 + }, + "thermostats": { + "primary": [ + "e2f4322d57924fa090fbbc48b3a140dc" + ], + "secondary": [ + "1772a4ea304041adb83f357b751341ff" + ] + }, + "vendor": "Plugwise" } }, "gateway": { diff --git a/tests/components/plugwise/fixtures/m_adam_jip/all_data.json b/tests/components/plugwise/fixtures/m_adam_jip/all_data.json index 569525975..fcc817271 100644 --- a/tests/components/plugwise/fixtures/m_adam_jip/all_data.json +++ b/tests/components/plugwise/fixtures/m_adam_jip/all_data.json @@ -1,13 +1,76 @@ { "devices": { - "1346fbd8498d4dbcab7e18d51b771f3d": { + "06aecb3d00354375924f50c47af36bd2": { "active_preset": "no_frost", + "climate_mode": "off", + "control_state": "off", + "dev_class": "climate", + "model": "ThermoZone", + "name": "Slaapkamer", + "preset_modes": [ + "home", + "asleep", + "away", + "vacation", + "no_frost" + ], + "sensors": { + "temperature": 24.2 + }, + "thermostat": { + "lower_bound": 0.0, + "resolution": 0.01, + "setpoint": 13.0, + "upper_bound": 99.9 + }, + "thermostats": { + "primary": [ + "1346fbd8498d4dbcab7e18d51b771f3d" + ], + "secondary": [ + "356b65335e274d769c338223e7af9c33" + ] + }, + "vendor": "Plugwise" + }, + "13228dab8ce04617af318a2888b3c548": { + "active_preset": "home", + "climate_mode": "heat", + "control_state": "off", + "dev_class": "climate", + "model": "ThermoZone", + "name": "Woonkamer", + "preset_modes": [ + "home", + "asleep", + "away", + "vacation", + "no_frost" + ], + "sensors": { + "temperature": 27.4 + }, + "thermostat": { + "lower_bound": 4.0, + "resolution": 0.01, + "setpoint": 9.0, + "upper_bound": 30.0 + }, + "thermostats": { + "primary": [ + "f61f1a2535f54f52ad006a3d18e459ca" + ], + "secondary": [ + "833de10f269c4deab58fb9df69901b4e" + ] + }, + "vendor": "Plugwise" + }, + "1346fbd8498d4dbcab7e18d51b771f3d": { "available": true, "binary_sensors": { "low_battery": false }, - "climate_mode": "off", - "control_state": "off", "dev_class": "zone_thermostat", "firmware": "2016-10-27T02:00:00+02:00", "hardware": "255", @@ -15,13 +78,6 @@ "model": "Lisa", "model_id": "158-01", "name": "Slaapkamer", - "preset_modes": [ - "home", - "asleep", - "away", - "vacation", - "no_frost" - ], "sensors": { "battery": 92, "setpoint": 13.0, @@ -33,18 +89,12 @@ "setpoint": 0.0, "upper_bound": 2.0 }, - "thermostat": { - "lower_bound": 0.0, - "resolution": 0.01, - "setpoint": 13.0, - "upper_bound": 99.9 - }, "vendor": "Plugwise", "zigbee_mac_address": "ABCD012345670A03" }, "1da4d325838e4ad8aac12177214505c9": { "available": true, - "dev_class": "thermo_sensor", + "dev_class": "thermostatic_radiator_valve", "firmware": "2020-11-04T01:00:00+01:00", "hardware": "1", "location": "d58fec52899f4f1c92e4f8fad6d8c48c", @@ -68,7 +118,7 @@ }, "356b65335e274d769c338223e7af9c33": { "available": true, - "dev_class": "thermo_sensor", + "dev_class": "thermostatic_radiator_valve", "firmware": "2020-11-04T01:00:00+01:00", "hardware": "1", "location": "06aecb3d00354375924f50c47af36bd2", @@ -108,13 +158,10 @@ "zigbee_mac_address": "ABCD012345670A06" }, "6f3e9d7084214c21b9dfa46f6eeb8700": { - "active_preset": "home", "available": true, "binary_sensors": { "low_battery": false }, - "climate_mode": "heat", - "control_state": "off", "dev_class": "zone_thermostat", "firmware": "2016-10-27T02:00:00+02:00", "hardware": "255", @@ -122,13 +169,6 @@ "model": "Lisa", "model_id": "158-01", "name": "Kinderkamer", - "preset_modes": [ - "home", - "asleep", - "away", - "vacation", - "no_frost" - ], "sensors": { "battery": 79, "setpoint": 13.0, @@ -140,18 +180,12 @@ "setpoint": 0.0, "upper_bound": 2.0 }, - "thermostat": { - "lower_bound": 0.0, - "resolution": 0.01, - "setpoint": 13.0, - "upper_bound": 99.9 - }, "vendor": "Plugwise", "zigbee_mac_address": "ABCD012345670A02" }, "833de10f269c4deab58fb9df69901b4e": { "available": true, - "dev_class": "thermo_sensor", + "dev_class": "thermostatic_radiator_valve", "firmware": "2020-11-04T01:00:00+01:00", "hardware": "1", "location": "13228dab8ce04617af318a2888b3c548", @@ -174,13 +208,10 @@ "zigbee_mac_address": "ABCD012345670A09" }, "a6abc6a129ee499c88a4d420cc413b47": { - "active_preset": "home", "available": true, "binary_sensors": { "low_battery": false }, - "climate_mode": "heat", - "control_state": "off", "dev_class": "zone_thermostat", "firmware": "2016-10-27T02:00:00+02:00", "hardware": "255", @@ -188,13 +219,6 @@ "model": "Lisa", "model_id": "158-01", "name": "Logeerkamer", - "preset_modes": [ - "home", - "asleep", - "away", - "vacation", - "no_frost" - ], "sensors": { "battery": 80, "setpoint": 13.0, @@ -206,12 +230,6 @@ "setpoint": 0.0, "upper_bound": 2.0 }, - "thermostat": { - "lower_bound": 0.0, - "resolution": 0.01, - "setpoint": 13.0, - "upper_bound": 99.9 - }, "vendor": "Plugwise", "zigbee_mac_address": "ABCD012345670A01" }, @@ -246,9 +264,42 @@ "vendor": "Plugwise", "zigbee_mac_address": "ABCD012345670101" }, + "d27aede973b54be484f6842d1b2802ad": { + "active_preset": "home", + "climate_mode": "heat", + "control_state": "off", + "dev_class": "climate", + "model": "ThermoZone", + "name": "Kinderkamer", + "preset_modes": [ + "home", + "asleep", + "away", + "vacation", + "no_frost" + ], + "sensors": { + "temperature": 30.0 + }, + "thermostat": { + "lower_bound": 0.0, + "resolution": 0.01, + "setpoint": 13.0, + "upper_bound": 99.9 + }, + "thermostats": { + "primary": [ + "6f3e9d7084214c21b9dfa46f6eeb8700" + ], + "secondary": [ + "d4496250d0e942cfa7aea3476e9070d5" + ] + }, + "vendor": "Plugwise" + }, "d4496250d0e942cfa7aea3476e9070d5": { "available": true, - "dev_class": "thermo_sensor", + "dev_class": "thermostatic_radiator_valve", "firmware": "2020-11-04T01:00:00+01:00", "hardware": "1", "location": "d27aede973b54be484f6842d1b2802ad", @@ -270,6 +321,39 @@ "vendor": "Plugwise", "zigbee_mac_address": "ABCD012345670A04" }, + "d58fec52899f4f1c92e4f8fad6d8c48c": { + "active_preset": "home", + "climate_mode": "heat", + "control_state": "off", + "dev_class": "climate", + "model": "ThermoZone", + "name": "Logeerkamer", + "preset_modes": [ + "home", + "asleep", + "away", + "vacation", + "no_frost" + ], + "sensors": { + "temperature": 30.0 + }, + "thermostat": { + "lower_bound": 0.0, + "resolution": 0.01, + "setpoint": 13.0, + "upper_bound": 99.9 + }, + "thermostats": { + "primary": [ + "a6abc6a129ee499c88a4d420cc413b47" + ], + "secondary": [ + "1da4d325838e4ad8aac12177214505c9" + ] + }, + "vendor": "Plugwise" + }, "e4684553153b44afbef2200885f379dc": { "available": true, "binary_sensors": { @@ -307,13 +391,10 @@ "vendor": "Remeha B.V." }, "f61f1a2535f54f52ad006a3d18e459ca": { - "active_preset": "home", "available": true, "binary_sensors": { "low_battery": false }, - "climate_mode": "heat", - "control_state": "off", "dev_class": "zone_thermometer", "firmware": "2020-09-01T02:00:00+02:00", "hardware": "1", @@ -321,13 +402,6 @@ "model": "Jip", "model_id": "168-01", "name": "Woonkamer", - "preset_modes": [ - "home", - "asleep", - "away", - "vacation", - "no_frost" - ], "sensors": { "battery": 100, "humidity": 56.2, @@ -340,12 +414,6 @@ "setpoint": 0.0, "upper_bound": 2.0 }, - "thermostat": { - "lower_bound": 4.0, - "resolution": 0.01, - "setpoint": 9.0, - "upper_bound": 30.0 - }, "vendor": "Plugwise", "zigbee_mac_address": "ABCD012345670A08" } @@ -354,7 +422,7 @@ "cooling_present": false, "gateway_id": "b5c2386c6f6342669e50fe49dd05b188", "heater_id": "e4684553153b44afbef2200885f379dc", - "item_count": 228, + "item_count": 244, "notifications": {}, "reboot": true, "smile_name": "Adam" diff --git a/tests/components/plugwise/fixtures/m_adam_multiple_devices_per_zone/all_data.json b/tests/components/plugwise/fixtures/m_adam_multiple_devices_per_zone/all_data.json index 290935ac4..522c3620e 100644 --- a/tests/components/plugwise/fixtures/m_adam_multiple_devices_per_zone/all_data.json +++ b/tests/components/plugwise/fixtures/m_adam_multiple_devices_per_zone/all_data.json @@ -21,6 +21,89 @@ "vendor": "Plugwise", "zigbee_mac_address": "ABCD012345670A15" }, + "08963fec7c53423ca5680aa4cb502c63": { + "active_preset": "away", + "available_schedules": [ + "CV Roan", + "Bios Schema met Film Avond", + "GF7 Woonkamer", + "Badkamer Schema", + "CV Jessie", + "off" + ], + "climate_mode": "auto", + "dev_class": "climate", + "model": "ThermoZone", + "name": "Badkamer", + "preset_modes": [ + "home", + "asleep", + "away", + "vacation", + "no_frost" + ], + "select_schedule": "Badkamer Schema", + "sensors": { + "temperature": 18.9 + }, + "thermostat": { + "lower_bound": 0.0, + "resolution": 0.01, + "setpoint": 14.0, + "upper_bound": 100.0 + }, + "thermostats": { + "primary": [ + "f1fee6043d3642a9b0a65297455f008e", + "680423ff840043738f42cc7f1ff97a36" + ], + "secondary": [] + }, + "vendor": "Plugwise" + }, + "12493538af164a409c6a1c79e38afe1c": { + "active_preset": "away", + "available_schedules": [ + "CV Roan", + "Bios Schema met Film Avond", + "GF7 Woonkamer", + "Badkamer Schema", + "CV Jessie", + "off" + ], + "climate_mode": "heat", + "dev_class": "climate", + "model": "ThermoZone", + "name": "Bios", + "preset_modes": [ + "home", + "asleep", + "away", + "vacation", + "no_frost" + ], + "select_schedule": "off", + "sensors": { + "electricity_consumed": 0.0, + "electricity_produced": 0.0, + "temperature": 16.5 + }, + "thermostat": { + "lower_bound": 0.0, + "resolution": 0.01, + "setpoint": 13.0, + "upper_bound": 100.0 + }, + "thermostats": { + "primary": [ + "df4a4a8169904cdb9c03d61a21f42140" + ], + "secondary": [ + "a2c3583e0a6349358998b760cea82d2a" + ] + }, + "vendor": "Plugwise" + }, "21f2b542c49845e6bb416884c55778d6": { "available": true, "dev_class": "game_console_plug", @@ -42,6 +125,36 @@ "vendor": "Plugwise", "zigbee_mac_address": "ABCD012345670A12" }, + "446ac08dd04d4eff8ac57489757b7314": { + "active_preset": "no_frost", + "climate_mode": "heat", + "dev_class": "climate", + "model": "ThermoZone", + "name": "Garage", + "preset_modes": [ + "home", + "asleep", + "away", + "vacation", + "no_frost" + ], + "sensors": { + "temperature": 15.6 + }, + "thermostat": { + "lower_bound": 0.0, + "resolution": 0.01, + "setpoint": 5.5, + "upper_bound": 100.0 + }, + "thermostats": { + "primary": [ + "e7693eb9582644e5b865dba8d4447cf1" + ], + "secondary": [] + }, + "vendor": "Plugwise" + }, "4a810418d5394b3f82727340b91ba740": { "available": true, "dev_class": "router_plug", @@ -89,13 +202,13 @@ "binary_sensors": { "low_battery": false }, - "dev_class": "thermo_sensor", + "dev_class": "thermostatic_radiator_valve", "firmware": "2019-03-27T01:00:00+01:00", "hardware": "1", "location": "08963fec7c53423ca5680aa4cb502c63", "model": "Tom/Floor", "model_id": "106-03", - "name": "Thermostatic Radiator Badkamer", + "name": "Thermostatic Radiator Badkamer 1", "sensors": { "battery": 51, "setpoint": 14.0, @@ -113,20 +226,10 @@ "zigbee_mac_address": "ABCD012345670A17" }, "6a3bf693d05e48e0b460c815a4fdd09d": { - "active_preset": "asleep", "available": true, - "available_schedules": [ - "CV Roan", - "Bios Schema met Film Avond", - "GF7 Woonkamer", - "Badkamer Schema", - "CV Jessie", - "off" - ], "binary_sensors": { "low_battery": false }, - "climate_mode": "auto", "dev_class": "zone_thermostat", "firmware": "2016-10-27T02:00:00+02:00", "hardware": "255", @@ -134,14 +237,6 @@ "model": "Lisa", "model_id": "158-01", "name": "Zone Thermostat Jessie", - "preset_modes": [ - "home", - "asleep", - "away", - "vacation", - "no_frost" - ], - "select_schedule": "CV Jessie", "sensors": { "battery": 37, "setpoint": 15.0, @@ -153,12 +248,6 @@ "setpoint": 0.0, "upper_bound": 2.0 }, - "thermostat": { - "lower_bound": 0.0, - "resolution": 0.01, - "setpoint": 15.0, - "upper_bound": 99.9 - }, "vendor": "Plugwise", "zigbee_mac_address": "ABCD012345670A03" }, @@ -182,6 +271,47 @@ "vendor": "Plugwise", "zigbee_mac_address": "ABCD012345670A05" }, + "82fa13f017d240daa0d0ea1775420f24": { + "active_preset": "asleep", + "available_schedules": [ + "CV Roan", + "Bios Schema met Film Avond", + "GF7 Woonkamer", + "Badkamer Schema", + "CV Jessie", + "off" + ], + "climate_mode": "auto", + "dev_class": "climate", + "model": "ThermoZone", + "name": "Jessie", + "preset_modes": [ + "home", + "asleep", + "away", + "vacation", + "no_frost" + ], + "select_schedule": "CV Jessie", + "sensors": { + "temperature": 17.2 + }, + "thermostat": { + "lower_bound": 0.0, + "resolution": 0.01, + "setpoint": 15.0, + "upper_bound": 100.0 + }, + "thermostats": { + "primary": [ + "6a3bf693d05e48e0b460c815a4fdd09d" + ], + "secondary": [ + "d3da73bde12a47d5a6b8f9dad971f2ec" + ] + }, + "vendor": "Plugwise" + }, "90986d591dcd426cae3ec3e8111ff730": { "binary_sensors": { "heating_state": true @@ -222,7 +352,7 @@ "binary_sensors": { "low_battery": false }, - "dev_class": "thermo_sensor", + "dev_class": "thermostatic_radiator_valve", "firmware": "2019-03-27T01:00:00+01:00", "hardware": "1", "location": "12493538af164a409c6a1c79e38afe1c", @@ -247,7 +377,7 @@ }, "b310b72a0e354bfab43089919b9a88bf": { "available": true, - "dev_class": "thermo_sensor", + "dev_class": "thermostatic_radiator_valve", "firmware": "2019-03-27T01:00:00+01:00", "hardware": "1", "location": "c50f167537524366a5af7aa3942feb1e", @@ -270,20 +400,10 @@ "zigbee_mac_address": "ABCD012345670A02" }, "b59bcebaf94b499ea7d46e4a66fb62d8": { - "active_preset": "home", "available": true, - "available_schedules": [ - "CV Roan", - "Bios Schema met Film Avond", - "GF7 Woonkamer", - "Badkamer Schema", - "CV Jessie", - "off" - ], "binary_sensors": { "low_battery": false }, - "climate_mode": "auto", "dev_class": "zone_thermostat", "firmware": "2016-08-02T02:00:00+02:00", "hardware": "255", @@ -291,14 +411,6 @@ "model": "Lisa", "model_id": "158-01", "name": "Zone Lisa WK", - "preset_modes": [ - "home", - "asleep", - "away", - "vacation", - "no_frost" - ], - "select_schedule": "GF7 Woonkamer", "sensors": { "battery": 34, "setpoint": 21.5, @@ -310,14 +422,51 @@ "setpoint": 0.0, "upper_bound": 2.0 }, + "vendor": "Plugwise", + "zigbee_mac_address": "ABCD012345670A07" + }, + "c50f167537524366a5af7aa3942feb1e": { + "active_preset": "home", + "available_schedules": [ + "CV Roan", + "Bios Schema met Film Avond", + "GF7 Woonkamer", + "Badkamer Schema", + "CV Jessie", + "off" + ], + "climate_mode": "auto", + "dev_class": "climate", + "model": "ThermoZone", + "name": "Woonkamer", + "preset_modes": [ + "home", + "asleep", + "away", + "vacation", + "no_frost" + ], + "select_schedule": "GF7 Woonkamer", + "sensors": { + "electricity_consumed": 35.6, + "electricity_produced": 0.0, + "temperature": 20.9 + }, "thermostat": { "lower_bound": 0.0, "resolution": 0.01, "setpoint": 21.5, - "upper_bound": 99.9 + "upper_bound": 100.0 }, - "vendor": "Plugwise", - "zigbee_mac_address": "ABCD012345670A07" + "thermostats": { + "primary": [ + "b59bcebaf94b499ea7d46e4a66fb62d8" + ], + "secondary": [ + "b310b72a0e354bfab43089919b9a88bf" + ] + }, + "vendor": "Plugwise" }, "cd0ddb54ef694e11ac18ed1cbce5dbbd": { "available": true, @@ -345,7 +494,7 @@ "binary_sensors": { "low_battery": false }, - "dev_class": "thermo_sensor", + "dev_class": "thermostatic_radiator_valve", "firmware": "2019-03-27T01:00:00+01:00", "hardware": "1", "location": "82fa13f017d240daa0d0ea1775420f24", @@ -369,20 +518,10 @@ "zigbee_mac_address": "ABCD012345670A10" }, "df4a4a8169904cdb9c03d61a21f42140": { - "active_preset": "away", "available": true, - "available_schedules": [ - "CV Roan", - "Bios Schema met Film Avond", - "GF7 Woonkamer", - "Badkamer Schema", - "CV Jessie", - "off" - ], "binary_sensors": { "low_battery": false }, - "climate_mode": "heat", "dev_class": "zone_thermostat", "firmware": "2016-10-27T02:00:00+02:00", "hardware": "255", @@ -390,14 +529,6 @@ "model": "Lisa", "model_id": "158-01", "name": "Zone Lisa Bios", - "preset_modes": [ - "home", - "asleep", - "away", - "vacation", - "no_frost" - ], - "select_schedule": "off", "sensors": { "battery": 67, "setpoint": 13.0, @@ -409,22 +540,14 @@ "setpoint": 0.0, "upper_bound": 2.0 }, - "thermostat": { - "lower_bound": 0.0, - "resolution": 0.01, - "setpoint": 13.0, - "upper_bound": 99.9 - }, "vendor": "Plugwise", "zigbee_mac_address": "ABCD012345670A06" }, "e7693eb9582644e5b865dba8d4447cf1": { - "active_preset": "no_frost", "available": true, "binary_sensors": { "low_battery": false }, - "climate_mode": "heat", "dev_class": "thermostatic_radiator_valve", "firmware": "2019-03-27T01:00:00+01:00", "hardware": "1", @@ -432,13 +555,6 @@ "model": "Tom/Floor", "model_id": "106-03", "name": "CV Kraan Garage", - "preset_modes": [ - "home", - "asleep", - "away", - "vacation", - "no_frost" - ], "sensors": { "battery": 68, "setpoint": 5.5, @@ -452,45 +568,21 @@ "setpoint": 0.0, "upper_bound": 2.0 }, - "thermostat": { - "lower_bound": 0.0, - "resolution": 0.01, - "setpoint": 5.5, - "upper_bound": 100.0 - }, "vendor": "Plugwise", "zigbee_mac_address": "ABCD012345670A11" }, "f1fee6043d3642a9b0a65297455f008e": { - "active_preset": "away", "available": true, - "available_schedules": [ - "CV Roan", - "Bios Schema met Film Avond", - "GF7 Woonkamer", - "Badkamer Schema", - "CV Jessie", - "off" - ], "binary_sensors": { "low_battery": false }, - "climate_mode": "auto", - "dev_class": "zone_thermostat", + "dev_class": "thermostatic_radiator_valve", "firmware": "2016-10-27T02:00:00+02:00", "hardware": "255", "location": "08963fec7c53423ca5680aa4cb502c63", "model": "Lisa", "model_id": "158-01", - "name": "Zone Thermostat Badkamer", - "preset_modes": [ - "home", - "asleep", - "away", - "vacation", - "no_frost" - ], - "select_schedule": "Badkamer Schema", + "name": "Thermostatic Radiator Badkamer 2", "sensors": { "battery": 92, "setpoint": 14.0, @@ -502,12 +594,6 @@ "setpoint": 0.0, "upper_bound": 2.0 }, - "thermostat": { - "lower_bound": 0.0, - "resolution": 0.01, - "setpoint": 14.0, - "upper_bound": 99.9 - }, "vendor": "Plugwise", "zigbee_mac_address": "ABCD012345670A08" }, @@ -535,7 +621,7 @@ "cooling_present": false, "gateway_id": "fe799307f1624099878210aa0b9f1475", "heater_id": "90986d591dcd426cae3ec3e8111ff730", - "item_count": 340, + "item_count": 364, "notifications": { "af82e4ccf9c548528166d38e560662a4": { "warning": "Node Plug (with MAC address 000D6F000D13CB01, in room 'n.a.') has been unreachable since 23:03 2020-01-18. Please check the connection and restart the device." diff --git a/tests/components/plugwise/fixtures/smile_p1_v2/all_data.json b/tests/components/plugwise/fixtures/smile_p1_v2/all_data.json new file mode 100644 index 000000000..5d970d401 --- /dev/null +++ b/tests/components/plugwise/fixtures/smile_p1_v2/all_data.json @@ -0,0 +1,41 @@ +{ + "devices": { + "938696c4bcdb4b8a9a595cb38ed43913": { + "dev_class": "smartmeter", + "location": "938696c4bcdb4b8a9a595cb38ed43913", + "model": "Ene5\\T210-DESMR5.0", + "name": "P1", + "sensors": { + "electricity_consumed_off_peak_cumulative": 1642.74, + "electricity_consumed_off_peak_interval": 0, + "electricity_consumed_peak_cumulative": 1155.195, + "electricity_consumed_peak_interval": 250, + "electricity_consumed_point": 458, + "electricity_produced_off_peak_cumulative": 482.598, + "electricity_produced_off_peak_interval": 0, + "electricity_produced_peak_cumulative": 1296.136, + "electricity_produced_peak_interval": 0, + "electricity_produced_point": 0, + "gas_consumed_cumulative": 584.433, + "gas_consumed_interval": 0.016, + "net_electricity_cumulative": 1019.201, + "net_electricity_point": 458 + }, + "vendor": "Ene5\\T210-DESMR5.0" + }, + "aaaa0000aaaa0000aaaa0000aaaa00aa": { + "dev_class": "gateway", + "firmware": "2.5.9", + "location": "938696c4bcdb4b8a9a595cb38ed43913", + "mac_address": "012345670001", + "model": "Gateway", + "name": "Smile P1", + "vendor": "Plugwise" + } + }, + "gateway": { + "gateway_id": "aaaa0000aaaa0000aaaa0000aaaa00aa", + "item_count": 26, + "smile_name": "Smile P1" + } +} diff --git a/tests/components/plugwise/fixtures/stretch_v31/all_data.json b/tests/components/plugwise/fixtures/stretch_v31/all_data.json index a875324fc..b1675116b 100644 --- a/tests/components/plugwise/fixtures/stretch_v31/all_data.json +++ b/tests/components/plugwise/fixtures/stretch_v31/all_data.json @@ -96,7 +96,8 @@ "name": "Schakel", "switches": { "relay": true - } + }, + "vendor": "Plugwise" }, "d950b314e9d8499f968e6db8d82ef78c": { "dev_class": "report", @@ -111,7 +112,8 @@ "name": "Stroomvreters", "switches": { "relay": true - } + }, + "vendor": "Plugwise" }, "e1c884e7dede431dadee09506ec4f859": { "dev_class": "refrigerator", diff --git a/tests/components/plugwise/snapshots/test_diagnostics.ambr b/tests/components/plugwise/snapshots/test_diagnostics.ambr index 2a8223a25..bf7d4260a 100644 --- a/tests/components/plugwise/snapshots/test_diagnostics.ambr +++ b/tests/components/plugwise/snapshots/test_diagnostics.ambr @@ -23,6 +23,90 @@ 'vendor': 'Plugwise', 'zigbee_mac_address': 'ABCD012345670A15', }), + '08963fec7c53423ca5680aa4cb502c63': dict({ + 'active_preset': 'away', + 'available_schedules': list([ + 'CV Roan', + 'Bios Schema met Film Avond', + 'GF7 Woonkamer', + 'Badkamer Schema', + 'CV Jessie', + 'off', + ]), + 'climate_mode': 'auto', + 'dev_class': 'climate', + 'model': 'ThermoZone', + 'name': 'Badkamer', + 'preset_modes': list([ + 'home', + 'asleep', + 'away', + 'vacation', + 'no_frost', + ]), + 'select_schedule': 'Badkamer Schema', + 'sensors': dict({ + 'temperature': 18.9, + }), + 'thermostat': dict({ + 'lower_bound': 0.0, + 'resolution': 0.01, + 'setpoint': 14.0, + 'upper_bound': 100.0, + }), + 'thermostats': dict({ + 'primary': list([ + 'f1fee6043d3642a9b0a65297455f008e', + '680423ff840043738f42cc7f1ff97a36', + ]), + 'secondary': list([ + ]), + }), + 'vendor': 'Plugwise', + }), + '12493538af164a409c6a1c79e38afe1c': dict({ + 'active_preset': 'away', + 'available_schedules': list([ + 'CV Roan', + 'Bios Schema met Film Avond', + 'GF7 Woonkamer', + 'Badkamer Schema', + 'CV Jessie', + 'off', + ]), + 'climate_mode': 'heat', + 'dev_class': 'climate', + 'model': 'ThermoZone', + 'name': 'Bios', + 'preset_modes': list([ + 'home', + 'asleep', + 'away', + 'vacation', + 'no_frost', + ]), + 'select_schedule': 'off', + 'sensors': dict({ + 'electricity_consumed': 0.0, + 'electricity_produced': 0.0, + 'temperature': 16.5, + }), + 'thermostat': dict({ + 'lower_bound': 0.0, + 'resolution': 0.01, + 'setpoint': 13.0, + 'upper_bound': 100.0, + }), + 'thermostats': dict({ + 'primary': list([ + 'df4a4a8169904cdb9c03d61a21f42140', + ]), + 'secondary': list([ + 'a2c3583e0a6349358998b760cea82d2a', + ]), + }), + 'vendor': 'Plugwise', + }), '21f2b542c49845e6bb416884c55778d6': dict({ 'available': True, 'dev_class': 'game_console_plug', @@ -44,6 +128,37 @@ 'vendor': 'Plugwise', 'zigbee_mac_address': 'ABCD012345670A12', }), + '446ac08dd04d4eff8ac57489757b7314': dict({ + 'active_preset': 'no_frost', + 'climate_mode': 'heat', + 'dev_class': 'climate', + 'model': 'ThermoZone', + 'name': 'Garage', + 'preset_modes': list([ + 'home', + 'asleep', + 'away', + 'vacation', + 'no_frost', + ]), + 'sensors': dict({ + 'temperature': 15.6, + }), + 'thermostat': dict({ + 'lower_bound': 0.0, + 'resolution': 0.01, + 'setpoint': 5.5, + 'upper_bound': 100.0, + }), + 'thermostats': dict({ + 'primary': list([ + 'e7693eb9582644e5b865dba8d4447cf1', + ]), + 'secondary': list([ + ]), + }), + 'vendor': 'Plugwise', + }), '4a810418d5394b3f82727340b91ba740': dict({ 'available': True, 'dev_class': 'router_plug', @@ -91,13 +206,13 @@ 'binary_sensors': dict({ 'low_battery': False, }), - 'dev_class': 'thermo_sensor', + 'dev_class': 'thermostatic_radiator_valve', 'firmware': '2019-03-27T01:00:00+01:00', 'hardware': '1', 'location': '08963fec7c53423ca5680aa4cb502c63', 'model': 'Tom/Floor', 'model_id': '106-03', - 'name': 'Thermostatic Radiator Badkamer', + 'name': 'Thermostatic Radiator Badkamer 1', 'sensors': dict({ 'battery': 51, 'setpoint': 14.0, @@ -115,20 +230,10 @@ 'zigbee_mac_address': 'ABCD012345670A17', }), '6a3bf693d05e48e0b460c815a4fdd09d': dict({ - 'active_preset': 'asleep', 'available': True, - 'available_schedules': list([ - 'CV Roan', - 'Bios Schema met Film Avond', - 'GF7 Woonkamer', - 'Badkamer Schema', - 'CV Jessie', - 'off', - ]), 'binary_sensors': dict({ 'low_battery': False, }), - 'climate_mode': 'auto', 'dev_class': 'zone_thermostat', 'firmware': '2016-10-27T02:00:00+02:00', 'hardware': '255', @@ -136,14 +241,6 @@ 'model': 'Lisa', 'model_id': '158-01', 'name': 'Zone Thermostat Jessie', - 'preset_modes': list([ - 'home', - 'asleep', - 'away', - 'vacation', - 'no_frost', - ]), - 'select_schedule': 'CV Jessie', 'sensors': dict({ 'battery': 37, 'setpoint': 15.0, @@ -155,12 +252,6 @@ 'setpoint': 0.0, 'upper_bound': 2.0, }), - 'thermostat': dict({ - 'lower_bound': 0.0, - 'resolution': 0.01, - 'setpoint': 15.0, - 'upper_bound': 99.9, - }), 'vendor': 'Plugwise', 'zigbee_mac_address': 'ABCD012345670A03', }), @@ -184,6 +275,47 @@ 'vendor': 'Plugwise', 'zigbee_mac_address': 'ABCD012345670A05', }), + '82fa13f017d240daa0d0ea1775420f24': dict({ + 'active_preset': 'asleep', + 'available_schedules': list([ + 'CV Roan', + 'Bios Schema met Film Avond', + 'GF7 Woonkamer', + 'Badkamer Schema', + 'CV Jessie', + 'off', + ]), + 'climate_mode': 'auto', + 'dev_class': 'climate', + 'model': 'ThermoZone', + 'name': 'Jessie', + 'preset_modes': list([ + 'home', + 'asleep', + 'away', + 'vacation', + 'no_frost', + ]), + 'select_schedule': 'CV Jessie', + 'sensors': dict({ + 'temperature': 17.2, + }), + 'thermostat': dict({ + 'lower_bound': 0.0, + 'resolution': 0.01, + 'setpoint': 15.0, + 'upper_bound': 100.0, + }), + 'thermostats': dict({ + 'primary': list([ + '6a3bf693d05e48e0b460c815a4fdd09d', + ]), + 'secondary': list([ + 'd3da73bde12a47d5a6b8f9dad971f2ec', + ]), + }), + 'vendor': 'Plugwise', + }), '90986d591dcd426cae3ec3e8111ff730': dict({ 'binary_sensors': dict({ 'heating_state': True, @@ -224,7 +356,7 @@ 'binary_sensors': dict({ 'low_battery': False, }), - 'dev_class': 'thermo_sensor', + 'dev_class': 'thermostatic_radiator_valve', 'firmware': '2019-03-27T01:00:00+01:00', 'hardware': '1', 'location': '12493538af164a409c6a1c79e38afe1c', @@ -249,7 +381,7 @@ }), 'b310b72a0e354bfab43089919b9a88bf': dict({ 'available': True, - 'dev_class': 'thermo_sensor', + 'dev_class': 'thermostatic_radiator_valve', 'firmware': '2019-03-27T01:00:00+01:00', 'hardware': '1', 'location': 'c50f167537524366a5af7aa3942feb1e', @@ -272,20 +404,10 @@ 'zigbee_mac_address': 'ABCD012345670A02', }), 'b59bcebaf94b499ea7d46e4a66fb62d8': dict({ - 'active_preset': 'home', 'available': True, - 'available_schedules': list([ - 'CV Roan', - 'Bios Schema met Film Avond', - 'GF7 Woonkamer', - 'Badkamer Schema', - 'CV Jessie', - 'off', - ]), 'binary_sensors': dict({ 'low_battery': False, }), - 'climate_mode': 'auto', 'dev_class': 'zone_thermostat', 'firmware': '2016-08-02T02:00:00+02:00', 'hardware': '255', @@ -293,14 +415,6 @@ 'model': 'Lisa', 'model_id': '158-01', 'name': 'Zone Lisa WK', - 'preset_modes': list([ - 'home', - 'asleep', - 'away', - 'vacation', - 'no_frost', - ]), - 'select_schedule': 'GF7 Woonkamer', 'sensors': dict({ 'battery': 34, 'setpoint': 21.5, @@ -312,14 +426,51 @@ 'setpoint': 0.0, 'upper_bound': 2.0, }), + 'vendor': 'Plugwise', + 'zigbee_mac_address': 'ABCD012345670A07', + }), + 'c50f167537524366a5af7aa3942feb1e': dict({ + 'active_preset': 'home', + 'available_schedules': list([ + 'CV Roan', + 'Bios Schema met Film Avond', + 'GF7 Woonkamer', + 'Badkamer Schema', + 'CV Jessie', + 'off', + ]), + 'climate_mode': 'auto', + 'dev_class': 'climate', + 'model': 'ThermoZone', + 'name': 'Woonkamer', + 'preset_modes': list([ + 'home', + 'asleep', + 'away', + 'vacation', + 'no_frost', + ]), + 'select_schedule': 'GF7 Woonkamer', + 'sensors': dict({ + 'electricity_consumed': 35.6, + 'electricity_produced': 0.0, + 'temperature': 20.9, + }), 'thermostat': dict({ 'lower_bound': 0.0, 'resolution': 0.01, 'setpoint': 21.5, - 'upper_bound': 99.9, + 'upper_bound': 100.0, + }), + 'thermostats': dict({ + 'primary': list([ + 'b59bcebaf94b499ea7d46e4a66fb62d8', + ]), + 'secondary': list([ + 'b310b72a0e354bfab43089919b9a88bf', + ]), }), 'vendor': 'Plugwise', - 'zigbee_mac_address': 'ABCD012345670A07', }), 'cd0ddb54ef694e11ac18ed1cbce5dbbd': dict({ 'available': True, @@ -347,7 +498,7 @@ 'binary_sensors': dict({ 'low_battery': False, }), - 'dev_class': 'thermo_sensor', + 'dev_class': 'thermostatic_radiator_valve', 'firmware': '2019-03-27T01:00:00+01:00', 'hardware': '1', 'location': '82fa13f017d240daa0d0ea1775420f24', @@ -371,20 +522,10 @@ 'zigbee_mac_address': 'ABCD012345670A10', }), 'df4a4a8169904cdb9c03d61a21f42140': dict({ - 'active_preset': 'away', 'available': True, - 'available_schedules': list([ - 'CV Roan', - 'Bios Schema met Film Avond', - 'GF7 Woonkamer', - 'Badkamer Schema', - 'CV Jessie', - 'off', - ]), 'binary_sensors': dict({ 'low_battery': False, }), - 'climate_mode': 'heat', 'dev_class': 'zone_thermostat', 'firmware': '2016-10-27T02:00:00+02:00', 'hardware': '255', @@ -392,14 +533,6 @@ 'model': 'Lisa', 'model_id': '158-01', 'name': 'Zone Lisa Bios', - 'preset_modes': list([ - 'home', - 'asleep', - 'away', - 'vacation', - 'no_frost', - ]), - 'select_schedule': 'off', 'sensors': dict({ 'battery': 67, 'setpoint': 13.0, @@ -411,22 +544,14 @@ 'setpoint': 0.0, 'upper_bound': 2.0, }), - 'thermostat': dict({ - 'lower_bound': 0.0, - 'resolution': 0.01, - 'setpoint': 13.0, - 'upper_bound': 99.9, - }), 'vendor': 'Plugwise', 'zigbee_mac_address': 'ABCD012345670A06', }), 'e7693eb9582644e5b865dba8d4447cf1': dict({ - 'active_preset': 'no_frost', 'available': True, 'binary_sensors': dict({ 'low_battery': False, }), - 'climate_mode': 'heat', 'dev_class': 'thermostatic_radiator_valve', 'firmware': '2019-03-27T01:00:00+01:00', 'hardware': '1', @@ -434,13 +559,6 @@ 'model': 'Tom/Floor', 'model_id': '106-03', 'name': 'CV Kraan Garage', - 'preset_modes': list([ - 'home', - 'asleep', - 'away', - 'vacation', - 'no_frost', - ]), 'sensors': dict({ 'battery': 68, 'setpoint': 5.5, @@ -454,45 +572,21 @@ 'setpoint': 0.0, 'upper_bound': 2.0, }), - 'thermostat': dict({ - 'lower_bound': 0.0, - 'resolution': 0.01, - 'setpoint': 5.5, - 'upper_bound': 100.0, - }), 'vendor': 'Plugwise', 'zigbee_mac_address': 'ABCD012345670A11', }), 'f1fee6043d3642a9b0a65297455f008e': dict({ - 'active_preset': 'away', 'available': True, - 'available_schedules': list([ - 'CV Roan', - 'Bios Schema met Film Avond', - 'GF7 Woonkamer', - 'Badkamer Schema', - 'CV Jessie', - 'off', - ]), 'binary_sensors': dict({ 'low_battery': False, }), - 'climate_mode': 'auto', - 'dev_class': 'zone_thermostat', + 'dev_class': 'thermostatic_radiator_valve', 'firmware': '2016-10-27T02:00:00+02:00', 'hardware': '255', 'location': '08963fec7c53423ca5680aa4cb502c63', 'model': 'Lisa', 'model_id': '158-01', - 'name': 'Zone Thermostat Badkamer', - 'preset_modes': list([ - 'home', - 'asleep', - 'away', - 'vacation', - 'no_frost', - ]), - 'select_schedule': 'Badkamer Schema', + 'name': 'Thermostatic Radiator Badkamer 2', 'sensors': dict({ 'battery': 92, 'setpoint': 14.0, @@ -504,12 +598,6 @@ 'setpoint': 0.0, 'upper_bound': 2.0, }), - 'thermostat': dict({ - 'lower_bound': 0.0, - 'resolution': 0.01, - 'setpoint': 14.0, - 'upper_bound': 99.9, - }), 'vendor': 'Plugwise', 'zigbee_mac_address': 'ABCD012345670A08', }), @@ -537,7 +625,7 @@ 'cooling_present': False, 'gateway_id': 'fe799307f1624099878210aa0b9f1475', 'heater_id': '90986d591dcd426cae3ec3e8111ff730', - 'item_count': 340, + 'item_count': 364, 'notifications': dict({ 'af82e4ccf9c548528166d38e560662a4': dict({ 'warning': "Node Plug (with MAC address 000D6F000D13CB01, in room 'n.a.') has been unreachable since 23:03 2020-01-18. Please check the connection and restart the device.", diff --git a/tests/components/plugwise/test_climate.py b/tests/components/plugwise/test_climate.py index 70e0fe3f6..03ee2e35f 100644 --- a/tests/components/plugwise/test_climate.py +++ b/tests/components/plugwise/test_climate.py @@ -31,7 +31,7 @@ async def test_adam_climate_entity_attributes( hass: HomeAssistant, mock_smile_adam: MagicMock, init_integration: MockConfigEntry ) -> None: """Test creation of adam climate device environment.""" - state = hass.states.get("climate.zone_lisa_wk") + state = hass.states.get("climate.woonkamer") assert state assert state.state == HVACMode.AUTO assert state.attributes["hvac_modes"] == [ @@ -54,7 +54,7 @@ async def test_adam_climate_entity_attributes( state.attributes["target_temp_step"], 0.1, rel_tol=1e-09, abs_tol=1e-09 ) - state = hass.states.get("climate.zone_thermostat_jessie") + state = hass.states.get("climate.jessie") assert state assert state.state == HVACMode.AUTO assert state.attributes["hvac_modes"] == [ @@ -82,7 +82,7 @@ async def test_adam_2_climate_entity_attributes( hass: HomeAssistant, mock_smile_adam_heat_cool: MagicMock, init_integration: MockConfigEntry ) -> None: """Test creation of adam climate device environment.""" - state = hass.states.get("climate.anna") + state = hass.states.get("climate.living_room") assert state assert state.state == HVACMode.HEAT assert state.attributes["hvac_action"] == "preheating" @@ -92,7 +92,7 @@ async def test_adam_2_climate_entity_attributes( HVACMode.HEAT, ] - state = hass.states.get("climate.lisa_badkamer") + state = hass.states.get("climate.bathroom") assert state assert state.state == HVACMode.AUTO assert state.attributes["hvac_action"] == "idle" @@ -111,7 +111,7 @@ async def test_adam_3_climate_entity_attributes( freezer: FrozenDateTimeFactory, ) -> None: """Test creation of adam climate device environment.""" - state = hass.states.get("climate.anna") + state = hass.states.get("climate.living_room") assert state assert state.state == HVACMode.COOL assert state.attributes["hvac_action"] == "cooling" @@ -125,7 +125,7 @@ async def test_adam_3_climate_entity_attributes( data.devices["da224107914542988a88561b4452b0f6"][ "select_regulation_mode" ] = "heating" - data.devices["ad4838d7d35c4d6ea796ee12ae5aedf8"]["control_state"] = "heating" + data.devices["f2bf9048bef64cc5b6d5110154e33c81"]["control_state"] = "heating" data.devices["056ee145a816487eaa69243c3280f8bf"]["binary_sensors"][ "cooling_state" ] = False @@ -137,7 +137,7 @@ async def test_adam_3_climate_entity_attributes( async_fire_time_changed(hass) await hass.async_block_till_done() - state = hass.states.get("climate.anna") + state = hass.states.get("climate.living_room") assert state assert state.state == HVACMode.HEAT assert state.attributes["hvac_action"] == "heating" @@ -151,7 +151,7 @@ async def test_adam_3_climate_entity_attributes( data.devices["da224107914542988a88561b4452b0f6"][ "select_regulation_mode" ] = "cooling" - data.devices["ad4838d7d35c4d6ea796ee12ae5aedf8"]["control_state"] = "cooling" + data.devices["f2bf9048bef64cc5b6d5110154e33c81"]["control_state"] = "cooling" data.devices["056ee145a816487eaa69243c3280f8bf"]["binary_sensors"][ "cooling_state" ] = True @@ -163,7 +163,7 @@ async def test_adam_3_climate_entity_attributes( async_fire_time_changed(hass) await hass.async_block_till_done() - state = hass.states.get("climate.anna") + state = hass.states.get("climate.living_room") assert state assert state.state == HVACMode.COOL assert state.attributes["hvac_action"] == "cooling" @@ -184,7 +184,7 @@ async def test_adam_climate_adjust_negative_testing( await hass.services.async_call( CLIMATE_DOMAIN, SERVICE_SET_TEMPERATURE, - {"entity_id": "climate.zone_lisa_wk", "temperature": 25}, + {"entity_id": "climate.woonkamer", "temperature": 25}, blocking=True, ) @@ -196,7 +196,7 @@ async def test_adam_climate_entity_climate_changes( await hass.services.async_call( CLIMATE_DOMAIN, SERVICE_SET_TEMPERATURE, - {"entity_id": "climate.zone_lisa_wk", "temperature": 25}, + {"entity_id": "climate.woonkamer", "temperature": 25}, blocking=True, ) assert mock_smile_adam.set_temperature.call_count == 1 @@ -208,7 +208,7 @@ async def test_adam_climate_entity_climate_changes( CLIMATE_DOMAIN, SERVICE_SET_TEMPERATURE, { - "entity_id": "climate.zone_lisa_wk", + "entity_id": "climate.woonkamer", "hvac_mode": "heat", "temperature": 25, }, @@ -223,14 +223,14 @@ async def test_adam_climate_entity_climate_changes( await hass.services.async_call( CLIMATE_DOMAIN, SERVICE_SET_TEMPERATURE, - {"entity_id": "climate.zone_lisa_wk", "temperature": 150}, + {"entity_id": "climate.woonkamer", "temperature": 150}, blocking=True, ) await hass.services.async_call( CLIMATE_DOMAIN, SERVICE_SET_PRESET_MODE, - {"entity_id": "climate.zone_lisa_wk", "preset_mode": "away"}, + {"entity_id": "climate.woonkamer", "preset_mode": "away"}, blocking=True, ) assert mock_smile_adam.set_preset.call_count == 1 @@ -241,7 +241,7 @@ async def test_adam_climate_entity_climate_changes( await hass.services.async_call( CLIMATE_DOMAIN, SERVICE_SET_HVAC_MODE, - {"entity_id": "climate.zone_lisa_wk", "hvac_mode": "heat"}, + {"entity_id": "climate.woonkamer", "hvac_mode": "heat"}, blocking=True, ) assert mock_smile_adam.set_schedule_state.call_count == 2 @@ -254,7 +254,7 @@ async def test_adam_climate_entity_climate_changes( CLIMATE_DOMAIN, SERVICE_SET_HVAC_MODE, { - "entity_id": "climate.zone_thermostat_jessie", + "entity_id": "climate.jessie", "hvac_mode": "dry", }, blocking=True, diff --git a/tests/components/plugwise/test_init.py b/tests/components/plugwise/test_init.py index 60c0cfc9d..aebf017a2 100644 --- a/tests/components/plugwise/test_init.py +++ b/tests/components/plugwise/test_init.py @@ -44,17 +44,18 @@ TOM = { "01234567890abcdefghijklmnopqrstu": { "available": True, - "dev_class": "thermo_sensor", + "dev_class": "thermostatic_radiator_valve", "firmware": "2020-11-04T01:00:00+01:00", "hardware": "1", "location": "f871b8c4d63549319221e294e4f88074", "model": "Tom/Floor", - "name": "Tom Zolder", + "name": "Tom Badkamer 2", "binary_sensors": { "low_battery": False, }, "sensors": { "battery": 99, + "setpoint": 18.0, "temperature": 18.6, "temperature_difference": 2.3, "valve_position": 0.0, @@ -291,15 +292,23 @@ async def test_update_device( assert ( len(er.async_entries_for_config_entry(entity_registry, mock_config_entry.entry_id)) - == 31 + == 38 ) assert ( len(dr.async_entries_for_config_entry(device_registry, mock_config_entry.entry_id)) - == 6 + == 8 ) # Add a 2nd Tom/Floor data.devices.update(TOM) + data.devices["f871b8c4d63549319221e294e4f88074"]["thermostats"].update( + { + "secondary": [ + "01234567890abcdefghijklmnopqrstu", + "1772a4ea304041adb83f357b751341ff", + ] + } + ) with patch(HA_PLUGWISE_SMILE_ASYNC_UPDATE, return_value=data): freezer.tick(timedelta(minutes=1)) async_fire_time_changed(hass) @@ -307,11 +316,11 @@ async def test_update_device( assert ( len(er.async_entries_for_config_entry(entity_registry, mock_config_entry.entry_id)) - == 37 + == 45 ) assert ( len(dr.async_entries_for_config_entry(device_registry, mock_config_entry.entry_id)) - == 7 + == 9 ) item_list: list[str] = [] for device_entry in list(device_registry.devices.values()): @@ -319,6 +328,13 @@ async def test_update_device( assert "01234567890abcdefghijklmnopqrstu" in item_list # Remove the existing Tom/Floor + data.devices["f871b8c4d63549319221e294e4f88074"]["thermostats"].update( + { + "secondary": [ + "01234567890abcdefghijklmnopqrstu" + ] + } + ) data.devices.pop("1772a4ea304041adb83f357b751341ff") with patch(HA_PLUGWISE_SMILE_ASYNC_UPDATE, return_value=data): freezer.tick(timedelta(minutes=1)) @@ -327,11 +343,11 @@ async def test_update_device( assert ( len(er.async_entries_for_config_entry(entity_registry, mock_config_entry.entry_id)) - == 31 + == 38 ) assert ( len(dr.async_entries_for_config_entry(device_registry, mock_config_entry.entry_id)) - == 6 + == 8 ) item_list: list[str] = [] for device_entry in list(device_registry.devices.values()): diff --git a/tests/components/plugwise/test_select.py b/tests/components/plugwise/test_select.py index 77698ad92..497ee9bcd 100644 --- a/tests/components/plugwise/test_select.py +++ b/tests/components/plugwise/test_select.py @@ -19,7 +19,7 @@ async def test_adam_select_entities( hass: HomeAssistant, mock_smile_adam: MagicMock, init_integration: MockConfigEntry ) -> None: """Test a thermostat select.""" - state = hass.states.get("select.zone_lisa_wk_thermostat_schedule") + state = hass.states.get("select.woonkamer_thermostat_schedule") assert state assert state.state == "GF7 Woonkamer" @@ -34,7 +34,7 @@ async def test_adam_change_select_entity( SELECT_DOMAIN, SERVICE_SELECT_OPTION, { - ATTR_ENTITY_ID: "select.zone_lisa_wk_thermostat_schedule", + ATTR_ENTITY_ID: "select.woonkamer_thermostat_schedule", ATTR_OPTION: "Badkamer Schema", }, blocking=True,