Skip to content
11 changes: 9 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,19 @@
# Changelog

## Versions from 0.4x
## v0.56.0 - 2025-09-03

### Ongoing
- Activate new Sense hysteresis based switch action via PR [326](https://github.com/plugwise/plugwise_usb-beta/pull/326)
- Link to plugwise_usb [v0.45.0](https://github.com/plugwise/python-plugwise-usb/releases/tag/v0.45.0)

### v0.55.12 - 2025-09-01

- Fix #312 via PR [324](https://github.com/plugwise/plugwise_usb-beta/pull/324)
- Link to plugwise_usb [v0.44.14](https://github.com/plugwise/python-plugwise-usb/releases/tag/v0.44.14)

### v0.55.11 - 2025-08-29

- Integrate HACS via PR [322](https://github.com/plugwise/plugwise_usb-beta/pull/322)

### v0.55.10 - 2025-08-29

- Final fix for unavailable buttons via plugwise_usb [v0.44.13](https://github.com/plugwise/python-plugwise-usb/releases/tag/v0.44.13)
Expand Down
21 changes: 21 additions & 0 deletions custom_components/plugwise_usb/binary_sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,27 @@ class PlugwiseBinarySensorEntityDescription(
entity_registry_enabled_default=False,
api_attribute="dirty",
),
PlugwiseBinarySensorEntityDescription(
key="sense_config_dirty",
translation_key="sense_config_dirty",
node_feature=NodeFeature.SENSE_HYSTERESIS,
device_class=BinarySensorDeviceClass.SAFETY,
entity_category=EntityCategory.DIAGNOSTIC,
entity_registry_enabled_default=False,
api_attribute="dirty",
),
PlugwiseBinarySensorEntityDescription(
key="humidity_hysteresis_state",
translation_key="humidity_hysteresis_state",
node_feature=NodeFeature.SENSE,
api_attribute="humidity_hysteresis_state",
),
PlugwiseBinarySensorEntityDescription(
key="temperature_hysteresis_state",
translation_key="temperature_hysteresis_state",
node_feature=NodeFeature.SENSE,
api_attribute="temperature_hysteresis_state",
),
)


Expand Down
4 changes: 2 additions & 2 deletions custom_components/plugwise_usb/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@
"iot_class": "local_polling",
"issue_tracker": "https://github.com/plugwise/python-plugwise-usb/issues",
"loggers": ["plugwise_usb"],
"requirements": ["plugwise-usb==0.44.14"],
"version": "0.55.12"
"requirements": ["plugwise-usb==0.45.0"],
"version": "0.56.0"
}
81 changes: 71 additions & 10 deletions custom_components/plugwise_usb/number.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,13 @@
NumberEntity,
NumberEntityDescription,
)
from homeassistant.const import EntityCategory, Platform, UnitOfTime
from homeassistant.const import (
PERCENTAGE,
EntityCategory,
Platform,
UnitOfTemperature,
UnitOfTime,
)
from homeassistant.core import HomeAssistant, callback
from homeassistant.helpers.entity_platform import AddEntitiesCallback

Expand All @@ -32,8 +38,8 @@ class PlugwiseNumberEntityDescription(
):
"""Describes Plugwise Number entity."""

api_attribute: str = ""
async_number_fn: str = ""
async_number_type: str = "int"


NUMBER_TYPES: tuple[PlugwiseNumberEntityDescription, ...] = (
Expand All @@ -47,7 +53,7 @@ class PlugwiseNumberEntityDescription(
native_unit_of_measurement=UnitOfTime.MINUTES,
native_max_value=255,
native_min_value=1,
api_attribute="reset_timer",
mode="box",
),
PlugwiseNumberEntityDescription(
key="maintenance_interval",
Expand All @@ -59,7 +65,6 @@ class PlugwiseNumberEntityDescription(
native_unit_of_measurement=UnitOfTime.MINUTES,
native_max_value=1440,
native_min_value=5,
api_attribute="maintenance_interval",
),
PlugwiseNumberEntityDescription(
key="sleep_duration",
Expand All @@ -71,7 +76,6 @@ class PlugwiseNumberEntityDescription(
entity_category=EntityCategory.CONFIG,
native_max_value=1440,
native_min_value=60,
api_attribute="sleep_duration",
),
PlugwiseNumberEntityDescription(
key="awake_duration",
Expand All @@ -83,7 +87,7 @@ class PlugwiseNumberEntityDescription(
entity_category=EntityCategory.CONFIG,
native_max_value=60,
native_min_value=1,
api_attribute="awake_duration",
mode="box",
),
PlugwiseNumberEntityDescription(
key="clock_interval",
Expand All @@ -95,7 +99,62 @@ class PlugwiseNumberEntityDescription(
native_unit_of_measurement=UnitOfTime.MINUTES,
native_max_value=65535,
native_min_value=1,
api_attribute="clock_interval",
),
PlugwiseNumberEntityDescription(
key="humidity_upper_bound",
translation_key="sense_humidity_upper_bound",
async_number_fn="set_hysteresis_humidity_upper_bound",
node_feature=NodeFeature.SENSE_HYSTERESIS,
entity_category=EntityCategory.CONFIG,
device_class=NumberDeviceClass.HUMIDITY,
native_unit_of_measurement=PERCENTAGE,
native_max_value=99,
native_min_value=1,
native_step=0.1,
async_number_type="float",
mode="box",
),
PlugwiseNumberEntityDescription(
key="humidity_lower_bound",
translation_key="sense_humidity_lower_bound",
async_number_fn="set_hysteresis_humidity_lower_bound",
node_feature=NodeFeature.SENSE_HYSTERESIS,
entity_category=EntityCategory.CONFIG,
device_class=NumberDeviceClass.HUMIDITY,
native_unit_of_measurement=PERCENTAGE,
native_max_value=99,
native_min_value=1,
native_step=0.1,
async_number_type="float",
mode="box",
),
PlugwiseNumberEntityDescription(
key="temperature_upper_bound",
translation_key="sense_temperature_upper_bound",
async_number_fn="set_hysteresis_temperature_upper_bound",
node_feature=NodeFeature.SENSE_HYSTERESIS,
entity_category=EntityCategory.CONFIG,
device_class=NumberDeviceClass.TEMPERATURE,
native_unit_of_measurement=UnitOfTemperature.CELSIUS,
native_max_value=60,
native_min_value=1,
native_step=0.1,
async_number_type="float",
mode="box",
),
PlugwiseNumberEntityDescription(
key="temperature_lower_bound",
translation_key="sense_temperature_lower_bound",
async_number_fn="set_hysteresis_temperature_lower_bound",
node_feature=NodeFeature.SENSE_HYSTERESIS,
entity_category=EntityCategory.CONFIG,
device_class=NumberDeviceClass.TEMPERATURE,
native_unit_of_measurement=UnitOfTemperature.CELSIUS,
native_max_value=60,
native_min_value=1,
native_step=0.1,
async_number_type="float",
mode="box",
),
)

Expand Down Expand Up @@ -178,12 +237,14 @@ def _handle_coordinator_update(self) -> None:
return
self._attr_native_value = getattr(
self.coordinator.data[self.entity_description.node_feature],
self.entity_description.api_attribute,
self.entity_description.key,
)
self.async_write_ha_state()

async def async_set_native_value(self, value: float) -> None:
"""Update the current value."""

await self.async_number_fn(int(value))
if self.entity_description.async_number_type == "float":
await self.async_number_fn(float(value))
else:
await self.async_number_fn(int(value))
self.async_write_ha_state()
33 changes: 33 additions & 0 deletions custom_components/plugwise_usb/strings.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,15 @@
},
"battery_config_dirty": {
"name": "Battery config changed"
},
"sense_config_dirty": {
"name": "Sense hysteresis config changed"
},
"humidity_hysteresis_state": {
"name": "Humidity Status"
},
"temperature_hysteresis_state": {
"name": "Temperature Status"
}
},
"select": {
Expand Down Expand Up @@ -122,6 +131,18 @@
},
"motion_daylight_mode": {
"name": "Daylight mode"
},
"sense_humidity_enabled": {
"name": "Enable humidity switching on hysteresis"
},
"sense_humidity_direction": {
"name": "Switch on increasing or decreasing humidity"
},
"sense_temperature_enabled": {
"name": "Enable temperature switching on hysteresis"
},
"sense_temperature_direction": {
"name": "Switch on increasing or decreasing temperature"
}
},
"number": {
Expand All @@ -139,6 +160,18 @@
},
"sed_clock_interval": {
"name": "Clock interval"
},
"sense_humidity_upper_bound": {
"name": "Humidity upper boundary value"
},
"sense_humidity_lower_bound": {
"name": "Humidity lower boundary value"
},
"sense_temperature_upper_bound": {
"name": "Temperature upper boundary value"
},
"sense_temperature_lower_bound": {
"name": "Temperature lower boundary value"
}
},
"button": {
Expand Down
32 changes: 32 additions & 0 deletions custom_components/plugwise_usb/switch.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,38 @@ class PlugwiseSwitchEntityDescription(
node_feature=NodeFeature.MOTION_CONFIG,
api_attribute="daylight_mode",
),
PlugwiseSwitchEntityDescription(
key="humidity_enabled",
translation_key="sense_humidity_enabled",
async_switch_fn="set_hysteresis_humidity_enabled",
entity_category=EntityCategory.CONFIG,
node_feature=NodeFeature.SENSE_HYSTERESIS,
api_attribute="humidity_enabled",
),
PlugwiseSwitchEntityDescription(
key="humidity_direction",
translation_key="sense_humidity_direction",
async_switch_fn="set_hysteresis_humidity_direction",
entity_category=EntityCategory.CONFIG,
node_feature=NodeFeature.SENSE_HYSTERESIS,
api_attribute="humidity_direction",
),
PlugwiseSwitchEntityDescription(
key="temperature_enabled",
translation_key="sense_temperature_enabled",
async_switch_fn="set_hysteresis_temperature_enabled",
entity_category=EntityCategory.CONFIG,
node_feature=NodeFeature.SENSE_HYSTERESIS,
api_attribute="temperature_enabled",
),
PlugwiseSwitchEntityDescription(
key="temperature_direction",
translation_key="sense_temperature_direction",
async_switch_fn="set_hysteresis_temperature_direction",
entity_category=EntityCategory.CONFIG,
node_feature=NodeFeature.SENSE_HYSTERESIS,
api_attribute="temperature_direction",
),
)


Expand Down
33 changes: 33 additions & 0 deletions custom_components/plugwise_usb/translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,15 @@
},
"battery_config_dirty": {
"name": "Battery config changed"
},
"sense_config_dirty": {
"name": "Sense hysteresis config changed"
},
"humidity_hysteresis_state": {
"name": "Humidity Status"
},
"temperature_hysteresis_state": {
"name": "Temperature Status"
}
},
"select": {
Expand Down Expand Up @@ -122,6 +131,18 @@
},
"motion_daylight_mode": {
"name": "Daylight mode"
},
"sense_humidity_enabled": {
"name": "Enable humidity switching on hysteresis"
},
"sense_humidity_direction": {
"name": "Switch on increasing or decreasing humidity"
},
"sense_temperature_enabled": {
"name": "Enable temperature switching on hysteresis"
},
"sense_temperature_direction": {
"name": "Switch on increasing or decreasing temperature"
}
},
"number": {
Expand All @@ -139,6 +160,18 @@
},
"sed_clock_interval": {
"name": "Clock interval"
},
"sense_humidity_upper_bound": {
"name": "Humidity upper boundary value"
},
"sense_humidity_lower_bound": {
"name": "Humidity lower boundary value"
},
"sense_temperature_upper_bound": {
"name": "Temperature upper boundary value"
},
"sense_temperature_lower_bound": {
"name": "Temperature lower boundary value"
}
},
"button": {
Expand Down
Loading
Loading