Giter Club home page Giter Club logo

plugwise_usb-beta's People

Contributors

bouwew avatar brefra avatar casparthebridge avatar compatech avatar dependabot[bot] avatar dirixmjm avatar mvdwetering avatar pre-commit-ci[bot] avatar renovate[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

plugwise_usb-beta's Issues

[BUG]: Switching is working for the first couple of ours, then stops.

Describe the bug.

In the lasttest version, de switching is working again, but stop after a couple of hours.

This is also noticeable on the measurements of the energy readings. See attached graph, the arrows: First one is the update/restart of HA and the second one is the moment the measurement is stopping regularly updating. At 5 AM I restarted HA again and the readings become normal again.

CleanShot 2023-08-07 at 18 58 01@2x

What version of Plugwise Beta are you using?

0.40.2

What was the last working version of Plugwise Beta (or Core if not using beta before)?

No response

What version of Home Assistant Core are you using?

2023.8.1

What type of installation are you running?

Home Assistant OS

How did you install plugwise-beta?

HACS

What kind of Plugwise device is having issues?

USB: Stick

What firmware version is your Plugwise product at?

latest

Logging

No response

Diagnostics information

No response

Additional information

No response

[FEATURE]: Add brand icon/logo

Describe the solution you are looking for

This integration shows no icon in the integrations overview and broken icons in the devices list
image
image

Would be nice to add an icon/logo for it.
Adding an icon/logo can be done with a PR at https://github.com/home-assistant/brands

Is your feature request related to a problem? (optional)

Not really, just visually not great.

What type of installation are you running?

Home Assistant OS

How did you install plugwise-beta?

HACS

What kind of Plugwise device is having issues?

USB: Stick

What firmware version is your Plugwise product at?

n.a.

Your setup

n.a.

Additional context

I thought about making a PR myself, but not sure which icon/logo to use.

[TODO]: Prepare beta for USB upstreaming

Todo

Original text from plugwise/plugwise-beta#361

Following https://plugwise.github.io/progress/diff.html

Adding # pw-beta tags where appropriate to ease up differences

PR is also meant as a step-up to see if we can carve out a way for the Core Team to decide on embedding USB into the Core Plugwise environment. E.g. making sure the 'mammoth' that is now https://plugwise.github.io/progress/diff.html can be used as an oversight and from that we can chunk PRs in a relative quick pace to ensure we embed USB within a month between releases. As such re-breathing live into Core PR 35713

Checklist as per Progress diff core/beta beginning of March 2023: (note that all COORDINATOR relations are under coordinator.py to not re-iterate across all domains)

  • USB plugwise/__init__.py replaces placeholders when upstreaming
  • Generic/USB plugwise/binary_sensor.py``dataclass structure needs conformance/decision between beta and core
  • Generic plugwise/climate.py though mainly 'options' which won't upstream
  • USB plugwise/config_flow.py foremost USB flow handling + some exceptions
  • Generic/USB plugwise/const.py const & dataclass
  • Generic plugwise/coordinator.py untouched, needs alignment between beta and core
  • Generic plugwise/diagnostics.py *) except coordinator
  • Generic plugwise/entity.py only isorted
  • Generic plugwise/gateway.py mostly beta-only related things
  • Generic plugwise/manifest.json no actions needed specifically
  • Generic plugwise/number.py needs alignment
  • Generic plugwise/select.py *) except coordinator
  • Generic/USB plugwise/sensor.py dataclass structure needs conformance/decision between beta and core
  • USB plugwise/strings.json
  • USB plugwise/switch.py
  • Generic plugwise/util.py

(not in plugwise/plugwise-beta#361) This also depends on python-plugwise issue 131 to have more proper testing involved, but we might leverage community effort there as well once we have upstream in place.

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Detected dependencies

github-actions
.github/workflows/hassfest.yaml
  • actions/checkout v4.1.6
.github/workflows/test.yml
  • actions/checkout v4.1.6
  • actions/setup-python v5
  • actions/cache v4
  • actions/checkout v4.1.6
pip_requirements
requirements_commit.txt
pre-commit
.pre-commit-config.yaml
  • astral-sh/ruff-pre-commit v0.4.8
  • pre-commit/pre-commit-hooks v4.6.0
  • asottile/pyupgrade v3.16.0
  • codespell-project/codespell v2.2.6
  • PyCQA/bandit 1.7.8
  • adrienverge/yamllint v1.35.1
  • pre-commit/mirrors-prettier v3.1.0
  • cdce8p/python-typing-update v0.6.0
  • igorshubovych/markdownlint-cli v0.41.0

  • Check this box to trigger a request for Renovate to run again on this repository

[ENHANCEMENT] Expose Circle marked as "Don't turn off" parameter

After migrating an existing Stick/Windows PC installation with 7 Circles, by moving the Stick to a HA on RaspberryPi, only the Circles without a marking "Don't turnoff" for manual switching show up with their entities in HA. The Plugs that were marked do not show up at all. HA en Plugwise-beta are at the latest version

[BUG] Only 25 plugs discovered and I have 34 plugs

I installed the latest version of plugwise-beta. I have a stick usb, circle+, and 35 plugs. In plugwise source, I see all the plugs. In Home assistant in the beginning, the program found 17 plugs, and then it progressed to 25 plugs. Now it's stuck on 25 for 2 days. Should I just wait or is 25 maybe the limit of the plugin. It's great that some people are willing to put some effort in devlopping programs. Can I do something else to help? I am new to all this.

[BUG]: 8 - 10 plug out of 25 detected in discovery phase

Describe the bug.

Only a portion of the plugs are detected. Looking at the logs it appears to be a timing and logic issue.

What appears to be happening is that on first discovery the plug do not al reply on time (probably that total timeout is too short).

A retry does not happen "to speed up discovery"

And then because the types are not yet known they are automatically assumed to be battery operated devices (which they are not).

The result later is that they are never picked up.

(the same network does work with OpenHab)

What version of Home Assistant Core has the issue?

2023.2.5

What was the last working version of Home Assistant Core?

none

What type of installation are you running?

Home Assistant Container

How did you install plugwise-beta?

HACS

What kind of Plugwise device is having issues?

USB: Stick

What firmware version is your Plugwise product at?

2011-05-13 09:17:07

Logging

No response

Diagnostics information

When trying to reproproduce It appears I even get a timing problem with added the circle+:

home-assistant_plugwise_2023-02-17T09-19-46.296Z.log

Additional information

I did a number of complete integration reinstalls:

First try: 10 Plugs
second try: 8 plugs
3 : no circle +
4 : no circle +
5 : no circle +

I am quite comfortable modifying python code and constant if you can give me a pointer on the dependencies.

[TODO]: Cleanup models.py

Todo

Follow-up from #1 merge, as per @bouwew comments


custom_components/plugwise_usb/models.py

  • L28-31 This part is no longer needed after the split.

Also below all plugwise_api=STICK, lines can be removed.


  • L35-36 Rewrite to class PlugwiseEntityDescription(EntityDescription):

Or remove this class and rename below classes to SensorEntityDescription, etc.

Maybe even better, move all descriptions (back) into the relevant files, as done in Core Plugwise

[BUG]: Download diagnostics is not working

Todo

Not really a todo, more like a bug, but there is no bug issue type.

When trying to use the "Download diagnostics" option from Home Assistant for the plugwise beta integration it just fails. I see this error below in the logs.

image

This error originated from a custom integration.

Logger: aiohttp.server
Source: custom_components/plugwise/diagnostics.py:18
Integration: Plugwise Beta (documentation)
First occurred: 18:34:18 (1 occurrences)
Last logged: 18:34:18

Error handling request
Traceback (most recent call last):
  File "/usr/local/lib/python3.10/site-packages/aiohttp/web_protocol.py", line 433, in _handle_request
    resp = await request_handler(request)
  File "/usr/local/lib/python3.10/site-packages/aiohttp/web_app.py", line 504, in _handle
    resp = await handler(request)
  File "/usr/local/lib/python3.10/site-packages/aiohttp/web_middlewares.py", line 117, in impl
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/security_filter.py", line 85, in security_filter_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/forwarded.py", line 227, in forwarded_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/request_context.py", line 28, in request_context_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/ban.py", line 80, in ban_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 235, in auth_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/view.py", line 146, in handle
    result = await result
  File "/usr/src/homeassistant/homeassistant/components/diagnostics/__init__.py", line 246, in get
    data = await info.config_entry_diagnostics(hass, config_entry)
  File "/config/custom_components/plugwise/diagnostics.py", line 18, in async_get_config_entry_diagnostics
    coordinator: PlugwiseDataUpdateCoordinator = hass.data[DOMAIN][entry.entry_id][
KeyError: 'coordinator'

[QUESTION]: Best way to migrate to USB beta?

Describe the solution you are looking for

I just tested installing the plugwise USB beta (after actually only disabling the plugwise beta) and it found all the circles ๐Ÿ‘ Is this the correct way?

Secondly, where are all the circle names, sensor names and area settings stored? Is there any way to copy this over instead of manually editing each circle in the HA web GUI from scratch?

Thanks!

Is your feature request related to a problem? (optional)

No response

What type of installation are you running?

Home Assistant OS

How did you install plugwise-beta?

HACS

What kind of Plugwise device is having issues?

USB: Stick

What firmware version is your Plugwise product at?

Latest

Your setup

......

Additional context

No response

[BUG]: Energy Consumption stats stop working

Describe the bug.

On all my Circles and Circle+ the Energy Consumption Today stats stop working. They worked the first time i set it up, and maybe after a HASS restart, but then they stop updating. The Power Usage sensors work perfectly fine.

What version of Home Assistant Core has the issue?

2012.22

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant Container

How did you install plugwise-beta?

HACS

What kind of Plugwise device is having issues?

USB: Stick

What firmware version is your Plugwise product at?

Not sure about stick but most circles are on 2011-06-27 10:52:18 and some on 2015-09-18 10:53:15

Logging

Here's the current logs without additional debugging enabled:

2022-12-19 04:45:48.684 WARNING (serial_reader_thread) [plugwise.controller] Drop NodePingRequest to 000D6F00004BE237 because max retries 3 reached
2022-12-19 04:46:08.703 WARNING (serial_reader_thread) [plugwise.controller] Drop NodePingRequest to 000D6F00004BE237 because max retries 3 reached
2022-12-19 04:46:28.719 WARNING (serial_reader_thread) [plugwise.controller] Drop NodePingRequest to 000D6F00004BE237 because max retries 3 reached
2022-12-19 04:46:48.734 WARNING (serial_reader_thread) [plugwise.controller] Drop NodePingRequest to 000D6F00004BE237 because max retries 3 reached
2022-12-19 04:47:08.756 WARNING (serial_reader_thread) [plugwise.controller] Drop NodePingRequest to 000D6F00004BE237 because max retries 3 reached
2022-12-19 04:47:28.766 WARNING (serial_reader_thread) [plugwise.controller] Drop NodePingRequest to 000D6F00004BE237 because max retries 3 reached
2022-12-19 04:47:48.782 WARNING (serial_reader_thread) [plugwise.controller] Drop NodePingRequest to 000D6F00004BE237 because max retries 3 reached
2022-12-19 04:48:08.810 WARNING (serial_reader_thread) [plugwise.controller] Drop NodePingRequest to 000D6F00004BE237 because max retries 3 reached
2022-12-19 04:48:28.817 WARNING (serial_reader_thread) [plugwise.controller] Drop NodePingRequest to 000D6F00004BE237 because max retries 3 reached
2022-12-19 04:48:48.837 WARNING (serial_reader_thread) [plugwise.controller] Drop NodePingRequest to 000D6F00004BE237 because max retries 3 reached
2022-12-19 04:49:08.851 WARNING (serial_reader_thread) [plugwise.controller] Drop NodePingRequest to 000D6F00004BE237 because max retries 3 reached
2022-12-19 04:49:28.864 WARNING (serial_reader_thread) [plugwise.controller] Drop NodePingRequest to 000D6F00004BE237 because max retries 3 reached
2022-12-19 08:06:16.389 WARNING (send_messages_thread) [plugwise.controller] Cannot resend unknown request b'3614'
2022-12-19 13:51:20.337 WARNING (SyncWorker_44) [homeassistant.loader] We found a custom integration plugwise which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2022-12-20 05:40:47.026 WARNING (send_messages_thread) [plugwise.controller] Cannot resend unknown request b'0011'
2022-12-20 05:40:58.544 WARNING (send_messages_thread) [plugwise.controller] Drop CirclePowerUsageRequest to 000D6F0000AF50EB because max retries 3 reached
2022-12-20 10:53:39.797 WARNING (serial_reader_thread) [plugwise.parser] Invalid message length received for NodeSwitchGroupResponse, expected 38 bytes got 22
2022-12-20 14:51:38.813 WARNING (serial_reader_thread) [plugwise.parser] Invalid message length received for NodeSwitchGroupResponse, expected 38 bytes got 22
2022-12-20 18:50:18.049 WARNING (serial_reader_thread) [plugwise.parser] Invalid message length received for NodeSwitchGroupResponse, expected 38 bytes got 22
2022-12-20 20:04:55.468 WARNING (serial_reader_thread) [plugwise.parser] Invalid message length received for NodeSwitchGroupResponse, expected 38 bytes got 22
2022-12-21 03:37:47.880 WARNING (send_messages_thread) [plugwise.controller] Cannot resend unknown request b'5A9A'
2022-12-21 07:25:42.336 WARNING (serial_reader_thread) [plugwise.parser] Invalid message length received for NodeSwitchGroupResponse, expected 38 bytes got 22
2022-12-21 07:49:45.883 WARNING (send_messages_thread) [plugwise.controller] Cannot resend unknown request b'0001'
2022-12-21 08:48:41.773 WARNING (serial_reader_thread) [plugwise.parser] Invalid message length received for NodeSwitchGroupResponse, expected 38 bytes got 22
2022-12-21 09:06:22.282 WARNING (serial_reader_thread) [plugwise.parser] Invalid message length received for NodeSwitchGroupResponse, expected 38 bytes got 22

This is only a snippet, there's many more lines lole like this.

Diagnostics information

Applies to all of them so not sure how useful

Additional information

I used Plugwise2Py before, which seems as if it kept track internally on the energy usage over time. But i do recall that back when I used the Windows software with these plugs, it worked fine. So doesn't seem like a hw issue.

[FEATURE]: Core compatibility

Describe the solution you are looking for

As discovered by both @CoMPaTech and @bouwew mypy throws a spanner in the works when upstreaming to Core. As such mypy should be part of our routine when updating/adding code to this repository.

Is your feature request related to a problem? (optional)

n/a

What type of installation are you running?

Home Assistant OS

How did you install plugwise-beta?

HACS

What kind of Plugwise device is having issues?

Smile: Adam (including Lisa, Tom, Floor)

What firmware version is your Plugwise product at?

core-dev

Your setup

n/a

Additional context

Todolist

  • Introduce script/run-in-env.sh mypy homeassistant/components/plugwise/*.py into core-testing - branch mypy plugwise/plugwise-beta#267
  • homeassistant/components/plugwise/coordinator.py:30: error: Argument "update_interval" to "__init__" of "DataUpdateCoordinator" has incompatible type "float"; expected "Optional[timedelta]" [arg-type] - branch mypy_coordinator plugwise/plugwise-beta#266
  • homeassistant/components/plugwise/config_flow.py:86: error: Incompatible return value type (got "Tuple[Dict[str, str], None]", expected "Dict[str, str]") [return-value]
  • homeassistant/components/plugwise/config_flow.py:101: error: Incompatible return value type (got "Tuple[Dict[str, str], Any]", expected "Dict[str, str]") [return-value]
  • homeassistant/components/plugwise/usb.py:202: error: "PlugwiseEntityDescription" has no attribute "should_poll" [attr-defined]
  • homeassistant/components/plugwise/gateway.py:89: error: Argument 3 to "PlugwiseDataUpdateCoordinator" has incompatible type "timedelta"; expected "float" [arg-type] plugwise/plugwise-beta#266
  • homeassistant/components/plugwise/entity.py:18: error: Type argument "PlugwiseData" of "CoordinatorEntity" must be a subtype of "DataUpdateCoordinator[Any]" [type-var]
  • homeassistant/components/plugwise/entity.py:21: error: Incompatible types in assignment (expression has type "PlugwiseDataUpdateCoordinator", base class "CoordinatorEntity" defined the type as "PlugwiseData") [assignment]
  • homeassistant/components/plugwise/entity.py:29: error: Argument 1 to "__init__" of "CoordinatorEntity" has incompatible type "PlugwiseDataUpdateCoordinator"; expected "PlugwiseData" [arg-type]
  • homeassistant/components/plugwise/sensor.py:111: error: Invalid index type "str" for "str"; expected type "Union[SupportsIndex, slice]" [index]
  • homeassistant/components/plugwise/sensor.py:159: error: "SensorEntityDescription" has no attribute "state_request_method" [attr-defined]
  • homeassistant/components/plugwise/select.py:105: error: "SelectEntityDescription" has no attribute "current_option" [attr-defined]
  • homeassistant/components/plugwise/select.py:110: error: "SelectEntityDescription" has no attribute "options" [attr-defined]
  • homeassistant/components/plugwise/select.py:115: error: "SelectEntityDescription" has no attribute "command" [attr-defined]
  • homeassistant/components/plugwise/number.py:96: error: Argument 1 to "async_send_api_call" of "PlugwiseEntity" has incompatible type "float"; expected "str" [arg-type]
  • homeassistant/components/plugwise/number.py:96: error: "NumberEntityDescription" has no attribute "command" [attr-defined]
  • homeassistant/components/plugwise/binary_sensor.py:208: error: "BinarySensorEntityDescription" has no attribute "state_request_method" [attr-defined]
  • homeassistant/components/plugwise/switch.py:152: error: "SwitchEntityDescription" has no attribute "state_request_method" [attr-defined]
  • homeassistant/components/plugwise/climate.py:112: error: Incompatible return value type (got "Optional[Any]", expected "str") [return-value]

[BUG]: Plugwise USB very unstable on HA 2024.2.4

Describe the bug.

Hi to all!

Last week my stretch got corrupted due to a sudden power-loss at the exact moment of a configuration store. There seems no option te revive the Stretch (factory reset doesn't solve the corrupt files and I am unable to find a Stretch firmware image anywhere to overwrite the corrupted xml file with a stock one). So I pulled the stick from the stretch and switched to Plugwise USB beta integration. It is running for 5 days now, but things are no where to being stable.

I run this environment on my Synology with VMM and these packages:

Core 2024.2.4
Supervisor 2024.02.0
Operating System 12.0
Frontend 20240207.1

What I encounter is that 4 circles where discovered within 1 hour. Then over the next days slowly 1 circle at the time is being added. I have ~15 active circles. The network was rock solid when in use with the stretch and no circles where moved during the migration. Also the USB stick is within 20cm of the location where it was inside the stretch.

After 5 days the integration found 12 circles, but the last took 2 days to be found. The main problem is that the circles randomly show Not available and seem to drop from the network. Even the circle within 30cm of the stick (RSSI -45dbm) and the circle within 30 cm of the Circle+ show this behaviour. Beside that is see huge memory spikes every couple of hours with also huge CPU load. Sometimes my HA installation freezes due to running out of memory. When enabling debug log I see thousands of lines of communication of the stick to the circles and seems completely overwhelming the network and sometimes HA as well.

Is there anything I can do to fix this? Can i provide logging to help debug this issue? Please note that my stick has connected to an other 20 circles in the past, but they are offline for years and function as a backup for the future when plugs are dying due to there age. The stretch did see those circles as offline, but never seemed to be impacted by the fact they where there but being offline.
The usb stick has a stable connection with HA and this is confirmed by the logging marking the stick always as 'ready'.

I am a kind of lost and losing the WAF due this issues :) Please advise on how to continue.

What version of Plugwise Beta are you using?

0.40.6

What was the last working version of Plugwise Beta (or Core if not using beta before)?

No response

What version of Home Assistant Core are you using?

2024.2.4

What type of installation are you running?

Home Assistant OS

How did you install plugwise-beta?

HACS

What kind of Plugwise device is having issues?

USB: Stick

What firmware version is your Plugwise product at?

2011-06-27

Logging

No response

Diagnostics information

No response

Additional information

afbeelding
afbeelding

[BUG]: Set a new state of the switch only working after a restart of HA.

Describe the bug.

In the lasttest version, de switching is working again, but stop after a couple of hours.

This is also noticeable on the measurements of the energy readings. See attached graph, the arrows: First one is the update/restart of HA and the second one is the moment the measurement is stopping regularly updating. At 5 AM I restarted HA again and the readings become normal again.

CleanShot 2023-08-07 at 18 58 01@2x

And we have a memory leak again after a couple of switches.

What version of Plugwise Beta are you using?

lastes

What was the last working version of Plugwise Beta (or Core if not using beta before)?

lastes

What version of Home Assistant Core are you using?

latest

What type of installation are you running?

Home Assistant OS

How did you install plugwise-beta?

HACS

What kind of Plugwise device is having issues?

USB: Stick

What firmware version is your Plugwise product at?

2011-06-27 10:52:18

Logging

No response

Diagnostics information

No response

Additional information

No response

[BUG]: Warnings in HA log about threading

Describe the bug.

I noticed the following sets of warnings in my HA logs. These kind of warnings are new in HA 2024.5.0.

I am not entirely sure what exactly triggered it, but I just re-enabled this integration after some downtime of my system. For some reason they did not show up when connecting to the same stick on my dev setup.

Logger: py.warnings
Bron: /usr/local/lib/python3.12/warnings.py:110
Eerst voorgekomen: 14:14:01 (9 gebeurtenissen)
Laatst gelogd: 14:18:25

/usr/local/lib/python3.12/site-packages/plugwise_usb/__init__.py:680: RuntimeWarning: coroutine 'async_setup_entry.<locals>.async_add_binary_sensors' was never awaited _LOGGER.error("Error while executing callback : %s", err)
/usr/local/lib/python3.12/site-packages/plugwise_usb/__init__.py:680: RuntimeWarning: coroutine 'async_setup_entry.<locals>.async_add_sensors' was never awaited _LOGGER.error("Error while executing callback : %s", err)
/usr/local/lib/python3.12/site-packages/plugwise_usb/__init__.py:680: RuntimeWarning: coroutine 'async_setup_entry.<locals>.async_add_switches' was never awaited _LOGGER.error("Error while executing callback : %s", err)
Logger: plugwise_usb
Bron: /usr/local/lib/python3.12/site-packages/plugwise_usb/__init__.py:680
Eerst voorgekomen: 14:14:01 (24 gebeurtenissen)
Laatst gelogd: 14:18:25

Error while executing callback : Detected that custom integration 'plugwise_usb' calls async_create_task from a thread at custom_components/plugwise_usb/binary_sensor.py, line 84: hass.async_create_task(async_add_binary_sensors(mac)). Please report it to the author of the 'plugwise_usb' custom integration.
Error while executing callback : Detected that custom integration 'plugwise_usb' calls async_create_task from a thread at custom_components/plugwise_usb/sensor.py, line 44: hass.async_create_task(async_add_sensors(mac)). Please report it to the author of the 'plugwise_usb' custom integration.
Error while executing callback : Detected that custom integration 'plugwise_usb' calls async_create_task from a thread at custom_components/plugwise_usb/switch.py, line 42: hass.async_create_task(async_add_switches(mac)). Please report it to the author of the 'plugwise_usb' custom integration.

What version of Plugwise Beta are you using?

v0.40.7

What was the last working version of Plugwise Beta (or Core if not using beta before)?

No response

What version of Home Assistant Core are you using?

2024.5.2

What type of installation are you running?

Home Assistant OS

How did you install plugwise-beta?

HACS

What kind of Plugwise device is having issues?

USB: Stick

What firmware version is your Plugwise product at?

Circle+ 2011-06-27 10:47:37, Circle 2011-06-27 10:52:18, 8x Circle 2009-09-08 15:50:31

Logging

2024-05-09 14:18:25.739 WARNING (serial_reader_thread) [homeassistant.helpers.frame] Detected that custom integration 'plugwise_usb' calls async_create_task from a thread at custom_components/plugwise_usb/binary_sensor.py, line 84: hass.async_create_task(async_add_binary_sensors(mac)), please report it to the author of the 'plugwise_usb' custom integration
2024-05-09 14:18:25.739 ERROR (serial_reader_thread) [plugwise_usb] Error while executing callback : Detected that custom integration 'plugwise_usb' calls async_create_task from a thread at custom_components/plugwise_usb/binary_sensor.py, line 84: hass.async_create_task(async_add_binary_sensors(mac)). Please report it to the author of the 'plugwise_usb' custom integration.
2024-05-09 14:18:25.739 WARNING (serial_reader_thread) [py.warnings] /usr/local/lib/python3.12/site-packages/plugwise_usb/init.py:680: RuntimeWarning: coroutine 'async_setup_entry..async_add_binary_sensors' was never awaited
_LOGGER.error("Error while executing callback : %s", err)
2024-05-09 14:18:25.742 WARNING (serial_reader_thread) [homeassistant.helpers.frame] Detected that custom integration 'plugwise_usb' calls async_create_task from a thread at custom_components/plugwise_usb/sensor.py, line 44: hass.async_create_task(async_add_sensors(mac)), please report it to the author of the 'plugwise_usb' custom integration
2024-05-09 14:18:25.742 ERROR (serial_reader_thread) [plugwise_usb] Error while executing callback : Detected that custom integration 'plugwise_usb' calls async_create_task from a thread at custom_components/plugwise_usb/sensor.py, line 44: hass.async_create_task(async_add_sensors(mac)). Please report it to the author of the 'plugwise_usb' custom integration.
2024-05-09 14:18:25.742 WARNING (serial_reader_thread) [py.warnings] /usr/local/lib/python3.12/site-packages/plugwise_usb/init.py:680: RuntimeWarning: coroutine 'async_setup_entry..async_add_sensors' was never awaited
_LOGGER.error("Error while executing callback : %s", err)
2024-05-09 14:18:25.744 WARNING (serial_reader_thread) [homeassistant.helpers.frame] Detected that custom integration 'plugwise_usb' calls async_create_task from a thread at custom_components/plugwise_usb/switch.py, line 42: hass.async_create_task(async_add_switches(mac)), please report it to the author of the 'plugwise_usb' custom integration
2024-05-09 14:18:25.744 ERROR (serial_reader_thread) [plugwise_usb] Error while executing callback : Detected that custom integration 'plugwise_usb' calls async_create_task from a thread at custom_components/plugwise_usb/switch.py, line 42: hass.async_create_task(async_add_switches(mac)). Please report it to the author of the 'plugwise_usb' custom integration.
2024-05-09 14:18:25.744 WARNING (serial_reader_thread) [py.warnings] /usr/local/lib/python3.12/site-packages/plugwise_usb/init.py:680: RuntimeWarning: coroutine 'async_setup_entry..async_add_switches' was never awaited
_LOGGER.error("Error while executing callback : %s", err)
2024-05-09 14:18:25.850 WARNING (serial_reader_thread) [homeassistant.helpers.frame] Detected that custom integration 'plugwise_usb' calls async_create_task from a thread at custom_components/plugwise_usb/binary_sensor.py, line 84: hass.async_create_task(async_add_binary_sensors(mac)), please report it to the author of the 'plugwise_usb' custom integration
2024-05-09 14:18:25.850 ERROR (serial_reader_thread) [plugwise_usb] Error while executing callback : Detected that custom integration 'plugwise_usb' calls async_create_task from a thread at custom_components/plugwise_usb/binary_sensor.py, line 84: hass.async_create_task(async_add_binary_sensors(mac)). Please report it to the author of the 'plugwise_usb' custom integration.
2024-05-09 14:18:25.853 WARNING (serial_reader_thread) [homeassistant.helpers.frame] Detected that custom integration 'plugwise_usb' calls async_create_task from a thread at custom_components/plugwise_usb/sensor.py, line 44: hass.async_create_task(async_add_sensors(mac)), please report it to the author of the 'plugwise_usb' custom integration
2024-05-09 14:18:25.853 ERROR (serial_reader_thread) [plugwise_usb] Error while executing callback : Detected that custom integration 'plugwise_usb' calls async_create_task from a thread at custom_components/plugwise_usb/sensor.py, line 44: hass.async_create_task(async_add_sensors(mac)). Please report it to the author of the 'plugwise_usb' custom integration.
2024-05-09 14:18:25.855 WARNING (serial_reader_thread) [homeassistant.helpers.frame] Detected that custom integration 'plugwise_usb' calls async_create_task from a thread at custom_components/plugwise_usb/switch.py, line 42: hass.async_create_task(async_add_switches(mac)), please report it to the author of the 'plugwise_usb' custom integration
2024-05-09 14:18:25.855 ERROR (serial_reader_thread) [plugwise_usb] Error while executing callback : Detected that custom integration 'plugwise_usb' calls async_create_task from a thread at custom_components/plugwise_usb/switch.py, line 42: hass.async_create_task(async_add_switches(mac)). Please report it to the author of the 'plugwise_usb' custom integration.
2024-05-09 14:18:25.992 WARNING (serial_reader_thread) [homeassistant.helpers.frame] Detected that custom integration 'plugwise_usb' calls async_create_task from a thread at custom_components/plugwise_usb/binary_sensor.py, line 84: hass.async_create_task(async_add_binary_sensors(mac)), please report it to the author of the 'plugwise_usb' custom integration
2024-05-09 14:18:25.992 ERROR (serial_reader_thread) [plugwise_usb] Error while executing callback : Detected that custom integration 'plugwise_usb' calls async_create_task from a thread at custom_components/plugwise_usb/binary_sensor.py, line 84: hass.async_create_task(async_add_binary_sensors(mac)). Please report it to the author of the 'plugwise_usb' custom integration.
2024-05-09 14:18:25.995 WARNING (serial_reader_thread) [homeassistant.helpers.frame] Detected that custom integration 'plugwise_usb' calls async_create_task from a thread at custom_components/plugwise_usb/sensor.py, line 44: hass.async_create_task(async_add_sensors(mac)), please report it to the author of the 'plugwise_usb' custom integration
2024-05-09 14:18:25.995 ERROR (serial_reader_thread) [plugwise_usb] Error while executing callback : Detected that custom integration 'plugwise_usb' calls async_create_task from a thread at custom_components/plugwise_usb/sensor.py, line 44: hass.async_create_task(async_add_sensors(mac)). Please report it to the author of the 'plugwise_usb' custom integration.
2024-05-09 14:18:25.998 WARNING (serial_reader_thread) [homeassistant.helpers.frame] Detected that custom integration 'plugwise_usb' calls async_create_task from a thread at custom_components/plugwise_usb/switch.py, line 42: hass.async_create_task(async_add_switches(mac)), please report it to the author of the 'plugwise_usb' custom integration
2024-05-09 14:18:25.998 ERROR (serial_reader_thread) [plugwise_usb] Error while executing callback : Detected that custom integration 'plugwise_usb' calls async_create_task from a thread at custom_components/plugwise_usb/switch.py, line 42: hass.async_create_task(async_add_switches(mac)). Please report it to the author of the 'plugwise_usb' custom integration.

Diagnostics information

No diagnostics option

Additional information

I have been looking through the code a bit and I noticed that the discovered_device callback methods are calling hass.async_create_task.

According to https://developers.home-assistant.io/docs/asyncio_working_with_async this is used for starting tasks from async. However I think the stick api (python-plugwise-usb) is using threading, so the discovered_device device callback is probably called from a thread?
That also seems to match with what the warnings are saying.

I would guess that instead something like below should/could be done?
However I am a bit worried that this could block the thread for a while, so would like a second opinion before trying this out on my setup.

    def discovered_device(mac: str):
        """Add switches for newly discovered device."""
        asyncio.run_coroutine_threadsafe(async_add_switches(mac), hass.loop).result()

[BUG] Not all entities of a Circle seem to have valid values yet.

My configuration: USB Stick, Circle+ and 6 more Circles. Latest version 0.14.4 installed. The configuration runs stable and a number of entities (switching on/off; current power usage; power consumption current hour;) work well, however the values of power consumption previous hour; power consumption today /yesterday; on the overview screen remain empty. Are these still work in progress? I checked the Plugwise part by moving the the stick to a Windows PC and "reading" the history with the Plugwise Source application. All connected Circles reported the power-history of the past couple of weeks.

[BUG]: There seems to be a memory leak

Describe the bug.

I have been running into issues with HA memory usage keep growing until it eventually hangs HA. I finally found that when stopping this integration that the memory increase stops. So it seems it is related to this integration.

As an example see the picture below. The blue line is HA memory % usage. I stopped this integration on 16th of July around 13:00 after which it stabilizes. Before that you can see a few spikes where memory usage starts rising. I just restart HA to avoid it causing problems so that is why the spikes go down.
image

What version of Plugwise Beta are you using?

v0.40.1

What was the last working version of Plugwise Beta (or Core if not using beta before)?

No response

What version of Home Assistant Core are you using?

2023.7.3

What type of installation are you running?

Home Assistant OS

How did you install plugwise-beta?

HACS

What kind of Plugwise device is having issues?

USB: Stick

What firmware version is your Plugwise product at?

Circle+ 2011-06-27 10:47:37, Circle 2011-06-27 10:52:18, 8x Circle 2009-09-08 15:50:31

Logging

I enabled logging with the "Enable debug logging" option in the integration around 21:45 on 23rd of July.
These are all the lines that have plugwise in them as I could not find the line mentioned in the template.

plugwise_ha.log

Diagnostics information

I don't see the diagnostics download option for this integration. Do see it for others.

Additional information

Might have started after I added 8 more plugs to the network a while back. Don't think I noticed issues before.

[HELP WANTED]: Tester(s) and maintainer(s) needed

โ›”๐Ÿšฉ Help wanted ๐Ÿšฉโ›”

As a team we have been unable to maintain communications with the main tester and developer for the USB legacy devices. If you want to help us maintain the USB code by joining (or reaching out to @brefra) contact us through this issue.

Warm welcome to @dirixmjm who joined efforts on the USB side as of December 2023. Welcome to the team!

[BUG] Problems with Plugwise beta

plugwise.txt

I regularly have that some circles are not available such as Circle type F (000D6F000278B66C) or 8b25a all the way, the B66C is close to the Circle + at most 5 to 6 meters away.

I also have problems with some circles when I press the switch it jumps back 15:19 just done see the log below
Circle is : 000D6F000278B257

2021-01-28 15:19:33 INFO (send_messages_thread) [plugwise.controller] Send NodePingRequest to b'000D6F000278B257' using seq_id b'799C'
2021-01-28 15:19:33 WARNING (serial_reader_thread) [plugwise.controller] Drop NodePingRequest to 000D6F000278B257 because max retries 3 reached
2021-01-28 15:19:33 INFO (send_messages_thread) [plugwise.controller] Send NodePingRequest to b'000D6F000278B24F' using seq_id b'799D'
2021-01-28 15:19:33 WARNING (serial_reader_thread) [plugwise.controller] Drop NodePingRequest to 000D6F000278B24F because max retries 3 reached
2021-01-28 15:19:33 INFO (send_messages_thread) [plugwise.controller] Resend NodePingRequest to b'000D6F000278B257' using seq_id b'799E', retry 2
2021-01-28 15:19:33 INFO (send_messages_thread) [plugwise.controller] Resend NodePingRequest to b'000D6F000278B24F' using seq_id b'799F', retry 2
2021-01-28 15:19:34 INFO (serial_reader_thread) [plugwise.controller] Received NodePingResponse from 000D6F00005528C5 with sequence id b'799A'
2021-01-28 15:19:34 INFO (serial_reader_thread) [plugwise.controller] Received NodePingResponse from 000D6F00005528C5 with sequence id b'799A'
2021-01-28 15:19:34 INFO (serial_reader_thread) [plugwise.controller] Drop unexpected NodePingResponse using seq_id b'799A'
2021-01-28 15:19:34 INFO (serial_reader_thread) [plugwise.controller] Received CirclePowerUsageResponse from 000D6F00005528C5 with sequence id b'799B'
2021-01-28 15:19:34 INFO (serial_reader_thread) [plugwise.controller] Received CirclePowerUsageResponse from 000D6F00005528C5 with sequence id b'799B'
2021-01-28 15:19:34 INFO (serial_reader_thread) [plugwise.controller] Drop unexpected CirclePowerUsageResponse using seq_id b'799B'

[BUG] Problem using Plugwise USB Stick: Rpi hangs due to running out of memory

Describe the bug.

Plugwise might be totally innocent but here's my scenario:

Two fully separate HA installations in different houses. Both are Rpi4 with new original Rpi OEM PSUs. Both with Plugwise USB Stick plugged in. Both regularly crash and need power cycling to get back up again.

In addition to the Plugwise Beta plus Sticks both also have Tasmota installed. Other than that they have a few things installed but not the same on both.

Just curious if the Stick can be part of the problem if anyone else have had issues? And if so if Plugwise beta is something to dig out logs from and so on.

What version of Home Assistant Core has the issue?

All (both Rpis set up from scratch this spring)

What was the last working version of Home Assistant Core?

None

What type of installation are you running?

Home Assistant OS

How did you install plugwise-beta?

HACS

What kind of Plugwise device is having issues?

USB: Stick

What firmware version is your Plugwise product at?

Circles are firmware: 2015-09-18 10:53:15

Logging

No response

Diagnostics information

No response

Additional information

No response

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.