Giter Club home page Giter Club logo

python-plugwise's People

Contributors

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

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

python-plugwise's Issues

[FEATURE] Make it possible to update presets

Is your feature request related to a problem? Please describe.
I really like plugwise thermostat I have, but I really dislike the web interface it has, so when I'm always a bit frustrated when I have to use it to change the temperature value of a preset I have.

Describe the solution you'd like
I would really like to be able to update presets using this library (and hopefully in the future also from home assistant).

Describe alternatives you've considered
I could probably also simply stop using the presets all together, but that would make operating the Anna I have a bit more complicated, and would require quite some changes to my home assistant configuration (although that is probably less work then adding the updating of presets to the library 🙂)

Home Assistant (please complete the following information):

  • Version: 2021.1.4
  • Deployment: virtualenv
  • Installed plugwise version: HA-core

Plugwise product and setup (please complete the following information):

  • Type: Anna

Additional context
I just want to say that I really appreciate the extensive library that you guys make as a company. Really awesome to see!

[FEATURE] List zigbee devices

I'm trying to setup extra repeaters because the Adam is in the basement and my Tom's are on the first floor and the zigbee signal doesn't reach there.
I'm using custom flashed CC2531 and CC2530+CC2591. At this moment I'm checking the core/modules xml document and comparing them with a previous version before I tried to connect the CCxxxx device to see if it connected.
Would be nice if I can query the Adam to see what zigbee device's are connected and what their neighbors are.
The CC stick looks like this in the xml:

<module id="fef68e8b0ace4e369ba7c76a00bbc8f9">
  <vendor_name/>
  <vendor_model/>
  <hardware_version/>
  <firmware_version/>
  <upgrade/>
  <created_date>2022-03-02T15:31:22.616+01:00</created_date>
  <modified_date>2022-03-02T15:31:22.666+01:00</modified_date>
  <deleted_date/>
  <services/>
  <protocols>
    <zig_bee_node id="d2365aa43b0a4e8b9e3a60364d983403">
      <mac_address>00124B001938CDFB</mac_address>
      <type>router</type>
      <reachable>true</reachable>
      <zig_bee_coordinator id="7e8af5e986214a429011774db820dae7"/>
      <neighbors>
        <zig_bee_node id="0f3ea7a23026449da097c29a35d90c19"/>
        <zig_bee_node id="8690706ba92f4a0e9af0b2cbf3800448"/>
      </neighbors>
    </zig_bee_node>
  </protocols>
</module>

If this is out of scope I will try to make myself something :)

[IMPROVE] Solve complexity

Describe the improvement

Linter checks bring to light more complexity that we should solve. They are marked as TODO in #24 and onwards and disabled for linting using # noqa: 901! Some have a complexity of over 40.

While it's not a necessity it would be best to at least have a look at why their complexity is marked high. For reference see https://www.flake8rules.com/rules/C901.html

From findings during #24

Dependency Dashboard

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

Warning

These dependencies are deprecated:

Datasource Name Replacement PR?
npm package.json Unavailable

This repository currently has no open or pending branches.

Detected dependencies

github-actions
.github/workflows/codeql-analysis.yml
  • actions/checkout v4
  • github/codeql-action v3
  • github/codeql-action v3
  • github/codeql-action v3
.github/workflows/merge.yml
  • actions/checkout v4
  • actions/setup-python v5
.github/workflows/verify.yml
  • actions/checkout v4
  • actions/setup-python v5
  • actions/cache v4
  • actions/cache v4
  • actions/checkout v4
  • actions/setup-python v5
  • actions/cache v4
  • actions/checkout v4
  • actions/setup-python v5
  • actions/cache v4
  • actions/cache v4
  • actions/checkout v4
  • actions/setup-python v5
  • actions/cache v4
  • actions/checkout v4
  • actions/setup-python v5
  • actions/cache v4
  • actions/upload-artifact v4
  • actions/checkout v4
  • actions/setup-python v5
  • actions/cache v4
  • actions/checkout v4
  • actions/checkout v4
  • actions/checkout v4
  • actions/setup-python v5
  • actions/cache v4
  • actions/download-artifact v4
  • codecov/codecov-action v4
  • actions/checkout v4
  • actions/setup-python v5
  • actions/cache v4
  • actions/checkout v4
  • actions/setup-python v5
  • actions/cache v4
npm
package.json
  • package.json ^2.0.0
  • prettier ^3.0.3
pep621
pyproject.toml
  • setuptools ~=71.0
  • wheel ~=0.43.0
pip_requirements
requirements_commit.txt
  • pylint_strict_informational ==0.1
requirements_test.txt
  • radon ==6.0.1
  • nodeenv ==1.9.1
pre-commit
.pre-commit-config.yaml
  • astral-sh/ruff-pre-commit v0.5.4
  • pre-commit/pre-commit-hooks v4.6.0
  • asottile/pyupgrade v3.16.0
  • codespell-project/codespell v2.3.0
  • PyCQA/bandit 1.7.9
  • adrienverge/yamllint v1.35.1
  • cdce8p/python-typing-update v0.6.0
  • pre-commit/mirrors-prettier v4.0.0-alpha.8
  • igorshubovych/markdownlint-cli v0.41.0

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

[BUG]: v0.25.4 causes mypy errors in Core

Describe the bug.

This is what HA Core mypy-checking shows when PR-ing plugwise v0.25.4
image

Expected behavior

No errors.

What version of Home Assistant Core has the issue?

Core latest dev

What type of installation are you running?

Home Assistant Container

How and which version of the integration do you have installed?

Home Assistant Core

What kind of Plugwise device is having issues?

Smile: Adam (including Lisa, Tom, Floor)

What firmware version is your Plugwise product at?

Not applicable

Home Assistant Logging (optional)

No response

Diagnostics information

No response

Additional information

No response

[BUG]: Log error entry: "KeyError: 'regulation_mode'"

Describe the bug.

I get the following error in the log (both in the Sep (2022.9.4) and Nov (2022.11.1) version of HA):

Logger: homeassistant.components.select
Source: components/plugwise/select.py:113
Integration: Selecteer (documentation, issues)
First occurred: 10:00:35 (2 occurrences)
Last logged: 10:00:35

Error adding entities for domain select with platform plugwise
Error while setting up plugwise platform for select
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 428, in async_add_entities
    await asyncio.gather(*tasks)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 692, in _async_add_entity
    await entity.add_to_platform_finish()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 788, in add_to_platform_finish
    await self.async_added_to_hass()
  File "/usr/src/homeassistant/homeassistant/components/plugwise/entity.py", line 81, in async_added_to_hass
    self._handle_coordinator_update()
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 348, in _handle_coordinator_update
    self.async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 545, in async_write_ha_state
    self._async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 583, in _async_write_ha_state
    state = self._stringify_state(available)
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 551, in _stringify_state
    if (state := self.state) is None:
  File "/usr/src/homeassistant/homeassistant/components/select/__init__.py", line 97, in state
    if self.current_option is None or self.current_option not in self.options:
  File "/usr/src/homeassistant/homeassistant/components/plugwise/select.py", line 113, in current_option
    return self.device[self.entity_description.current_option_key]
KeyError: 'regulation_mode'

In addition, I have the feeling that the sync of information is not "near perfect" anymore. For example, if I set a new mode (e.g. no_frost, away, ...) from HA then the temperature is not always properly synchronized back to HA. In my example, I first set the thermostat in HA to no_frost (configured as 10C in Plugwise) and afterwards to away (configured as 17.5C in Plugwise). In the Plugwise app this both shows fine, but the thermostat eventually shows away / 10C. Restarting HA fixes the desync temporarily. Obviously there might be a relation hence I propose to first fix the error in the log :).

Expected behavior

No errors and a good sync between Plugwise and HA.

What version of Home Assistant Core has the issue?

2022.11.1

What type of installation are you running?

Home Assistant Container

How and which version of the integration do you have installed?

Home Assistant Core

What kind of Plugwise device is having issues?

Smile: Adam (including Lisa, Tom, Floor)

What firmware version is your Plugwise product at?

3.7.0

Home Assistant Logging (optional)

2022-11-06 10:14:54.308 ERROR (MainThread) [homeassistant.components.select] Error adding entities for domain select with platform plugwise
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 428, in async_add_entities
await asyncio.gather(*tasks)
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 692, in _async_add_entity
await entity.add_to_platform_finish()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 788, in add_to_platform_finish
await self.async_added_to_hass()
File "/usr/src/homeassistant/homeassistant/components/plugwise/entity.py", line 81, in async_added_to_hass
self._handle_coordinator_update()
File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 348, in _handle_coordinator_update
self.async_write_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 545, in async_write_ha_state
self._async_write_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 583, in _async_write_ha_state
state = self._stringify_state(available)
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 551, in _stringify_state
if (state := self.state) is None:
File "/usr/src/homeassistant/homeassistant/components/select/init.py", line 97, in state
if self.current_option is None or self.current_option not in self.options:
File "/usr/src/homeassistant/homeassistant/components/plugwise/select.py", line 113, in current_option
return self.device[self.entity_description.current_option_key]
KeyError: 'regulation_mode'
2022-11-06 10:14:54.312 ERROR (MainThread) [homeassistant.components.select] Error while setting up plugwise platform for select
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 289, in _async_setup_platform
await asyncio.gather(*pending)
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 428, in async_add_entities
await asyncio.gather(*tasks)
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 692, in _async_add_entity
await entity.add_to_platform_finish()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 788, in add_to_platform_finish
await self.async_added_to_hass()
File "/usr/src/homeassistant/homeassistant/components/plugwise/entity.py", line 81, in async_added_to_hass
self._handle_coordinator_update()
File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 348, in _handle_coordinator_update
self.async_write_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 545, in async_write_ha_state
self._async_write_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 583, in _async_write_ha_state
state = self._stringify_state(available)
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 551, in _stringify_state
if (state := self.state) is None:
File "/usr/src/homeassistant/homeassistant/components/select/init.py", line 97, in state
if self.current_option is None or self.current_option not in self.options:
File "/usr/src/homeassistant/homeassistant/components/plugwise/select.py", line 113, in current_option
return self.device[self.entity_description.current_option_key]
KeyError: 'regulation_mode'

Diagnostics information

In case additional information is required, please let me know.

Additional information

Running Plugwise with an Adam, 4x Smile and 1x Anna. They are connected to a Intergas Kombi Kompakt HRE 36/30A
CW5.

[IMPROVE] Logging statements

Describe the improvement
Todo:

  • Write Logging style specific (decide on ending with dots etc.)?

Verify _LOGGER statements validity:

  • Do we need them?
  • When we need them, can we make them smarter (call a function, to DRY (dont repeat yourself))?
  • If they are valid, rewrite to f"Some {var1} into {var2}" from "Some %s into %s."

From findings during #24

[BUG] Python error in getting thermostat presets

A python error occurs in getting thermostat presets when using Plugwise beta component.

Edit: This seems to be only happening when the "Opentherm thermostat" (main thermostat) is not placed in a zone.

Logger: homeassistant.config_entries
Source: custom_components/plugwise/gateway.py:144
Integration: Plugwise Beta (documentation)
First occurred: 12:09:23 (1 occurrences)
Last logged: 12:09:23

Error setting up entry Adam for plugwise
Traceback (most recent call last):
  File "/home/homeassistant/lib/python3.8/site-packages/homeassistant/config_entries.py", line 293, in async_setup
    result = await component.async_setup_entry(hass, self)  # type: ignore
  File "/home/homeassistant/.homeassistant/custom_components/plugwise/__init__.py", line 21, in async_setup_entry
    return await async_setup_entry_gw(hass, entry)
  File "/home/homeassistant/.homeassistant/custom_components/plugwise/gateway.py", line 144, in async_setup_entry_gw
    api.get_all_devices()
  File "/home/homeassistant/lib/python3.8/site-packages/plugwise/smile.py", line 288, in get_all_devices
    self.all_device_data()
  File "/home/homeassistant/lib/python3.8/site-packages/plugwise/smile.py", line 248, in all_device_data
    data = self.get_device_data(dev_id)
  File "/home/homeassistant/lib/python3.8/site-packages/plugwise/smile.py", line 391, in get_device_data
    device_data = self.device_data_climate(details, device_data)
  File "/home/homeassistant/lib/python3.8/site-packages/plugwise/smile.py", line 343, in device_data_climate
    device_data["presets"] = self.presets(details["location"])
  File "/home/homeassistant/lib/python3.8/site-packages/plugwise/helper.py", line 535, in presets
    for rule_id in rule_ids:
TypeError: 'NoneType' object is not iterable

Home Assistant Core:

  • Version: 2021.6.2
  • Deployment: py-venv
  • Installed plugwise version: plugwise-beta
  • Installed through: HACS

Plugwise product:

  • Type: Adam
  • Firmware: 3.2.8

[IMPROVE] pylint

That was a quick fix for this:

... pylint-ing ...
************* Module Command line or configuration file
Command line or configuration file:1:0: E0013: Plugin 'pylint_strict_informational' is impossible to load, is it installed ? ('No module named 'pylint_strict_informational'') (bad-plugin-value)

Originally posted by @bouwew in #206 (comment)

[BUG]: Flake8 behavior on CI

Describe the bug.

Running flake8 manually vs through pre-commit vs through pre-commit --all-files yields different results (most clearly in #253 ignoring any excludes set in setup.cfg).

Expected behavior

Ignoring of excluded files

[BUG] Stick-related error in HA Core Logs

Describe the bug
This message is shown in HA Core Logs:

Logger: root
Source: custom_components/plugwise/usb.py:94
Integration: Plugwise Beta (documentation)
First occurred: 11:33:49 (1 occurrences)
Last logged: 11:33:49

Uncaught thread exception
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/threading.py", line 932, in _bootstrap_inner
    self.run()
  File "/usr/local/lib/python3.8/threading.py", line 1254, in run
    self.function(*self.args, **self.kwargs)
  File "/usr/local/lib/python3.8/site-packages/plugwise/stick.py", line 329, in scan_timeout_expired
    self.scan_callback()
  File "/config/custom_components/plugwise/usb.py", line 94, in discover_finished
    if config_entry.system_options.disable_new_entities:
AttributeError: 'ConfigEntry' object has no attribute 'system_options'

Home Assistant Core (please complete the following information):

  • Version: 2021.6.2
  • Deployment: Proxmox VM
  • Installed plugwise version: 0.15.0b0 + plugwise v0.10.0 (from testpypi)
  • Installed through 'HACS']

Plugwise product (please complete the following information):

  • Type: Stick
  • Firmware: NA

[BUG]:

Describe the bug.

After upgrade HA version 2022.11.1 or 2011.11.2 the Plugwise integration stopt working, and this error: Failed to set up

Log message:

Logger: homeassistant.config_entries
Source: components/plugwise/gateway.py:59
First occurred: 19:38:24 (1 occurrences)
Last logged: 19:38:24

Error setting up entry Adam for plugwise
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/config_entries.py", line 365, in async_setup
result = await component.async_setup_entry(hass, self)
File "/usr/src/homeassistant/homeassistant/components/plugwise/init.py", line 13, in async_setup_entry
return await async_setup_entry_gw(hass, entry)
File "/usr/src/homeassistant/homeassistant/components/plugwise/gateway.py", line 59, in async_setup_entry_gw
api.get_all_devices()
File "/usr/local/lib/python3.10/site-packages/plugwise/smile.py", line 160, in get_all_devices
self._all_device_data()
File "/usr/local/lib/python3.10/site-packages/plugwise/smile.py", line 114, in _all_device_data
self.update_for_cooling(self.gw_devices[device_id])
File "/usr/local/lib/python3.10/site-packages/plugwise/smile.py", line 80, in update_for_cooling
max_setpoint = self._sched_setpoints[1]
IndexError: list index out of range

Expected behavior

no errors and working integration

What version of Home Assistant Core has the issue?

Home Assistant 2022.11.2 Supervisor 2022.10.2 Operating System 9.3 Frontend 20221108.0 - latest

What type of installation are you running?

Home Assistant OS

How and which version of the integration do you have installed?

Home Assistant Core

What kind of Plugwise device is having issues?

Smile: Adam (including Lisa, Tom, Floor)

What firmware version is your Plugwise product at?

3.6.7

Home Assistant Logging (optional)

No response

Diagnostics information

No response

Additional information

No response

[BUG] Cannot add my Stretch with firmware 2.7.15

Describe the bug
User CoHoAppel reports errors when trying to add the Core Plugwise integration for his Stretch with firmware v2.7.15

Evidence

Logger: plugwise.smile
Source: /usr/local/lib/python3.8/site-packages/plugwise/smile.py:125
First occurred: January 27, 2021, 11:43:09 AM (8 occurrences)
Last logged: 8:20:49 PM

Connected but expected text not returned, we got <Element ‘domain_objects’ at 0xabc40488>
Connected but expected text not returned, we got <Element ‘domain_objects’ at 0xac363668>
Connected but expected text not returned, we got <Element ‘domain_objects’ at 0xac29fb40>
Connected but expected text not returned, we got <Element ‘domain_objects’ at 0xabc41ed8>
Connected but expected text not returned, we got <Element ‘domain_objects’ at 0xada2f848>

Home Assistant Core (please complete the following information):

  • Version: 2021.1.5
  • Deployment: Raspberry Pi
  • Installed plugwise version: HA-core

Plugwise product (please complete the following information):

  • Type: Stretch
  • Firmware: v2.7.15

[TODO]: Assert use in code

Todo

Hi @brefra,

Could you please check plugwise/nodes/__init__py L183. While scanning with bandit it correctly flags accordingly:

>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.
   Severity: Low   Confidence: High
   CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html)
   Location: plugwise/nodes/__init__.py:183:8
   More Info: https://bandit.readthedocs.io/en/1.7.4/plugins/b101_assert_used.html
182	        """Process received message."""
183	        assert isinstance(message, NodeResponse)
184	        if message.mac == self._mac:

[BUG] Adam: Core climate card shows no demand on any thermostat yet the heating-state shows on

Describe the bug
See the topic.
On the Plugwise App/local website the heating-icon is shown as active and the active thermostat has a yellow color instead of an orange color.

Home Assistant Core (please complete the following information):

  • Version: 2022.2.6
  • Deployment: VM
  • Installed plugwise version: v0.16.4
  • Installed through [HACS - custom_component Plugwise-beta]

Plugwise product (please complete the following information):

  • Type: Adam
  • Firmware: 3.6.5

Additional context
Add any other context about the problem here.

[BUG]: error when selecting "Verwarmen" button a 2nd time, when in "Verwarmen"-state

Describe the bug.

This is when using the Simple Thermostat card. It means that setting the schedule state to off a 2nd time causes the error.

Expected behavior

No error.

What version of Home Assistant Core has the issue?

core-2022.8.7

What type of installation are you running?

Home Assistant Supervised

How and which version of the integration do you have installed?

HACS

What kind of Plugwise device is having issues?

Smile: Adam (including Lisa, Tom, Floor)

What firmware version is your Plugwise product at?

3.6.7

Home Assistant Logging (optional)

Logger: homeassistant.components.websocket_api.http.connection
Source: custom_components/plugwise/climate.py:161
Integration: Home Assistant WebSocket API (documentation, issues)
First occurred: 15:16:04 (3 occurrences)
Last logged: 15:23:15
[140517305040032] list.remove(x): x not in list

Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 199, in handle_call_service
await hass.services.async_call(
File "/usr/src/homeassistant/homeassistant/core.py", line 1713, in async_call
task.result()
File "/usr/src/homeassistant/homeassistant/core.py", line 1750, in _execute_service
await cast(Callable[[ServiceCall], Awaitable[None]], handler.job.target)(
File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 204, in handle_service
await service.entity_service_call(
File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 676, in entity_service_call
future.result() # pop exception if have
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 930, in async_request_call
await coro
File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 713, in _handle_entity_call
await result
File "/config/custom_components/plugwise/util.py", line 30, in handler
return await func(self, *args, **kwargs)
File "/config/custom_components/plugwise/climate.py", line 161, in async_set_hvac_mode
self.device["location"],
File "/usr/local/lib/python3.10/site-packages/plugwise/smile.py", line 582, in set_schedule_state
contexts.remove(subject)
ValueError: list.remove(x): x not in list

Diagnostics information

No response

Additional information

Plugwise-beta v0.27.0a2

[BUG] Improve protected member usage

Describe the bug
Lots of Access to a protected member _(...)_thread of a client class

Evidence

  1. pylint plugwise/*py (and/or subdirectories)
  2. W0212: Access to a protected member _(...)_thread of a client class (protected-access)
  3. Rewrite these to non-underscore to share outside of class

Additional context
Found as part of codefactor improvements and refactoring.
Should be handled with care since we don't have the appropriate tests for the stick part.

[FEATURE] Add firmware update details

Is your feature request related to a problem? Please describe.
As requested by @frenck: Expose available data from Plugwise hardware through the module

Describe the solution you'd like
Add (eventually through integration) a binary sensor for firmware update

Additional context
Sifting through what the 'firmware status page' on a Anna looks like shown below, unfortunately mine is in 'auto-update' mode and as such 'locked' (can't change it), maybe because of its beta-status.

		<enabled>true</enabled>
		<firmware_locked>false</firmware_locked>
		<prevent_default_update>false</prevent_default_update>

lots of Elga errors in notifications

Hi,

Not sure if this is even a plugwise related issue, or something with my Elga heatpump/boiler combination, but only since I have integrated it in HA I'm seeing these errors. Of course, before I didn't have anywhere to see it, yet maybe someone could shed some light on what is happening.

I am getting a lot of notifications about issues between the Elga and my (Remeha Quinta 35c) boiler. This is over a period of 5 days, the errors seem to pop up randomly:
Error: The Techneco Elga cannot read its NTC2 supply temperature sensor.
Error: The Techneco Elga cannot communicate with its slave OpenTherm boiler.
Error: The OpenTherm boiler slaved to the Techneco Elga has a fault.
Error: The Techneco Elga cannot read its NTC1 return temperature sensor.
Error: There is no OpenTherm communication with the boiler.
Error: The Techneco Elga cannot communicate with its slave OpenTherm boiler.
Error: The OpenTherm boiler slaved to the Techneco Elga has a fault.
Error: The OpenTherm boiler slaved to the Techneco Elga has a fault.
Error: The Techneco Elga's pump cannot generate sufficient water flow.
Error: The Techneco Elga cannot read its additional external temperature sensor.
Error: The Techneco Elga cannot read its NTC2 supply temperature sensor.
Error: The Techneco Elga cannot read its NTC1 return temperature sensor.
Error: The boiler indicates something is wrong.
Error: The Toshiba board used by the Techneco Elga has a fault.

Occasionally I see in the log entries like below, but these do not map to the times when the notifications are sent:
2021-04-26 14:58:09 ERROR (MainThread) [custom_components.plugwise.gateway] Timeout fetching Smile Anna data
2021-04-22 18:10:04 ERROR (MainThread) [plugwise.helper] Smile response empty or error in <?xml version="1.0" encoding="UTF-8"?> <error> <code>400 Bad Request</code> <message>XML validation failed: Extra element setpoint in interleave (document):1: Element thermostat_functionality failed to validate content </message> </error>
2021-04-22 18:10:04 ERROR (MainThread) [custom_components.plugwise.climate] Error while communicating to device

Interestingly, the Elga hasn't been heating all that time as the indoor temperature was > setpoint all the time.

I'm on Home Assistant OS, core-2021.4.6, using plugwise-beta 1.11.3 (I'm now updating to 1.12.3 to see if it makes any difference).

Maybe @bouwew you recognise any of this?

Many thanks!

[BUG]: Error setting up entry Anna for plugwise - type conversion

Describe the bug.

When starting Home Assistant, I get a type error in the Anna plugin log. The integration is not set up. For exact error message, see the error log below.
I have been using the integration for a long time. In the 2022.3 release, it is not working anymore.

Expected behavior

A working system.

What version of Home Assistant Core has the issue?

2022.3

What type of installation are you running?

Home Assistant Supervised

How and which version of the integration do you have installed?

Home Assistant Core

What kind of Plugwise device is having issues?

Smile: Anna

What firmware version is your Plugwise product at?

4.2.1?

Home Assistant Logging (optional)

No response

Diagnostics information

No response

Additional information

Logfile of Anna integration:

Logger: homeassistant.config_entries
Source: components/plugwise/gateway.py:53
First occurred: March 8, 2022, 10:35:28 PM (1 occurrences)
Last logged: March 8, 2022, 10:35:28 PM

Error setting up entry Anna for plugwise
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/config_entries.py", line 335, in async_setup
result = await component.async_setup_entry(hass, self)
File "/usr/src/homeassistant/homeassistant/components/plugwise/init.py", line 13, in async_setup_entry
return await async_setup_entry_gw(hass, entry)
File "/usr/src/homeassistant/homeassistant/components/plugwise/gateway.py", line 53, in async_setup_entry_gw
api.get_all_devices()
File "/usr/local/lib/python3.9/site-packages/plugwise/smile.py", line 106, in get_all_devices
self._all_device_data()
File "/usr/local/lib/python3.9/site-packages/plugwise/smile.py", line 60, in _all_device_data
data = self._get_device_data(device_id)
File "/usr/local/lib/python3.9/site-packages/plugwise/smile.py", line 201, in _get_device_data
device_data = self._get_appliance_data(dev_id)
File "/usr/local/lib/python3.9/site-packages/plugwise/helper.py", line 897, in _get_appliance_data
and self._outdoor_temp > data["cooling_activation_outdoor_temperature"]
TypeError: '>' not supported between instances of 'NoneType' and 'float'

[FEATURE] Improve code (through testing)

With regards to forthcoming from #65 and smile.py: (i.e. things I didn't cover not to cover) in #65

  • Create test scenario (patch/mock full_update_device) towards L206' except XMLDataMissingError:
  • Fix with async_io timeout not excepting to L246 asyncio.TimeoutError (either fix test or fix code)
  • L252 with cornercase stretch responding 200 instead of 202 (should be in #65 before merging
  • L966 dual rule_ids is None: should get an indication of how/why (left it for now as uncovered)

Evaluate

Things we might already have but need validation on userdata and then testing of:

  • L772 Fix for Adam + Anna: heating_state also present under Anna, remove should be something for userdata testing (if we can generate such)
  • L750 self.get_open_valves on city-heating, same thing
  • L1231 the uri on if stretch_v2:

[BUG]: Communiction failed, but works with SevenW/Plugwise-2-py

Describe the bug.

I've been using https://github.com/SevenW/Plugwise-2-py for years with about a dozen Circles and one Circle+, but I'd like to switch to this. However, I get the following:

2022-12-15 23:03:36.500 DEBUG (MainThread) [custom_components.plugwise.usb] Connect to USB-Stick
2022-12-15 23:03:37.320 ERROR (MainThread) [custom_components.plugwise.usb] Connecting to Plugwise USBstick communication failed
2022-12-15 23:03:37.320 WARNING (MainThread) [homeassistant.config_entries] Config entry 'Stick' for plugwise integration not ready yet; Retrying in background
2022-12-15 23:03:46.955 DEBUG (MainThread) [custom_components.plugwise.usb] Connect to USB-Stick
2022-12-15 23:03:46.973 ERROR (MainThread) [custom_components.plugwise.usb] Connecting to Plugwise USBstick communication failed
``

This just loops, no matter how long I wait.

Stick is a `Bus 001 Device 005: ID 0403:6001 Future Technology Devices International, Ltd FT232 Serial (UART) IC`

I'm passing this into the docker container with `--device=/dev/serial/by-id/usb-FTDI_FT232R_USB_UART_A9003tBk-if00-port0` and i'm setting it privilegd, but to no avail.

### Expected behavior

Connect to the circle+ and actually work. Or at least be more verbose about what isn't working.

### What version of Home Assistant Core has the issue?

2022.12

### What type of installation are you running?

Home Assistant Container

### How and which version of the integration do you have installed?

HACS

### What kind of Plugwise device is having issues?

USB: Stick

### What firmware version is your Plugwise product at?

unsure, no mobile app. definitely very old.

### Home Assistant Logging (optional)

2022-12-15 23:03:36.500 DEBUG (MainThread) [custom_components.plugwise.usb] Connect to USB-Stick
2022-12-15 23:03:37.320 ERROR (MainThread) [custom_components.plugwise.usb] Connecting to Plugwise USBstick communication failed
2022-12-15 23:03:37.320 WARNING (MainThread) [homeassistant.config_entries] Config entry 'Stick' for plugwise integration not ready yet; Retrying in background
2022-12-15 23:03:46.955 DEBUG (MainThread) [custom_components.plugwise.usb] Connect to USB-Stick
2022-12-15 23:03:46.973 ERROR (MainThread) [custom_components.plugwise.usb] Connecting to Plugwise USBstick communication failed
2022-12-15 23:03:56.976 DEBUG (MainThread) [custom_components.plugwise.usb] Connect to USB-Stick
2022-12-15 23:03:56.977 ERROR (MainThread) [custom_components.plugwise.usb] Connecting to Plugwise USBstick communication failed


### Diagnostics information

3.10 or whatever is in the HA core docker image

### Additional information

Switching back to SevenW Plugwise works immediately after i remove plugwise-beta.

[IMPROVE] If statements for booleans/trilean state

Describe the improvement

Evaluate rewriting if something_somewhere is True: to if something. This goes for None, False and True (hence trilean). It won't be possible everywhere (we have a specific case in plugwise-beta where we needed it like that, but most of them should be rewritable in python-plugwise.

From findings during #24

[FEATURE]: Custom climate control

Describe the solution you are looking for

Buying the adam I was under the impression that I would be able to control my heater directly. Currently I can only control it through my Lisa though. I'd like to be able to set the requested temperature for my heater directly, mostly to improve my floor heating. I've been unable to find any way to do it. In the end I would love to have a service call in home assistant that I could use to change the opentherm intended temperature of my heater.

It is unclear to me if the heating logic is inside the Lisa or the Adam, but I assume it is in the Lisa. In this case it shouldn't be a problem to add my own 'zone' that tries to control the heater as well.

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

No response

Describe alternatives you've considered

I've checked if there's any way to create a 'custom' climate device in home assistant that I would be able to control.

What type of installation are you running?

Home Assistant Container

How did you install python-plugwise (or plugwise) for short

Home Assistant Core

What kind of Plugwise device is having issues?

Smile: Adam (including Lisa, Tom, Floor)

What firmware version is your Plugwise product at?

Firmware: 3.2.8

Your setup

Lisa, Adam and an aqara plug. I have a standard CV with floor heating and radiators.

Additional context

No response

[FEATURE]: Rewrite to match/case

Describe the solution you are looking for

Also see #565 comment on rewriting the if statements to match/cases

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

Just an idea that came up

Describe alternatives you've considered

Leaving as be - there is no harm in the current set up

What type of installation are you running?

Home Assistant OS

How did you install python-plugwise (or plugwise) for short

HA using HACS

What kind of Plugwise device is having issues?

Smile: Anna

What firmware version is your Plugwise product at?

n/a

Your setup

n/a

Additional context

n/a

[BUG]: Library didn't catch aiohttp.ClientConnectionError

Describe the bug.

I just experienced a power grid outage @ my home, when it returned, I noticed that Plugwise didn't recover. The reason is that Home Assistant was faster in starting up than Plugwise and the connection failed.

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 335, in async_setup
    result = await component.async_setup_entry(hass, self)
  File "/usr/src/homeassistant/homeassistant/components/plugwise/__init__.py", line 13, in async_setup_entry
    return await async_setup_entry_gw(hass, entry)
  File "/usr/src/homeassistant/homeassistant/components/plugwise/gateway.py", line 43, in async_setup_entry_gw
    connected = await api.connect()
  File "/usr/local/lib/python3.9/site-packages/plugwise/smile.py", line 260, in connect
    result = await self._request(DOMAIN_OBJECTS)
  File "/usr/local/lib/python3.9/site-packages/plugwise/helper.py", line 259, in _request
    resp = await self._websession.get(url, headers=headers, auth=self._auth)
  File "/usr/local/lib/python3.9/site-packages/aiohttp/client.py", line 535, in _request
    conn = await self._connector.connect(
  File "/usr/local/lib/python3.9/site-packages/aiohttp/connector.py", line 542, in connect
    proto = await self._create_connection(req, traces, timeout)
  File "/usr/local/lib/python3.9/site-packages/aiohttp/connector.py", line 907, in _create_connection
    _, proto = await self._create_direct_connection(req, traces, timeout)
  File "/usr/local/lib/python3.9/site-packages/aiohttp/connector.py", line 1206, in _create_direct_connection
    raise last_exc
  File "/usr/local/lib/python3.9/site-packages/aiohttp/connector.py", line 1175, in _create_direct_connection
    transp, proto = await self._wrap_create_connection(
  File "/usr/local/lib/python3.9/site-packages/aiohttp/connector.py", line 992, in _wrap_create_connection
    raise client_error(req.connection_key, exc) from exc
aiohttp.client_exceptions.ClientConnectorError: Cannot connect to host 10.10.11.200:80 ssl:default [Connect call failed ('10.10.11.200', 80)]

Did a patch upstream: home-assistant/core#71642
However, the library should handle connection issues (as its purpose is handling the connection).

Expected behavior

...

What version of Home Assistant Core has the issue?

2022.6.0dev0

What type of installation are you running?

Home Assistant Core

How and which version of the integration do you have installed?

Home Assistant Core

What kind of Plugwise device is having issues?

Smile: Adam (including Lisa, Tom, Floor)

What firmware version is your Plugwise product at?

3.6.7

Home Assistant Logging (optional)

No response

Diagnostics information

No response

Additional information

No response

[BUG] aiohttp deflate error

Describe the bug
Error when adding the integration for the Stretch.

Evidence

2020-08-21 23:20:18 ERROR (MainThread) [custom_components.plugwise.config_flow] Unexpected exception
Traceback (most recent call last):
  File "/config/custom_components/plugwise/config_flow.py", line 130, in async_step_user
    api = await validate_input(self.hass, user_input)
  File "/config/custom_components/plugwise/config_flow.py", line 74, in validate_input
    await api.connect()
  File "/usr/local/lib/python3.8/site-packages/Plugwise_Smile/Smile.py", line 161, in connect
    result = await resp.text()
  File "/usr/local/lib/python3.8/site-packages/aiohttp/client_reqrep.py", line 1009, in text
    await self.read()
  File "/usr/local/lib/python3.8/site-packages/aiohttp/client_reqrep.py", line 973, in read
    self._body = await self.content.read()
  File "/usr/local/lib/python3.8/site-packages/aiohttp/streams.py", line 358, in read
    block = await self.readany()
  File "/usr/local/lib/python3.8/site-packages/aiohttp/streams.py", line 380, in readany
    await self._wait('readany')
  File "/usr/local/lib/python3.8/site-packages/aiohttp/streams.py", line 296, in _wait
    await waiter
aiohttp.client_exceptions.ClientPayloadError: 400, message='Can not decode content-encoding: deflate'

Home Assistant Core (please complete the following information):

  • Version: 0.114.3
  • Deployment: hassio
  • Installed plugwise version: plugwise-beta pre-v0.7.0a0 code
  • Installed through: HACS

Smile (please complete the following information):

  • Sort of Smile: Stretch v2
  • Firmware: 2.3.12

Additional context
Adding this: headers = {'Accept-Encoding': 'gzip'} make the error go away.

[FEATURE]: support for changing temperature offset

Describe the solution you are looking for

Lisa and Tom/Floor allow setting the temperature offset:
image

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

No response

Describe alternatives you've considered

None.

What type of installation are you running?

Home Assistant Supervised

How did you install python-plugwise (or plugwise) for short

HA using HACS

What kind of Plugwise device is having issues?

Smile: Adam (including Lisa, Tom, Floor)

What firmware version is your Plugwise product at?

3.7.3

Your setup

Adam, Anna, Lisa, Tom, Plugs, Intergas CV-ketel.

Additional context

No response

Anna/Smile with hybrid setup Elga+gas boiler - only detect boiler burning

I have a hybrid setup with an Elga heatpump connected to a Remeha Quinta boiler for central heating, and a Plugwise Anna.
Now the integration in HA only shows when the boiler is heating. When the Elga is working (I’m monitoring its power draw separately) but the boiler isn’t, then the card shows that it’s idle.

Is this a matter of configuration or maybe a limitation of the integration? Anna is connected (using OpenTherm) to the Elga, which is connected to the gas boiler, so I would expect Anna to understand that Elga is ‘burning’ as well? Is this setup, without Adam, supported? I'd rather not shell out again for an Adam, whose further functionality I have no need of, just to get the monitoring right in HA :)

XMLs attached, many thanks for any assistance!

[BUG]: Plugwise heating not showing opentherm but on/off

Describe the bug.

See home-assistant/core#72305

Expected behavior

Showing an OpenTherm device.

What version of Home Assistant Core has the issue?

2022.4.0

What type of installation are you running?

Home Assistant Core

How and which version of the integration do you have installed?

Home Assistant Core

What kind of Plugwise device is having issues?

Smile: Adam (including Lisa, Tom, Floor)

What firmware version is your Plugwise product at?

TBD

Home Assistant Logging (optional)

No response

Diagnostics information

No response

Additional information

No response

[FEATURE] Switch for DHW

First of all, thank you very much for the great integration, all your hard work and time. Really appreciated 👏

Is your feature request related to a problem? Please describe.
I have a stupid opentherm boiler (Remeha Calenta) that doesn't heat the domestic hot water on demand. Only option to have the hot water is to turn on DHW Comfort mode on the boiler (via an opentherm thermostat). If I keep DHW Comfort on, it uses a lot of gas and keeps the water warm all the time, even though I don't need it which costs money and not good for the environment.

Describe the solution you'd like
On the Plugwise Adam interface, there is a toggle under Settings -> Heating System -> Heating -> Advanced Settings to turn on DHW Comfort mode on or off. A good way is to have a switch on HA to turn this on and off instead of going to Plugwise interface every time. This will also allow me to set up reminders if I leave hot water on for a long time and use smart assistants with voice to turn on/off. After we have the switch in HA, the possibilities are endless.

Home Assistant (please complete the following information):

  • Version | core-2021.2.2
  • Installation Type | Home Assistant OS
  • Installed plugwise version: HA-core
  • Installed through: 'Core

Plugwise product and setup (please complete the following information):

  • Type: Adam
  • Firmware: [check through the app or the integrations page in Home Assistant]
  • Setup: Plugwise Lisa, Toon

Additional context
I did a bit research, the status of the switch can be get from
GET: {APPLIANCES}/core/appliances;id={appl_id}
endpoint from the following element

<domestic_hot_water_toggle id="XXXXX"/>
<updated_date>2021-02-11T02:46:42.165+01:00</updated_date>
<type>domestic_hot_water_comfort_mode</type>
<state>off</state>
</toggle_functionality>

and the status get be set with
PUT: {APPLIANCES};id= {appl_id}/toggle;type=domestic_hot_water_comfort_mode
with the following XML as data

<toggle><state>{state}</state></toggle>

possible states are off and on

Thank you very much again and have a great day!

Tag the source

Describe the bug
It would be very helpful if you could tag releases as well. This would enable distributions to use the source tarball from GitHub instead of PyPI.

Was done in the past could be a glitch in the workflow.

Thanks

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.