Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

## Versions from 0.4x

### v0.55.0 - 2025-06-22

- Implement an energy-reset button for energy devices that resets/restarts the energy-collection on the device overwriting the existing data
- Improve the energy collection reset process to reduce ZigBee traffic, network and server load via plugwise_usb [v0.44.4](https://github.com/plugwise/python-plugwise-usb/releases/tag/v0.44.4)

### v0.54.2

- Bump plugwise to [v0.44.3](https://github.com/plugwise/python-plugwise-usb/releases/tag/v0.44.3)
Expand Down
15 changes: 0 additions & 15 deletions custom_components/plugwise_usb/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
PLUGWISE_USB_PLATFORMS,
SERVICE_DISABLE_PRODUCTION,
SERVICE_ENABLE_PRODUCTION,
SERVICE_ENERGY_RESET,
SERVICE_USB_DEVICE_SCHEMA,
STICK,
)
Expand Down Expand Up @@ -111,17 +110,6 @@ async def async_node_discovered(node_event: NodeEvent, mac: str) -> None:
config_entry, PLUGWISE_USB_PLATFORMS
)

async def reset_energy_logs(call: ServiceCall) -> bool:
"""Reset energylog collection for a Node."""
mac = call.data[ATTR_MAC]
try:
result = await api_stick.energy_reset_request(mac)
except (NodeError, StickError) as exc:
raise HomeAssistantError(
f"Energy logs reset failed for {mac}: {exc}"
) from exc
return result

async def enable_production(call: ServiceCall) -> bool:
"""Enable production-logging for a Node."""
mac = call.data[ATTR_MAC]
Expand Down Expand Up @@ -150,9 +138,6 @@ async def disable_production(call: ServiceCall) -> bool:
hass.services.async_register(
DOMAIN, SERVICE_DISABLE_PRODUCTION, disable_production, SERVICE_USB_DEVICE_SCHEMA
)
hass.services.async_register(
DOMAIN, SERVICE_ENERGY_RESET, reset_energy_logs, SERVICE_USB_DEVICE_SCHEMA
)

# Initiate background nodes discovery task
config_entry.async_create_task(
Expand Down
7 changes: 7 additions & 0 deletions custom_components/plugwise_usb/button.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,13 @@ class PlugwiseButtonEntityDescription(
async_button_fn="enable_auto_join",
node_feature=NodeFeature.CIRCLEPLUS,
),
PlugwiseButtonEntityDescription(
key="energy_reset",
translation_key="energy_reset",
entity_category=EntityCategory.CONFIG,
async_button_fn="energy_reset_request",
node_feature=NodeFeature.CIRCLE,
),
)


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 @@ -8,6 +8,6 @@
"integration_type": "hub",
"iot_class": "local_polling",
"loggers": ["plugwise_usb"],
"requirements": ["plugwise-usb==0.44.3"],
"version": "0.54.2"
"requirements": ["plugwise-usb==0.44.4"],
"version": "0.55.0"
}
5 changes: 0 additions & 5 deletions custom_components/plugwise_usb/services.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,6 @@ disable_production:
fields:
mac:
example: "data: {mac: 0123456789ABCDEF}"
reset_energy_logs:
description: "Reset energylogs for a Plugwise USB node by MAC address"
fields:
mac:
example: "data: {mac: 0123456789ABCDEF}"
configure_scan:
fields:
entity_id:
Expand Down
13 changes: 3 additions & 10 deletions custom_components/plugwise_usb/strings.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,16 +43,6 @@
}
}
},
"reset_energy_logs":{
"name": "Reset energy logs for a Node",
"description": "Enter the mac of the Node: (data = mac: 0123456789ABCDEF)",
"fields": {
"mac": {
"name": "MAC address",
"description": "The full 16 character MAC address of the plugwise device."
}
}
},
"configure_scan": {
"name": "Configure motion settings",
"description": "Configure the motion settings for a Plugwise Scan device. The new configuration will be send soon as the Scan devices is awake to receive configuration changes. For quick activation press the local button to awake the device.",
Expand Down Expand Up @@ -190,6 +180,9 @@
"button": {
"enable_auto_join": {
"name": "Enable Auto-joining (temporarily)"
},
"energy_reset":{
"name": "Reset energy collection"
}
}
}
Expand Down
13 changes: 3 additions & 10 deletions custom_components/plugwise_usb/translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,16 +43,6 @@
}
}
},
"reset_energy_logs":{
"name": "Reset energy logs for a Node",
"description": "Enter the mac of the Node: (data = mac: 0123456789ABCDEF)",
"fields": {
"mac": {
"name": "MAC address",
"description": "The full 16 character MAC address of the plugwise device."
}
}
},
"configure_scan": {
"name": "Configure motion settings",
"description": "Configure the motion settings for a Plugwise Scan device. The new configuration will be send soon as the Scan devices is awake to receive configuration changes. For quick activation press the local button to awake the device.",
Expand Down Expand Up @@ -190,6 +180,9 @@
"button": {
"enable_auto_join": {
"name": "Enable Auto-joining (temporarily)"
},
"energy_reset":{
"name": "Reset energy collection"
}
}
}
Expand Down
13 changes: 3 additions & 10 deletions custom_components/plugwise_usb/translations/nl.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,16 +43,6 @@
}
}
},
"reset_energy_logs":{
"name": "Voer een energielog reset uit voor een Node",
"description": "Voer het mac-adres van de Node in: (data = mac: 0123456789ABSDEF)",
"fields": {
"mac": {
"name": "MAC adres",
"description": "Het volledige MAC address (16 karakters) van het plugwise apparaat."
}
}
},
"configure_scan": {
"name": "Configureer bewegingsinstellingen voor een Plugwise Scan apparaat",
"description": "Configureert bewegingsinstellingen voor een Plugwise Scan apparaat.",
Expand Down Expand Up @@ -190,6 +180,9 @@
"button": {
"enable_auto_join": {
"name": "Zet Plugwise auto-toevoegen aan (tijdelijk)"
},
"energy_reset":{
"name": "Energieverzameling resetten"
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion requirements_test.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ pytest-asyncio
pytest-homeassistant-custom-component
aiousbwatcher
# From our manifest.json for our custom component
plugwise-usb @ https://files.pythonhosted.org/packages/73/7f/d87b3090a7c52e82615a1bd1c7a539c57d9c96b1c8352e3eb79905f938ac/plugwise_usb-0.44.1.tar.gz
plugwise-usb @ https://files.pythonhosted.org/packages/5d/51/5e1a7f12954bdf0cbed1a460ec1700802e9d92015735c93a6e755f639c95/plugwise_usb-0.44.4.tar.gz