Giter Site home page Giter Site logo

erikkastelec / hass-wem-portal Goto Github PK

View Code? Open in Web Editor NEW
44.0 44.0 10.0 214 KB

Custom component for retrieving sensor information from Weishaupt WEM Portal

License: MIT License

Python 100.00%
home-assistant-hacs homeassistant-integration weishaupt wem-portal

hass-wem-portal's People

Contributors

dm82m avatar erikkastelec avatar fl0x53 avatar ghenzler avatar mk-maddin avatar vanto avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

hass-wem-portal's Issues

More info possible?

Hello Erik,

Is it possible to get even more info out of this? Like returnflow on heating, gassmoke temp and kwh usage graph?

Great intergration btw.

Plugin loses contact to wem Portal, throws error and doesn’t get back working

Logger: custom_components.wemportal
Source: custom_components/wemportal/sensor.py:131 
Integration: wemportal (documentation, issues) 
First occurred: 22. März 2021, 16:43:53 (4472 occurrences) 
Last logged: 12:05:01

can't find hydraulik-korrektur_aufheizoptimierung_rücksetzen
can't find heizkreis_heizkreise_heizkreis_1-status
can't find heizkreis_heizkreise_heizkreis_1-warmwassersolltemperatur_aktuell
can't find heizkreis_heizkreise_heizkreis_1-warmwassertemperatur_aktuell
can't find heizkreis_heizkreise_heizkreis_1-pumpe_warmwasser

If I restart HA it is back working. That already occurred couple of times.

IndexError: list index out of range

Started the component but got an IndexError. Let me know if you need anything for debugging.

Logger: wemportal
Source: custom_components/wemportal/wemportalapi.py:27
First occurred: 12:13:34 (1 occurrences)
Last logged: 12:13:34

Unexpected error fetching wem_portal_sensor data: list index out of range
Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.8/site-packages/homeassistant/helpers/update_coordinator.py", line 149, in async_refresh
    self.data = await self._async_update_data()
  File "/srv/homeassistant/lib/python3.8/site-packages/homeassistant/helpers/update_coordinator.py", line 137, in _async_update_data
    return await self.update_method()
  File "/home/homeassistant/.homeassistant/custom_components/wemportal/sensor.py", line 385, in async_update_data
    data = await hass.async_add_executor_job(api.fetch_data)
  File "/usr/lib/python3.8/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/home/homeassistant/.homeassistant/custom_components/wemportal/wemportalapi.py", line 27, in fetch_data
    data = processor.run([wemportalJob])[0]
IndexError: list index out of range

And that leads to:

Logger: homeassistant.components.sensor
Source: custom_components/wemportal/sensor.py:467
Integration: Sensor (documentation, issues)
First occurred: 12:13:34 (1 occurrences)
Last logged: 12:13:34

Error while setting up wemportal platform for sensor
Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.8/site-packages/homeassistant/helpers/entity_platform.py", line 198, in _async_setup_platform
    await asyncio.shield(task)
  File "/home/homeassistant/.homeassistant/custom_components/wemportal/sensor.py", line 409, in async_setup_platform
    entities.append(WemPortalSensor(coordinator, sensor_type, sensor_prefix))
  File "/home/homeassistant/.homeassistant/custom_components/wemportal/sensor.py", line 428, in __init__
    self._state = self.state
  File "/home/homeassistant/.homeassistant/custom_components/wemportal/sensor.py", line 467, in state
    state = self.coordinator.data[self.type]
TypeError: 'NoneType' object is not subscriptable

API failure on component start

Component fails to start when using mode both or api

Error during setup of component wemportal
Traceback (most recent call last):
File "/usr/local/lib/python3.10/site-packages/requests/models.py", line 971, in json
return complexjson.loads(self.text, **kwargs)
File "/usr/local/lib/python3.10/site-packages/simplejson/init.py", line 525, in loads
return _default_decoder.decode(s)
File "/usr/local/lib/python3.10/site-packages/simplejson/decoder.py", line 372, in decode
obj, end = self.raw_decode(s)
File "/usr/local/lib/python3.10/site-packages/simplejson/decoder.py", line 402, in raw_decode
return self.scan_once(s, idx=_w(s, idx).end())
simplejson.errors.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 239, in _async_refresh
self.data = await self._async_update_data()
File "/config/custom_components/wemportal/coordinator.py", line 29, in _async_update_data
return await self.hass.async_add_executor_job(self.api.fetch_data)
File "/usr/local/lib/python3.10/concurrent/futures/thread.py", line 58, in run
result = self.fn(*self.args, **self.kwargs)
File "/config/custom_components/wemportal/wemportalapi.py", line 60, in fetch_data
self.fetch_api_data()
File "/config/custom_components/wemportal/wemportalapi.py", line 94, in fetch_api_data
self.get_data()
File "/config/custom_components/wemportal/wemportalapi.py", line 265, in get_data
).json()
File "/usr/local/lib/python3.10/site-packages/requests/models.py", line 975, in json
raise RequestsJSONDecodeError(e.msg, e.doc, e.pos)
requests.exceptions.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/setup.py", line 256, in _async_setup_component
result = await task
File "/config/custom_components/wemportal/init.py", line 65, in async_setup
await coordinator.async_config_entry_first_refresh()
File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 211, in async_config_entry_first_refresh
raise ex
homeassistant.exceptions.ConfigEntryNotReady: Expecting value: line 1 column 1 (char 0)

Originally posted by @dilki001 in #36 (comment)

Thank you, suggestion and question(s)

Hey @erikkastelec,

first of all - thank you! Due to missing time I only created a dirty way of using Wemportal in HA based on the work of another dev. See: https://github.com/dm82m/wemportal-scripts
I am currently testing out your integration and if that works well I will shut down my version and stay with yours! :)

I am running HA in a virtualenv and encountered the following log error after installing your component and a server restart:

Logger: homeassistant.components.homeassistant
Source: components/homeassistant/__init__.py:122
Integration: Home Assistant Core Integration (documentation, issues)
First occurred: 8:20:55 (1 occurrences)
Last logged: 8:20:55

Platform error sensor.wemportal - No module named 'scrapyscript'

So I manually installed scrapyscript with its dependencies in my virtualenv. Maybe you could put that as a hint in your readme.

I am also in contact with Weishaupt and they asked me to reduce the scan interval to 30mins due to server performance problems. But I will now run with your default and see what happens.

And one additional question: are you accessing the experts page to extract the data? If so, it is asking for a specialist code here on my Weishaupt gas heating system. I have not found this code '11 - in my case' in your script. So how do you access it?

Best,
Dirk

Error "list index out of range"

Hello Erik,
since yesterday, i'm getting always an error after the start of HA:

Traceback (most recent call last):
File "/config/custom_components/wemportal/wemportalapi.py", line 71, in fetch_webscraping_data
self.data = processor.run([wemportal_job])[0]
IndexError: list index out of range

The module by itself is still working, but i'm getting only a small bunch of readings, a lot of readings are "not available".
Is there any change on WEM side?

br
Alex

Data is missing

Following data is missing:

  • Vorlaufsolltemperatur
  • Rücklauftemperatur

Decrease scan_interval minimum value

Hey @erikkastelec,

thanks a lot for creating this Home Assistant integration! I'm currently using my own Docker solution which scrapes every 30 seconds. I saw in #1 that there was a request from Weishaupt to have at least 30 minutes interval so you set the minimum to 15 mins:

update_interval=max(config.get(CONF_SCAN_INTERVAL), timedelta(minutes=15)),

I agree with setting the default to 30 minutes but would ask you if you could reduce the minimum value to 1 minute (or at least 5 minutes), because I have some automations which rely on fresh data and would love to switch to your integration.

Imho it's not our problem that Weishaupt isn't providing the customer a better API since we pay a lot of money for the web interface and the heat pump.

Configuration error after 1.3.1 update

Hi,

first of all big thank you for this integration :)
I am using it since I have my weishaupt WWP LS-8 B and it is an awesome way to provide overview and control of my heating via home assistant 👍

Unfortunately since the 1.3.1 release I am getting the following error (with my old configuration) after a restart - even thought the configuration check is fine:

sensor:
  - platform: wemportal
    username: !secret wemportal_usr
    password: !secret wemportal_pwd
    language: de
    # every 17min - default 30min = 1800 - not recommended below 15min = 900
    scan_interval: 1020
    # every 3min - default 5min = 500 - should not be lower than 180 = 3 minutes
    api_scan_interval: 180
    mode: both

2022-04-21 13:02:39 ERROR (MainThread) [homeassistant.config] Invalid config for [wemportal]: expected a dictionary for dictionary value @ data['wemportal']. Got None. (See ?, line ?). Please check the docs at https://github.com/erikkastelec/hass-WEM-Portal 2022-04-21 13:02:39 ERROR (MainThread) [homeassistant.setup] Setup failed for custom integration wemportal: Invalid config. 2022-04-21 13:02:40 ERROR (MainThread) [homeassistant.setup] Unable to prepare setup for platform wemportal.sensor: Unable to set up component.

If I now switch to the configuration as it is documented, I am receiving the following error on configuration check and if I ignore the check and reboot the system fully, HA does not even start up any more until I remove the configuration yaml part of the wemportal integration.. :(

wemportal:
  username: !secret wemportal_usr
  password: !secret wemportal_pwd
  language: de
  # every 17min - default 30min = 1800 - not recommended below 15min = 900
  scan_interval: 1020
  # every 3min - default 5min = 500 - should not be lower than 180 = 3 minutes
  api_scan_interval: 180
  mode: both

2022-04-21 12:59:34 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection] [139934117552912] Error handling message: expected a dictionary for dictionary value @ data['wemportal']. Got None (invalid_format)

Any idea where my configuration is wrong?

"check configuration" keeps spinning on docker

Hi,
I have the same issue mentioned in #35
As soon as I add the following lines for the wemportal in my configuration.yaml the "check configuration" keeps spinning.

wemportal:
  username: !secret wemUsername
  password: !secret wemPassword

When I restart the container manually in the UI I get "Wrapping up startup, not everything will be available until it is finished" for a while and in the log I get this:
2022-11-11 19:51:41.385 ERROR (MainThread) [homeassistant.setup] Setup failed for custom integration wemportal: Requirements for wemportal not found: ['python-Levenshtein==0.20.*'].

Do you have some idea how to resolve this?

Best

any idea how to set device_class: 'temperature'

hey @erikkastelec

I tried but found no way how to set the device_class attribute. I guess that if it is not set for entities that are containing a temperature it is not possible to group them in one history-graph in Lovelace.

One example here:
image

If you could point me into a direction, I can try to do it and create an PR.

Best,
Dirk

Multiple devices support

Hi,
I am running version 1.3.16 on

Home Assistant 2022.11.1
Supervisor 2022.10.2
Operating System 9.3
Frontend 20221102.1 - latest

At the moment I have the following error message in the log:

Traceback (most recent call last):
File "/config/custom_components/wemportal/wemportalapi.py", line 71, in fetch_webscraping_data
self.data = processor.run([wemportal_job])[0]
IndexError: list index out of range

On the weekend I added a second device into the wem portal. Since then only API calls are running (mode=both).

Please help.

something stopped working...

Something stopped working...

Logger: custom_components.wemportal
Source: custom_components/wemportal/wemportalapi.py:70
Integration: Weishaupt WEM Portal (documentation, issues)
First occurred: 09:32:21 (1 occurrences)
Last logged: 09:32:21

There was a problem with getting data from WEM Portal. If this problem persists, open an issue at https://github.com/erikkastelec/hass-WEM-Portal/issues
Traceback (most recent call last):
File "/config/custom_components/wemportal/wemportalapi.py", line 70, in fetch_webscraping_data
self.data = processor.run([wemportal_job])[0]
IndexError: list index out of range

Sensors missing after update to 2022.10

Hey there,
after updating to the newest homeassistent version I got the following error:

Dieser Fehler wurde von einer benutzerdefinierten Integration verursacht

Logger: custom_components.wemportal
Source: custom_components/wemportal/wemportalapi.py:71
Integration: Weishaupt WEM Portal (documentation, issues)
First occurred: 06:56:35 (1 occurrences)
Last logged: 06:56:35

There was a problem with getting data from WEM Portal. If this problem persists, open an issue at https://github.com/erikkastelec/hass-WEM-Portal/issues
Traceback (most recent call last):
  File "/config/custom_components/wemportal/wemportalapi.py", line 71, in fetch_webscraping_data
    self.data = processor.run([wemportal_job])[0]
IndexError: list index out of range

There are just a few sensors that still working. Here an example for Vorlauf

Screenshot_2022-10-06-07-15-13-722_io homeassistant companion android

Please let me know I you also got problems with the newest version or if I can help you with more information to solve the issue.

Have a nice day 😊

Best regards
Steffen

Improvement idea regarding availability

hey guys,

I am working with mode: both and observing the issue that sometimes the availability of wemportal.com breaks. If this is the case the value of the sensors provided by wemportal.com switches to unavailable and is not reconnecting - even if wemportal will be back online. The only way getting new data is restarting my Home Assistant instance.

Could there be any "observation" be implemented in the component itself that will reconnect in these cases?

Or is someone having any alternative in mind? Like creating an automation that observers the status of the sensor and restarts the component in case the sensor is unavailable?

Best,
Dirk

"check configuration" keeps spinning ?

I have a working HA system and I wanted to add this WEM Portal integration.
As soon as I add it to my configuration and I go to "Developer tools" -> "Check configuration", it keeps spinning and never validates or invalidates the configuration.

Anyone else have this issue?

I have it in my configuration.yaml like this:

wemportal:
  language: en
  mode: api
  username: xxx@xxx
  password: xxxxx

has device class None, state class None and unit thus indicating it has a numeric value; however, it has the non-numeric value

Logger: homeassistant.components.sensor
Source: components/sensor/init.py:597
Integration: Sensor (documentation, issues)
First occurred: 15:14:12 (1 occurrences)
Last logged: 15:14:12

Sensor sensor.heizkreis_heizkreise_heizkreis_2_pumpe_warmwasser has device class None, state class None and unit thus indicating it has a numeric value; however, it has the non-numeric value: Ein (<class 'str'>); Please update your configuration if your entity is manually configured, otherwise report it to the custom integration author.

Names and device

First of all: thanks for your great project.
In "both" mode, I see 78 wemportal entities and I am bit lost between them. Some of them are in german, some in english due to issue #22. Some of them have a prefix of "heat_pump", "heating_circuits" or "wez", others have none of these.
Could you maybe add a "Heat Pump" device? That would allow to add all entities to an area in one step. Also all sensors or all controls could be added to a dashboard in one step.
Otherwise, I suggest to add some common entity prefixes that can be used in entity filtering of the lovelace cards. Something like:

  • wem_
  • wem_web
  • wem_api

What to do with this?

It worked and suddenly it stopped. Logs:

Logger: homeassistant.setup
Source: custom_components/wemportal/init.py:44
Integration: wemportal (documentation, issues)
First occurred: 13:44:59 (1 occurrences)
Last logged: 13:44:59

Error during setup of component wemportal
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/setup.py", line 235, in _async_setup_component
result = await task
File "/config/custom_components/wemportal/init.py", line 44, in async_setup
if config[DOMAIN].get(CONF_MODE) == "web":
KeyError: 'wemportal'

Timeout fetching data / wemportal.com works fine

Just found out that the plugin is currently not working on my side:

Logger: custom_components.wemportal
Source: helpers/update_coordinator.py:193
Integration: wemportal (documentation, issues)
First occurred: 21:33:05 (1 occurrences)
Last logged: 21:33:05

Timeout fetching wem_portal_sensor data

Function "Warmwasser Push"

Hello, I have a question about the request at the time for the hot water push function. Where can I find this function in the current version. I refer to #7

Thank you very much

Integrate Weishaupt API instead of using WEM Portal

Hey @erikkastelec,

a while ago I switched to (currently undocumented?) API endpoints instead of scraping the web interface, because it was more reliable. Unfortunately a lot of informations are currently missing (or I was not able to find out the correct endpoint) which are visible in the WEM Portal. Maybe you're able to dig deeper into the API, because there it's also possible to change the temperature and stuff like that very easily (which helps with #7).

Headers
User-Agent: WeishauptWEMApp
Accept: application/json
X-Api-Version: 2.0.0.0

Login Endpoint
URL: https://www.wemportal.com/app/Account/Login
Request: POST
Body:

Name:<username>
PasswordUTF8:<password>
AppID:de.weishaupt.wemapp
AppVersion:2.0.2
ClientOS:Android

Get all devices attached to the account
You'll use these module indexes within the next request.
URL: https://www.wemportal.com/app/Device/Read
Request: GET

Getting data from device
URL: https://www.wemportal.com/app/DataAccess/Read
Request: POST
Body:

{
    "DeviceID": <0000>,
    "Modules": [
        {
            "ModuleIndex": 1,
            "ModuleType": 3,
            "Parameters": [
                {
                    "ParameterID": "Warmwassertemperatur"
                }
            ]
        }
    ]
}

List all values which can be updated and retrieved
That will fix the problem mentioned from you in #7 because there is a parameter called IsWriteable where you receive the name of the parameter which can be updated (also with e.g. MinValue and MaxValue).
URL: https://www.wemportal.com/app/EventType/Read
Request: POST
Body:

DeviceID:<0000>
ModuleIndex:1
ModuleType:3

Memory leak

Hey @erikkastelec

I am not 100% sure, but it seems that we have a memory leak. Maybe also due to changes on wemportal.com

image

The last memory reduction was due to a server restart with disabled hass-WEM-Portal plugin. It SEEMS that the memory is not anymore increasing. Will keep an eye on it and give a new information in a couple of hours.

Best,
Dirk

Entity Names are switching

I had the situation a couple of times that the sensor names are switching. I can’t tell when this exactly happens but what happens is that one time the sensor is called sensor.heizkreis_heizkreise_heizkreis_1_aussentemperatur_aktuell_hzk1 And another time the same sensor gets the name sensor.hydraulik_aussentemperatur_aktuell. The other sensor is then getting the state ‚unavailable‘ and is not available. Every time this happens I switch the sensor in my dashboard and it is back working but then suddenly the switch is done again. The same happens with sensor.heizkreis_heizkreise_heizkreis_1_warmwassertemperatur_aktuell and sensor.heizkreis_heizkreise_heizkreis_2_warmwassertemperatur_aktuell

Wrong Data Type of some (string) Sensors

Some Sensors with string values are showing up as float in the the history / charts.
This is the case for e.g.:

wtc-g-betriebsphase_wtc_we0
wtc-g-dreiwegeventil_intern_we0
system-status
hydraulik-betriebsart_hzk0

image

Point for decimals instead of comma

Hey guys,

Floats are split by point in HA and not in comma. We use comma here due to wemportal is using comma. We should convert them before storing.

Best,
Dirk

Unable to install package python-Levenshtein==0.20.*

I'm not shure wether my problem ist correctly addressed here, but everything else works in my home-assistant, operated on raspi.
Since updating HA and WEM-Portal, WEM does not work anymore.

Problem:
Integration error: wemportal - Requirements for wemportal not found: ['python-Levenshtein==0.20.*'].

Log:
Unable to install package python-Levenshtein==0.20.*: error: subprocess-exited-with-error × pip subprocess to install backend dependencies did not run successfully. │ exit code: 1 ╰─> [34 lines of output] Looking in links: https://wheels.home-assistant.io/musllinux/ Collecting cmake Using cached https://wheels.home-assistant.io/musllinux/cmake-3.22.2-cp310-cp310-musllinux_1_2_armv7l.whl (17.8 MB) Collecting ninja Using cached ninja-1.11.1.tar.gz (27 kB) Installing build dependencies: started Installing build dependencies: finished with status 'done' Getting requirements to build wheel: started Getting requirements to build wheel: finished with status 'done' Preparing metadata (pyproject.toml): started Preparing metadata (pyproject.toml): finished with status 'done' Building wheels for collected packages: ninja Building wheel for ninja (pyproject.toml): started Building wheel for ninja (pyproject.toml): finished with status 'error' error: subprocess-exited-with-error × Building wheel for ninja (pyproject.toml) did not run successfully. │ exit code: 1 ╰─> [9 lines of output] Traceback (most recent call last): File "/tmp/pip-build-env-l2xtm6um/overlay/lib/python3.10/site-packages/skbuild/setuptools_wrap.py", line 612, in setup cmkr = cmaker.CMaker(cmake_executable) File "/tmp/pip-build-env-l2xtm6um/overlay/lib/python3.10/site-packages/skbuild/cmaker.py", line 148, in init self.cmake_version = get_cmake_version(self.cmake_executable) File "/tmp/pip-build-env-l2xtm6um/overlay/lib/python3.10/site-packages/skbuild/cmaker.py", line 103, in get_cmake_version raise SKBuildError( Problem with the CMake installation, aborting build. CMake executable is cmake [end of output] note: This error originates from a subprocess, and is likely not a problem with pip. ERROR: Failed building wheel for ninja Failed to build ninja ERROR: Could not build wheels for ninja, which is required to install pyproject.toml-based projects [end of output] note: This error originates from a subprocess, and is likely not a problem with pip. error: subprocess-exited-with-error × pip subprocess to install backend dependencies did not run successfully. │ exit code: 1 ╰─> See above for output. note: This error originates from a subprocess, and is likely not a problem with pip.

I don't know what version it worked lastes, but my SW is updated quiet often .
Versions:
Home Assistant 2022.11.1
Supervisor 2022.10.2
Operating System 9.3
Frontend 20221102.1

HACS 1.28.3

WEM-Portal 1.3.14 (now 1.3.16)

Anything missing?
Any solutions or hints?

Kind regards
Marcus

Which sensors are created?

Hi,

unfortunately I am not able to find any option how I can identify which sensors are created by this integration.
From logs in debug mode I found a list of following.
Never the less I am not sure if these are all or I am missing (just unable to identify because I don't know their name)...
Is there some option to filter for entities created by this integration?

heizkreis-aussentemperatur
heizkreis-at_mittelwert
heizkreis-at_langzeitwert
heizkreis-raumsolltemperatur
heizkreis-vorlaufsolltemperatur
heizkreis-vorlauftemperatur
wärmepumpe-warmwassertemperatur
wärmepumpe-leistungsanforderung
wärmepumpe-solltemperatur
wärmepumpe-schaltdifferenz_dynamisch
wärmepumpe-lwt
wärmepumpe-rücklauftemperatur
wärmepumpe-drehzahl_pumpe
wärmepumpe-volumenstrom
wärmepumpe-stellung_umschaltventil
wärmepumpe-version_wwp-sg
wärmepumpe-version_wwp-cpu
wärmepumpe-soll_frequenz_verdichter
wärmepumpe-ist_frequenz_verdichter
wärmepumpe-luftansaugtemperatur
wärmepumpe-wärmetauscher_ag_eintritt
wärmepumpe-wärmetauscher_ag_mitte
wärmepumpe-druckgas
wärmepumpe-wärmetauscher_innen
wärmepumpe-kältemittel_innen
wärmepumpe-betriebsstd.verdichter
wärmepumpe-schaltspiele_verdichter
wärmepumpe-schaltspiele_abtauen
wärmepumpe-aussengerät_variante
2.wez-status_e-heizung_1
2.wez-status_e-heizung_2
2.wez-betriebsstunden_e1
2.wez-betriebsstunden_e2
2.wez-schaltspiele_e1
2.wez-schaltspiele_e2
statistik-gesamt_energie_tage
statistik-gesamt_energie_monate
statistik-gesamt_energie_jahre
statistik-heizen_energie_tage
statistik-heizen_energie_monat
statistik-heizen_energie_jahre
statistik-ww_energie_tag
statistik-ww_energie_monat
statistik-ww_energie_jahr
statistik-kühlen_energie_tage
statistik-kühlen_energie_monate
statistik-kühlen_energie_jahre

Integration is using deprecated `DEVICE_CLASS_*` constants

This custom integration uses deprecated DEVICE_CLASS_* constants in its codebase.

The DEVICE_CLASS_* constants have been deprecated and replaced in Home Assistant Core 2021.12 (over a year ago). I would highly suggest updating/migrating this integration to the new enums.

For example, for the device classes supported by the sensor platform, there is now a SensorDeviceClass enum. So if a sensor previously used the DEVICE_CLASS_ENERGY constant, it should now use SensorDeviceClass.ENERGY. Other platforms (like binary_sensor, and number) provide similar enumerations for their supported device classes.

The migration thus only consists of replacing constants with an enumeration member and is, therefore, very low impact and should be fairly straightforward.

If I can help resolve any questions regarding this change or migration, feel free to ask or respond to this issue. I'm happy to help!

Kindest regards,

../Frenck

Error during setup of component wemportal

currently not working and wemportal.com is reachable and responding.

Logger: homeassistant.setup
Source: helpers/update_coordinator.py:178
First occurred: 11:02:10 (1 occurrences)
Last logged: 11:02:10

Error during setup of component wemportal
Traceback (most recent call last):
  File "/config/custom_components/wemportal/coordinator.py", line 29, in _async_update_data
    return await self.hass.async_add_executor_job(self.api.fetch_data)
asyncio.exceptions.CancelledError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 205, in _async_refresh
    self.data = await self._async_update_data()
  File "/config/custom_components/wemportal/coordinator.py", line 28, in _async_update_data
    async with async_timeout.timeout(DEFAULT_TIMEOUT):
  File "/usr/local/lib/python3.10/site-packages/async_timeout/__init__.py", line 129, in __aexit__
    self._do_exit(exc_type)
  File "/usr/local/lib/python3.10/site-packages/async_timeout/__init__.py", line 212, in _do_exit
    raise asyncio.TimeoutError
asyncio.exceptions.TimeoutError

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/setup.py", line 235, in _async_setup_component
    result = await task
  File "/config/custom_components/wemportal/__init__.py", line 65, in async_setup
    await coordinator.async_config_entry_first_refresh()
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 178, in async_config_entry_first_refresh
    raise ex
homeassistant.exceptions.ConfigEntryNotReady

Keep session also for web scraping and just use the reload button to minimise requests needed

First of all: Great extension, thanks for maintaining this @erikkastelec !

Currently the documentation suggests to set the crawling interval at most to 15min: https://github.com/erikkastelec/hass-WEM-Portal#configuration

Now there are some values in the web portal, that I would ideally have scraped in 30sec intervals or at least every minute (especially the "Leistungsanforderung" or "Stellung Umschaltventil" value from the web portal).

With an interval like 15min, the graphs in home assistant have a lot of delay (e.g. I notice that the power consumption as reported by the Fronius inverter has gone up a lot because of hot water generation, but the this integration only shows it delayed... sometimes the hot water generation is not recorded at all because it "only took 10min" and it happened between two scans.

So maybe the above can be fairly easily achieved by keeping the web session of the scraper and only press the "reload button" here:
image

problem with getting data from WEM Portal

2023-02-22 16:33:13.482 ERROR (SyncWorker_6) [custom_components.wemportal] There was a problem with getting data from WEM Portal. If this problem persists, open an issue at https://github.com/erikkastelec/hass-WEM-Portal/issues
Traceback (most recent call last):
File "/config/custom_components/wemportal/wemportalapi.py", line 71, in fetch_webscraping_data
self.data = processor.run([wemportal_job])[0]
IndexError: list index out of range
2023-02-22 16:33:17.803 WARNING (MainThread) [homeassistant.helpers.frame] Detected integration that called async_setup_platforms instead of awaiting async_forward_entry_setups; this will fail in version 2023.3. Please report issue to the custom integration author for hacs using this method at custom_components/hacs/init.py, line 171: hass.config_entries.async_setup_platforms(
2023-02-22 16:33:20.448 WARNING (MainThread) [homeassistant.setup] Setup of wemportal is taking over 10 seconds.

Unexpected values for Zirkulationspumpe

Thanks for your great extension!
Basically everything works fine but i get unexpected values for Zirkulationspumpe.
In the wemportal i see either Aus or Ein. So i would expect to get 0 and 1 or Aus and Ein. Both would be fine.
However, what i get is a series of 0 values with short breaks in-between.

Would be nice to get an enhancement here so that the extension gives me 0 and 1.

Bildschirm­foto 2023-04-01 um 19 49 26

Thanks a lot for your efforts!
Robert

Feature request

Hi guys,

thanks for the homeassistant-Addon.

I was wondering if it is possible to trigger things from homeassistant to the heater.

For example to activate the additional pump you can activate to circulate the water so that it is hot at the faucet.

greetings Stephan

Sensors missing after update to 2022.11

Home Assistant 2022.11.1
Supervisor 2022.10.2
Operating System 9.3
Frontend 20221102.1 - latest

This error originated from a custom integration.

Logger: custom_components.wemportal
Source: custom_components/wemportal/wemportalapi.py:71
Integration: Weishaupt WEM Portal (documentation, issues)
First occurred: 3 November 2022 at 23:10:45 (19 occurrences)
Last logged: 08:20:22

There was a problem with getting data from WEM Portal. If this problem persists, open an issue at https://github.com/erikkastelec/hass-WEM-Portal/issues
Traceback (most recent call last):
File "/config/custom_components/wemportal/wemportalapi.py", line 71, in fetch_webscraping_data
self.data = processor.run([wemportal_job])[0]
IndexError: list index out of range

Use generic python module

Hi @erikkastelec,

I want to push my wemportal sensor values to a influxdb for grafana dashboard visualization. As I'm not using Home Assistant, I needed a standalone python module to scrape data from wemportal. So, I created one thanks to your code examples.

It's here (very early state):
https://github.com/floek/wemportal

Maybe it's usefull for the community.

Best,
floek

fix: Add title or placeholder values to setup

With the update to 1.5.x the new way configuration is used. Upon first setup you are greeted with a dialog with two inputs and no
explanation what they are or what values are expected.

This is what the dialog looks like when setting it up.
grafik

I think, especially for new users of the integration, some labels (or placeholder values) for the inputs should be there.

HA Energy Dashboard

Hey guys,

as you already know, HA has introduced the energy dashboard feature and I really like it. What I did so far was, that I created a template sensor in configuration.yaml like this:

  - platform: template
    sensors:
      wtc_g_pc_tageswarmemenge_vortag_gesamt_we0_m3:
        unit_of_measurement: "m³"
        value_template: '{{ states("sensor.wtc_g_pc_tageswarmemenge_vortag_gesamt_we0") | replace(",",".") | float / 10 }}'

so I am using the gas energy used yesterday and transform it to m3 by dividing the value through 10. m3 is needed by the energy dashboard, that is why I am doing that.

then I use the customize.yaml to enable statistics for this new sensor by:

sensor.wtc_g_pc_tageswarmemenge_vortag_gesamt_we0_m3:
  state_class: total_increasing
  icon: mdi:gas-cylinder
  device_class: gas

and then I add this new sensor to the energy dashboard of HA.

The problem I encounter is, that if I restart HA or the hass-WEM-Portal plugin itself runs in failure and gets back online the data is re-requested and thus my custom sensor gets new data and that leads to the situation that the energy dashboard adds the amount AGAIN and that leads to complete wrong data.

so on a perfect day (no HA server restart and no outage of the wemportal) it is correct:
image

but on a day with one or more restarts its a pain:
image
image

Is anyone of you having an idea on how to solve that?

Best,
Dirk

HA log entries

Hi,

my HA log is showing some warnings.

Logger: homeassistant.components.number Source: components/number/__init__.py:251 Integration: Nummer (documentation, issues) First occurred: 12:00:24 (6 occurrences) Last logged: 12:00:24 Entity None (<class 'custom_components.wemportal.number.WemPortalNumber'>) is using deprecated NumberEntity features which will be unsupported from Home Assistant Core 2022.10, please report it to the custom integration author.

Logger: homeassistant.components.number Source: components/number/__init__.py:231 Integration: Nummer (documentation, issues) First occurred: 12:00:24 (1 occurrences) Last logged: 12:00:24 custom_components.wemportal.number::WemPortalNumber is overriding deprecated methods on an instance of NumberEntity, this is not valid and will be unsupported from Home Assistant 2022.10. Please report it to the custom integration author.

Are these known problems and do you know how to fix? Or can I ignore those messages?

Thanks
floppybl

Integration is crashing after 1.5 update

Hi,
the integration keeps crashing for me after the migration to 1.5. I added username/password in the config_flow, but get the following on repeat:

2023-04-26 11:52:30.222 ERROR (MainThread) [custom_components.wemportal] Creating new wemportal api instance
2023-04-26 11:52:30.226 DEBUG (MainThread) [custom_components.wemportal] Finished fetching WemPortal update data in 6.256 seconds (success: False)
2023-04-26 11:52:40.908 DEBUG (SyncWorker_7) [custom_components.wemportal] Fetching api device data
2023-04-26 11:52:41.151 DEBUG (SyncWorker_7) [custom_components.wemportal] Fetching api parameters data
2023-04-26 11:52:45.265 DEBUG (SyncWorker_7) [custom_components.wemportal] Fetching fresh api data
2023-04-26 11:52:45.778 ERROR (MainThread) [custom_components.wemportal] Creating new wemportal api instance

I cleared my config yaml and deleted any old entities (just in case), but no difference.

api_scan_interval = scan_interval

Hello, I just noticed that the "api_scan_interval" runs in the same interval as the "scan_interval". The API is currently queried every 30 minutes but should actually be every 5 minutes.
config

Request: Set WarmWaterTemperature

Hi @erikkastelec,

is it possible to create an input / select option for the warm water temperature?

Best regards
Ingo

This should be the value according to Postman:

"ParameterID": "NormalWW",
"Name": "WW-Soll~temperatur Normal",
"DataType": 3,
"MinValue": 0.0,
"MaxValue": 100.0,
"DefaultValue": "500",
"IsReadable": true,
"IsWriteable": true,
"EnumValues": null

Error after update from 1.3.14 to 1.3.15

Logger: homeassistant.setup
Source: helpers/update_coordinator.py:178
First occurred: 14:08:40 (1 occurrences)
Last logged: 14:08:40

Error during setup of component wemportal
Traceback (most recent call last):
File "/config/custom_components/wemportal/coordinator.py", line 29, in _async_update_data
return await self.hass.async_add_executor_job(self.api.fetch_data)
asyncio.exceptions.CancelledError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 205, in _async_refresh
self.data = await self._async_update_data()
File "/config/custom_components/wemportal/coordinator.py", line 28, in _async_update_data
async with async_timeout.timeout(DEFAULT_TIMEOUT):
File "/usr/local/lib/python3.10/site-packages/async_timeout/init.py", line 129, in aexit
self._do_exit(exc_type)
File "/usr/local/lib/python3.10/site-packages/async_timeout/init.py", line 212, in _do_exit
raise asyncio.TimeoutError
asyncio.exceptions.TimeoutError

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/setup.py", line 235, in _async_setup_component
result = await task
File "/config/custom_components/wemportal/init.py", line 65, in async_setup
await coordinator.async_config_entry_first_refresh()
File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 178, in async_config_entry_first_refresh
raise ex
homeassistant.exceptions.ConfigEntryNotReady

EDIT: Full shutdown and reboot performed and now working, sorry, cant delete it.

"room_setpoint_temperature" is going crazy

Hello, I noticed today that since the last update, the statistics of the "room_setpoint_temperature" entity are going crazy. The value seems to be unreadable every now and then and is set to 0 at this moment. Could it be related to the customization of the "heat_output" entity? Thank you for the effort.

Screenshot_20220424-230107_Home Assistant.jpg

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.