GithubHelp home page GithubHelp logo

dcsbl / ha-homewizard-energy Goto Github PK

View Code? Open in Web Editor NEW
26.0 26.0 3.0 204 KB

The old custom Home Assistant integration for HomeWizard Energy. This integration is now available in Core.

Home Page: https://community.home-assistant.io/t/custom-component-homewizard-energy-wifi-p1-meter-and-kwh-meter/227441

License: Apache License 2.0

Python 100.00%
custom-integration dsmr hacs home-assistant homeassistant homewizard homewizard-energy homewizard-p1-meter p1

ha-homewizard-energy's Introduction

ha-homewizard-energy's People

Contributors

dcsbl avatar ktibow 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

Watchers

 avatar  avatar  avatar  avatar

ha-homewizard-energy's Issues

Add cost information

Is your feature request related to a problem? Please describe.
It would be a nice to have information on how much electricity and gas costs you.

Describe the solution you'd like
A input of T1, T2 & gas costs for both import and export, and having some default costs added as sensors, like "Costs today" or "Costs this month"

Describe alternatives you've considered
Adding this sensor myself based on the data here in HomeAssistant (could do that too, but was wondering if it would be on the roadmap for here)

Changed URL

Not really a bug, but the installation section refers to the wrong github.
Unfortunnately I had to delete the old integration in HACS and add the new url to use it.
Keep up the good work!

Warnings since upgrade HA

Several warnings appear since my upgrade to HA 2022.2.1:
all seam to have to do with the use of ' around properties.

  • Integration version: ? Last (updated, see no release number)
  • Home Assistant version: 2022.2.1
  • Python version (if known): 3.9.7

To Reproduce
Reboot, check logfile

Expected behavior
No warnings

A clear and concise description of what you expected to happen.
No warnings

If applicable, add screenshots to help explain your problem.

Log Output
The warnings:
Detected integration that accessed discovery_info['properties'] instead of discovery_info.properties; this will fail in version 2022.6. Please report issue to the custom component author for homewizard_energy using this method at custom_components/homewizard_energy/config_flow.py, line 135: if "product_name" in discovery_info["properties"]
Detected integration that accessed discovery_info['properties'] instead of discovery_info.properties; this will fail in version 2022.6. Please report issue to the custom component author for homewizard_energy using this method at custom_components/homewizard_energy/config_flow.py, line 138: if "product_type" in discovery_info["properties"]
Detected integration that accessed discovery_info['properties'] instead of discovery_info.properties; this will fail in version 2022.6. Please report issue to the custom component author for homewizard_energy using this method at custom_components/homewizard_energy/config_flow.py, line 137: "product_type": discovery_info["properties"]["product_type"]
Detected integration that accessed discovery_info['properties'] instead of discovery_info.properties; this will fail in version 2022.6. Please report issue to the custom component author for homewizard_energy using this method at custom_components/homewizard_energy/config_flow.py, line 141: if "serial" in discovery_info["properties"]
Detected integration that accessed discovery_info['properties'] instead of discovery_info.properties; this will fail in version 2022.6. Please report issue to the custom component author for homewizard_energy using this method at custom_components/homewizard_energy/config_flow.py, line 140: "serial": discovery_info["properties"]["serial"]
If applicable
To get more output, enable debug output

# configuration.yaml
logger:
  default: info
  logs:
    custom_components.homewizard_energy: debug

Additional context

Add any other context about the problem here.

Integration never starts working when networking is not (completely) ready during the startup/boot of HomeAssistant

Describe the bug

When the network(ing) that is required to reach Energy devices is not fully operational during the start/boot of HASS (but restored later on), the integration never starts properly and all device states will become and stay unavailable.

Environment (please complete the following information)

  • Integration version: 0.10.0
  • Home Assistant version: 2021.10.5
  • Python version (if known): 3.8

To Reproduce

  1. Start home assistant without required network(ing) for Energy devices
  2. Enable networking

Expected behavior
Integration will eventually init correct and Energy device states are updated, etc.

Log Output

2021-11-18 16:13:12 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry EnergySocket ( mysocket ) for homewizard_energy
Traceback (most recent call last):
  File "/snap/home-assistant-snap/x2/lib/python3.8/site-packages/aiohttp/connector.py", line 969, in _wrap_create_connection
    return await self._loop.create_connection(*args, **kwargs)  # type: ignore  # noqa
  File "/usr/lib/python3.8/asyncio/base_events.py", line 1025, in create_connection
    raise exceptions[0]
  File "/usr/lib/python3.8/asyncio/base_events.py", line 1010, in create_connection
    sock = await self._connect_sock(
  File "/usr/lib/python3.8/asyncio/base_events.py", line 924, in _connect_sock
    await self.sock_connect(sock, address)
  File "/usr/lib/python3.8/asyncio/selector_events.py", line 496, in sock_connect
    return await fut
  File "/usr/lib/python3.8/asyncio/selector_events.py", line 528, in _sock_connect_cb
    raise OSError(err, f'Connect call failed {address}')
OSError: [Errno 113] Connect call failed ('192.168.2.40', 80)

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

Traceback (most recent call last):
  File "/var/snap/home-assistant-snap/x2/custom_components/homewizard_energy/__init__.py", line 143, in async_setup_entry
    await energy_api.initialize()
  File "/root/snap/home-assistant-snap/x2/.local/lib/python3.8/site-packages/aiohwenergy/hwenergy.py", line 48, in initialize
    status = await self.device.update()
  File "/root/snap/home-assistant-snap/x2/.local/lib/python3.8/site-packages/aiohwenergy/device.py", line 67, in update
    status, response = await self._request("get", "api")
  File "/root/snap/home-assistant-snap/x2/.local/lib/python3.8/site-packages/aiohwenergy/hwenergy.py", line 111, in request
    async with self._clientsession.request(
  File "/snap/home-assistant-snap/x2/lib/python3.8/site-packages/aiohttp/client.py", line 1117, in __aenter__
    self._resp = await self._coro
  File "/snap/home-assistant-snap/x2/lib/python3.8/site-packages/aiohttp/client.py", line 520, in _request
    conn = await self._connector.connect(
  File "/snap/home-assistant-snap/x2/lib/python3.8/site-packages/aiohttp/connector.py", line 535, in connect
    proto = await self._create_connection(req, traces, timeout)
  File "/snap/home-assistant-snap/x2/lib/python3.8/site-packages/aiohttp/connector.py", line 892, in _create_connection
    _, proto = await self._create_direct_connection(req, traces, timeout)
  File "/snap/home-assistant-snap/x2/lib/python3.8/site-packages/aiohttp/connector.py", line 1051, in _create_direct_connection
    raise last_exc
  File "/snap/home-assistant-snap/x2/lib/python3.8/site-packages/aiohttp/connector.py", line 1020, in _create_direct_connection
    transp, proto = await self._wrap_create_connection(
  File "/snap/home-assistant-snap/x2/lib/python3.8/site-packages/aiohttp/connector.py", line 975, in _wrap_create_connection
    raise client_error(req.connection_key, exc) from exc
aiohttp.client_exceptions.ClientConnectorError: Cannot connect to host 192.168.2.40:80 ssl:default [Connect call failed ('192.168.2.40', 80)]

Warning: Data Migration from the HACS version to the Core version - Not possible today

Hi,

Since a lot of us like to have the history about our energy usage, especially in these times of very expensive energy, there must be a way to migrate data from the new domain created for Core from the older domain in HACS. Losing the data, means we lose insight on how we are doing compared to previous weeks and months.

For now, I am using the new homewizard integration which works fine with slight differences. If you don't delete the "obsolete" entities (HACS integration) you can still graph those and use the data, although the energy config will complain about them (missing entities) missing in the active domain.

It's workable (apart from the time the entities were double counting, due to the fact that I had both running).

I would suggest that the focus should be on migration. there must be a way to migrate old data in the database from the old domain to the new. (Maybe ask Frenck for some ideas on that)

It's a bummer like this.

To leave this message on a high note, I do appreciate all the hard work and effort and it made it into core. lucky people who start to work with it from today or don't care about history.

All the best.

Don't find the integration

I follow the instructions but the first step of "Usage" doesn't show the integration.
Tried to reboot several times and remove and add the repository and still don't appear.
I can see the folder in the custom components with Samba.

Thank you

Entity names

Is your feature request related to a problem? Please describe.
The entities for import and export are named with power.

Describe the solution you'd like
Match the entity names with the unit of measurements and therefore an proposal to replace the word power for energy as power (Watt) and energy (kWh) are 2 different things.

Core and custom integration can't be used at the same time

Describe the bug
If you run the custom and core version at the same time you get a message like:

Logger: homeassistant.config_entries
Source: components/homewizard/coordinator.py:34
First occurred: 11:28:23 (2 occurrences)
Last logged: 11:30:45

Error setting up entry P1 meter (**REDACTED**) for homewizard
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/config_entries.py", line 327, in async_setup
result = await component.async_setup_entry(hass, self)
File "/usr/src/homeassistant/homeassistant/components/homewizard/init.py", line 24, in async_setup_entry
coordinator = Coordinator(hass, entry.data[CONF_IP_ADDRESS])
File "/usr/src/homeassistant/homeassistant/components/homewizard/coordinator.py", line 34, in init
self.api = aiohwenergy.HomeWizardEnergy(host, clientsession=session)
TypeError: init() got an unexpected keyword argument 'clientsession'

Expected behavior

As I want you to be able to run both systems at the same time while migrating, I will try to fix this.

How to use values in home assistant automation?

Hi everyone,

I'm trying to create an automation that turns on a light when my active power is below a certain threshold.

In the GUI of HA:

TRIGGERS

2022-01-17_16-39-31

CONDITIONS

2022-01-17_16-40-16

ACTIONS

2022-01-17_16-40-45

However, this seems not to work. I checked the values, i.e.:
2022-01-17_17-42-19

PS.
In YAML, the automation became

2022-01-17_17-45-09


- id: '1642434242283'
  alias: SchakelAlsVerbruikOnderGrens
  description: SchakelAlsVerbruikOnderGrens
  trigger:
  - platform: numeric_state
    entity_id: sensor.p1_meter_active_power_l1
    id: sensor.p1_meter_active_power_l1_250W
    attribute: unit_of_measurement
    below: '325'
  condition: []
  action:
  - type: toggle
    device_id: 829993eca56b2896acc3b9851fec86f7
    entity_id: light.my_n00_p03_light_l19_hanglamp
    domain: light
  mode: single

What am I doing wrong?

Any help is appreciated,
kind regards,
Bart Plessers

Custom Component losing connection to the P1 Meter

The Home Assistant log has errors in the log of the form:

Error requesting p1 meter data: Cannot connect to host 192.168.178.143:80 ssl:default [Connect call failed ('192.168.178.143', 80)]

These errors started being reported on the 29th January, but they may have been there earlier. We had a powercut that day, and so the logging could have started from scratch again.

The log summary states:

Logger: custom_components.homewizard_energy.sensor
Source: helpers/update_coordinator.py:153
Integration: HomeWizard Energy ([documentation](https://github.com/Unsigus/hass-homewizard-energy), [issues](https://github.com/Unsigus/hass-homewizard-energy/issues))
First occurred: 29 January 2021, 9:50:18 (89 occurrences)
Last logged: 11:30:25
Error requesting p1 meter data: Cannot connect to host 192.168.178.143:80 ssl:default [Connect call failed ('192.168.178.143', 80)]

They seem to be fairly random failures, perhaps 2 or 3 times per hour. Is this something to be looked at, or just ignore? Thanks.

The HomeWizard Energy app itself seems to be functioning as normal.

System Health

version 2021.1.5
installation_type Home Assistant OS
dev false
hassio true
docker true
virtualenv false
python_version 3.8.7
os_name Linux
os_version 5.4.79-v8
arch aarch64
timezone Europe/Amsterdam
Home Assistant Community Store
GitHub API ok
Github API Calls Remaining 4950
Installed Version 1.10.1
Stage running
Available Repositories 773
Installed Repositories 12
Home Assistant Cloud
logged_in false
can_reach_cert_server ok
can_reach_cloud_auth ok
can_reach_cloud ok
Home Assistant Supervisor
host_os Home Assistant OS 5.10
update_channel stable
supervisor_version 2021.01.7
docker_version 19.03.13
disk_total 109.3 GB
disk_used 10.3 GB
healthy true
supported true
board rpi4-64
supervisor_api ok
version_api ok
installed_addons File editor (5.2.0), Samba share (9.3.0), Mosquitto broker (5.1), OpenZWave (0.9.0), Node-RED (8.0.1), InfluxDB (4.0.1), Terminal & SSH (8.10.0), Grafana (6.0.0)
Lovelace
dashboards 2
mode auto-gen
resources 8

HomeWizard Energy is now available in Core

'HomeWizard Energy' is part of Home Assistant core since 2022.2. This custom integration won't be maintained from now on.

Migrate data and configuration to core
Install Home Assistant 2022.2.2 or later and 0.13.0 or later. Migration will happen automatically. After that you can remove the custom integration.

Installatie probleem; 'type' object is not subscriptable

In Home Assistant komen na de instalaltie van 0.8.2 de sensor niet meer 'up'. Als foutmelding krijg ik:

Logger: homeassistant.config_entries
Source: custom_components/homewizard_energy/sensor.py:61
Integration: Homewizard Energy (documentation, issues)
First occurred: 7:53:06 (1 occurrences)
Last logged: 7:53:06

Error setting up entry P1 meter for sensor
Traceback (most recent call last):
  File "/srv/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 "/srv/homeassistant/lib/python3.8/site-packages/homeassistant/components/sensor/__init__.py", line 90, in async_setup_entry
    return await component.async_setup_entry(entry)
  File "/srv/homeassistant/lib/python3.8/site-packages/homeassistant/helpers/entity_component.py", line 149, in async_setup_entry
    platform = await async_prepare_setup_platform(
  File "/srv/homeassistant/lib/python3.8/site-packages/homeassistant/setup.py", line 329, in async_prepare_setup_platform
    platform = integration.get_platform(domain)
  File "/srv/homeassistant/lib/python3.8/site-packages/homeassistant/loader.py", line 498, in get_platform
    cache[full_name] = self._import_platform(platform_name)
  File "/srv/homeassistant/lib/python3.8/site-packages/homeassistant/loader.py", line 503, in _import_platform
    return importlib.import_module(f"{self.pkg_path}.{platform_name}")
  File "/usr/local/lib/python3.8/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
  File "<frozen importlib._bootstrap>", line 991, in _find_and_load
  File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 783, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/home/homeassistant/.homeassistant/custom_components/homewizard_energy/sensor.py", line 61, in <module>
    SENSORS: Final[list[SensorEntityDescription]] = [
TypeError: 'type' object is not subscriptable

Verscheidene herstarts gedaan na installatie; geen effect.

  • Integration version: 0.8.2
  • Home Assistant version: 2021.8.2 en ook in 2021.8.3

Sensor for total kWh use

Is your feature request related to a problem? Please describe.
In Home Assistant release 2021.8.0 the new energy dashboard was added. The dashboard asks for a entity that has the total power use as a value.

Describe the solution you'd like
I would like a sensor entity that adds sensor.p1_meter_total_power_import_t1 and sensor.p1_meter_total_power_import_t2 for a total power usage sensor.

Describe alternatives you've considered
I added a template sensor and added the 2 using jinja templating. It works for the value but the sensor can not be used in the energy dashboard.

Integration can't connect or add entities

I get the following error (see below)
I had to readd my P1 meter because I changed my wifi. I can only add it through the auto discovery, can't add it through manual way. It works fine on the Energy app. I also get the reply from the Api check..

Logger: homeassistant.components.sensor
Source: custom_components/homewizard_energy/sensor.py:136
Integration: Sensor (documentation, issues)
First occurred: 20:09:46 (2 occurrences)
Last logged: 20:09:51

Error while setting up homewizard_energy platform for sensor
Traceback (most recent call last):
File "/config/custom_components/homewizard_energy/sensor.py", line 128, in async_setup_entry
await energy_api.initialize()
File "/usr/local/lib/python3.8/site-packages/aiohwenergy/hwenergy.py", line 50, in initialize
await self.update()
File "/usr/local/lib/python3.8/site-packages/aiohwenergy/hwenergy.py", line 54, in update
status, response = await self.request('get', 'api')
File "/usr/local/lib/python3.8/site-packages/aiohwenergy/hwenergy.py", line 96, in request
raise RequestError(
aiohwenergy.errors.RequestError: Error requesting data from 192.168.0.81: Connector is closed.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 250, in _async_setup_platform
await asyncio.shield(task)
File "/config/custom_components/homewizard_energy/sensor.py", line 136, in async_setup_entry
raise ConfigEntryNotReady
homeassistant.exceptions.ConfigEntryNotReady: None

Error while loading the module - but it works..

021-04-19 13:29:33 stdout ModuleNotFoundError: No module named 'custom_components.homewizard_energy_p1.system_health'�[0m
2021-04-19 13:29:33 stdout File "", line 973, in _find_and_load_unlocked
2021-04-19 13:29:33 stdout File "", line 991, in _find_and_load
2021-04-19 13:29:33 stdout File "", line 1014, in _gcd_import
2021-04-19 13:29:33 stdout return _bootstrap._gcd_import(name[level:], package, level)
2021-04-19 13:29:33 stdout File "/usr/local/lib/python3.8/importlib/init.py", line 127, in import_module
2021-04-19 13:29:33 stdout return importlib.import_module(f"{self.pkg_path}.{platform_name}")
2021-04-19 13:29:33 stdout File "/usr/src/homeassistant/homeassistant/loader.py", line 490, in _import_platform
2021-04-19 13:29:33 stdout cache[full_name] = self._import_platform(platform_name)
2021-04-19 13:29:33 stdout File "/usr/src/homeassistant/homeassistant/loader.py", line 485, in get_platform
2021-04-19 13:29:33 stdout platform = integration.get_platform(platform_name)
2021-04-19 13:29:33 stdout File "/usr/src/homeassistant/homeassistant/helpers/integration_platform.py", line 30, in _process
2021-04-19 13:29:33 stdout Traceback (most recent call last):
2021-04-19 13:29:33 stdout �[31m2021-04-19 15:29:32 ERROR (MainThread) [homeassistant.helpers.integration_platform] Unexpected error importing homewizard_energy/system_health.py
2021-04-19 13:29:33 stdout ModuleNotFoundError: No module named 'custom_components.homewizard_energy_p1.logbook'�[0m
2021-04-19 13:29:33 stdout File "", line 973, in _find_and_load_unlocked
2021-04-19 13:29:33 stdout File "", line 991, in _find_and_load
2021-04-19 13:29:33 stdout File "", line 1014, in _gcd_import
2021-04-19 13:29:33 stdout return _bootstrap._gcd_import(name[level:], package, level)
2021-04-19 13:29:33 stdout File "/usr/local/lib/python3.8/importlib/init.py", line 127, in import_module
2021-04-19 13:29:33 stdout return importlib.import_module(f"{self.pkg_path}.{platform_name}")
2021-04-19 13:29:33 stdout File "/usr/src/homeassistant/homeassistant/loader.py", line 490, in _import_platform
2021-04-19 13:29:33 stdout cache[full_name] = self._import_platform(platform_name)
2021-04-19 13:29:33 stdout File "/usr/src/homeassistant/homeassistant/loader.py", line 485, in get_platform
2021-04-19 13:29:33 stdout platform = integration.get_platform(platform_name)
2021-04-19 13:29:33 stdout File "/usr/src/homeassistant/homeassistant/helpers/integration_platform.py", line 30, in _process
2021-04-19 13:29:33 stdout Traceback (most recent call last):
2021-04-19 13:29:33 stdout �[31m2021-04-19 15:29:32 ERROR (MainThread) [homeassistant.helpers.integration_platform] Unexpected error importing homewizard_energy/logbook.py
2021-04-19 13:29:33 stdout ModuleNotFoundError: No module named 'custom_components.homewizard_energy_p1.group'�[0m
2021-04-19 13:29:33 stdout File "", line 973, in _find_and_load_unlocked
2021-04-19 13:29:33 stdout File "", line 991, in _find_and_load
2021-04-19 13:29:33 stdout File "", line 1014, in _gcd_import
2021-04-19 13:29:33 stdout return _bootstrap._gcd_import(name[level:], package, level)
2021-04-19 13:29:33 stdout File "/usr/local/lib/python3.8/importlib/init.py", line 127, in import_module
2021-04-19 13:29:33 stdout return importlib.import_module(f"{self.pkg_path}.{platform_name}")
2021-04-19 13:29:33 stdout File "/usr/src/homeassistant/homeassistant/loader.py", line 490, in _import_platform
2021-04-19 13:29:33 stdout cache[full_name] = self._import_platform(platform_name)
2021-04-19 13:29:33 stdout File "/usr/src/homeassistant/homeassistant/loader.py", line 485, in get_platform
2021-04-19 13:29:33 stdout platform = integration.get_platform(platform_name)
2021-04-19 13:29:33 stdout File "/usr/src/homeassistant/homeassistant/helpers/integration_platform.py", line 30, in _process
2021-04-19 13:29:33 stdout Traceback (most recent call last):
2021-04-19 13:29:33 stdout �[31m2021-04-19 15:29:32 ERROR (MainThread) [homeassistant.helpers.integration_platform] Unexpected error importing homewizard_energy/group.py
2021-04-19 13:29:33 stdout ModuleNotFoundError: No module named 'custom_components.homewizard_energy_p1.media_source'�[0m
2021-04-19 13:29:33 stdout File "", line 973, in _find_and_load_unlocked
2021-04-19 13:29:33 stdout File "", line 991, in _find_and_load
2021-04-19 13:29:33 stdout File "", line 1014, in _gcd_import
2021-04-19 13:29:33 stdout return _bootstrap._gcd_import(name[level:], package, level)
2021-04-19 13:29:33 stdout File "/usr/local/lib/python3.8/importlib/init.py", line 127, in import_module
2021-04-19 13:29:33 stdout return importlib.import_module(f"{self.pkg_path}.{platform_name}")
2021-04-19 13:29:33 stdout File "/usr/src/homeassistant/homeassistant/loader.py", line 490, in _import_platform
2021-04-19 13:29:33 stdout cache[full_name] = self._import_platform(platform_name)
2021-04-19 13:29:33 stdout File "/usr/src/homeassistant/homeassistant/loader.py", line 485, in get_platform
2021-04-19 13:29:33 stdout platform = integration.get_platform(platform_name)
2021-04-19 13:29:33 stdout File "/usr/src/homeassistant/homeassistant/helpers/integration_platform.py", line 30, in _process
2021-04-19 13:29:33 stdout Traceback (most recent call last):
2021-04-19 13:29:32 stdout �[31m2021-04-19 15:29:32 ERROR (MainThread) [homeassistant.helpers.integration_platform] Unexpected error importing homewizard_energy/media_source.py

Manual configuration in HomeAssistant -> integration not found

Describe the bug
After installing via HACS and restarting the server, I navigate to Configuration > Integrations > Add integration (cfr. manual). However, I don't have a HomeWizard Energy integration to choose from.

A clear and concise description of what the bug is.
The integration is not found and can't be added manually after installing it from HACS and restarting Home Assistant.

Environment (please complete the following information)

  • Integration version: 0.12.1
  • Home Assistant version: core-2021.12.9
  • Python version (if known): 3.9.5
  • HACS version: 1.19.3

Screenshots

image
image

Additional context
There is a WiFi socket on the network, on a separate subnet. Local API is on. I get continuous readings via the HomeWizard Energy app (on an android device).

Can't get any data.

Describe the bug

A clear and concise description of what the bug is.
After installing I can't get any data

Environment (please complete the following information)

Synology NAS 918 DSM7

  • Integration version: 0.10.0
  • Home Assistant version: Home Assistant 0.118.5
  • Python version (if known): 2.7.18-1004

To Reproduce

Eg. Steps to reproduce the behavior:
Installation went well, but nothing to select.

Expected behavior

Energy reports and entities in HA.

Screenshots

evt

Log Output

Logboekdetails (ERROR)

Logger: homeassistant.config_entries
Source: custom_components/homewizard_energy/init.py:172
First occurred: 17:57:28 (2 occurrences)
Last logged: 18:05:01

Error setting up entry P1 meter for homewizard_energy
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/config_entries.py", line 236, in async_setup
result = await component.async_setup_entry(hass, self) # type: ignore
File "/config/custom_components/homewizard_energy/init.py", line 172, in async_setup_entry
await coordinator.async_config_entry_first_refresh()
AttributeError: 'HWEnergyDeviceUpdateCoordinator' object has no attribute 'async_config_entry_first_refresh'

Additional context

Nieuwe tussenstukken api

Is your feature request related to a problem? Please describe.
No

Describe the solution you'd like
Er is een nieuwe tussenstekker aangekondigd.
Wordt deze in de toekomst ook ondersteund?

Integration no longer working “ AttributeError: module 'aiohwenergy' has no attribute 'AioHwEnergyException'”

Describe the bug

Integration suddenly stopped working, with the error “AttributeError: module 'aiohwenergy' has no attribute 'AioHwEnergyException'”

Environment (please complete the following information)

  • Integration version: 0.10.0
  • Home Assistant version: 2021.9.6

To Reproduce

  1. Go to 'Integrations'
  2. HomeWizard is automatically discovered
  3. Setup integration
  4. See error

Expected behavior

Entities to be loaded in and working

Screenshots

063F350C-0B9D-441F-A031-8B4879ADF581

Log Output

Traceback (most recent call last):
  File "/config/custom_components/homewizard_energy/config_flow.py", line 48, in async_step_user
    await energy_api.initialize()
  File "/usr/local/lib/python3.9/site-packages/aiohwenergy/hwenergy.py", line 48, in initialize
    status = await self.device.update()
  File "/usr/local/lib/python3.9/site-packages/aiohwenergy/device.py", line 67, in update
    status, response = await self._request("get", "api")
  File "/usr/local/lib/python3.9/site-packages/aiohwenergy/hwenergy.py", line 111, in request
    async with self._clientsession.request(
  File "/usr/local/lib/python3.9/site-packages/aiohttp/client.py", line 1117, in __aenter__
    self._resp = await self._coro
  File "/usr/local/lib/python3.9/site-packages/aiohttp/client.py", line 544, in _request
    await resp.start(conn)
  File "/usr/local/lib/python3.9/site-packages/aiohttp/client_reqrep.py", line 890, in start
    message, payload = await self._protocol.read()  # type: ignore
  File "/usr/local/lib/python3.9/site-packages/aiohttp/streams.py", line 604, in read
    await self._waiter
aiohttp.client_exceptions.ServerDisconnectedError: Server disconnected

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/aiohttp/web_protocol.py", line 422, in _handle_request
    resp = await self._request_handler(request)
  File "/usr/local/lib/python3.9/site-packages/aiohttp/web_app.py", line 499, in _handle
    resp = await handler(request)
  File "/usr/local/lib/python3.9/site-packages/aiohttp/web_middlewares.py", line 119, in impl
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/security_filter.py", line 60, in security_filter_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/forwarded.py", line 89, in forwarded_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/request_context.py", line 24, in request_context_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/ban.py", line 78, in ban_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 144, in auth_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/view.py", line 135, in handle
    result = await result
  File "/usr/src/homeassistant/homeassistant/components/config/config_entries.py", line 155, in post
    return await super().post(request, flow_id)
  File "/usr/src/homeassistant/homeassistant/components/http/data_validator.py", line 63, in wrapper
    result = await method(view, request, *args, **kwargs)
  File "/usr/src/homeassistant/homeassistant/helpers/data_entry_flow.py", line 109, in post
    result = await self._flow_mgr.async_configure(flow_id, data)
  File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 202, in async_configure
    result = await self._async_handle_step(flow, cur_step["step_id"], user_input)
  File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 260, in _async_handle_step
    result: FlowResult = await getattr(flow, method)(user_input)
  File "/config/custom_components/homewizard_energy/config_flow.py", line 58, in async_step_user
    except aiohwenergy.AioHwEnergyException:
AttributeError: module 'aiohwenergy' has no attribute 'AioHwEnergyException'

Additional context

P1 is working fine in the app and shows it’s connected and displays new data

Integration aborted

Integratie toevoegen geeft de melding 'afgebroken' na het invoeren van de juiste IP.

  • Integration version: 12.1 (ook 11.0 geprobeerd)
  • Home Assistant version: 2021.12.7
  • Python version (if known): 3.9.7

Eg. Steps to reproduce the behavior:

  1. Go to 'instellingen'
  2. Click on 'add'
  3. Scroll down to 'Home Wizard Energy'
  4. See error Afgebroken

Integratie heeft maandenlang probleemloos gewerkt tot de entiteiten niet meer beschikbaar waren. Geprobeerd om de integratie opnieuw te installeren maar zonder resultaat. Uiteraard herstart ik HA na zulke acties.
http://192.168.2.25/api/v1/data geeft de juiste data weer en in de app ook.

Wat ik raar vind, is dat als ik via hacs de integratie verwijder en HA opnieuw opstart, ik nog steeds bij integraties kan zoeken naar Home wizard energy. Bij het verwijderen via hacs krijg ik ook de melding: De HomeWizard Energy -integratie is geconfigureerd, u moet de configuratie verwijderen voordat u deze uit HACS verwijdert.
Terwijl Home wizard niet meer tussen mijn lijst met ingestelde integraties staat.

Wat gaat hier niet goed? Hopelijk kan je helpen, want ik krijg de integratie niet meer werkend helaas.

HACS shows this integration always as 'New repository', even when dismissed

Describe the bug
In the HACS configuration page (<hass-url>/hacs/integrations), a user who have not installed HomeWizard Energy always sees this integration als 'New repository'

This is most likely caused when this repository is transferred from unsigus/hass-homewizard-energy to DCSBL/ha-homewizard-energy within GitHub. The URL is automatically redirected, but HACS does not handle it well.

This issue is reported (hacs/integration#1797), but is also should be fixed when the URL is updated in HACS/default (PR pending: hacs/default#765)

Missing icons

See attachments for missing icons:

image
image

Great that there is a start of a new plugin for Home Assistant,

Integration icon missing

Describe the bug
The integration does not show the brand icon anymore (unless it still is in cache).

This is due to the migration of this component to Home Assistant Core (🤫). So this won't be fixed.

Component is performing I/O inside event loop

The HASS log says:

Detected I/O inside the event loop. This is causing stability issues. Please report issue to the custom component author for homewizard_energy doing I/O at custom_components/homewizard_energy/api.py, line 79: response = requests.get(api_url, data=json.dumps(payload), verify=False)

Opening this as a issue so users will see this is a known issue

Error while starting up Home Assistant

Describe the bug
021-04-19 13:29:33 stdout ModuleNotFoundError: No module named 'custom_components.homewizard_energy_p1.system_health'�[0m
2021-04-19 13:29:33 stdout File "", line 973, in _find_and_load_unlocked
2021-04-19 13:29:33 stdout File "", line 991, in _find_and_load
2021-04-19 13:29:33 stdout File "", line 1014, in _gcd_import
2021-04-19 13:29:33 stdout return _bootstrap._gcd_import(name[level:], package, level)
2021-04-19 13:29:33 stdout File "/usr/local/lib/python3.8/importlib/init.py", line 127, in import_module
2021-04-19 13:29:33 stdout return importlib.import_module(f"{self.pkg_path}.{platform_name}")
2021-04-19 13:29:33 stdout File "/usr/src/homeassistant/homeassistant/loader.py", line 490, in _import_platform
2021-04-19 13:29:33 stdout cache[full_name] = self._import_platform(platform_name)
2021-04-19 13:29:33 stdout File "/usr/src/homeassistant/homeassistant/loader.py", line 485, in get_platform
2021-04-19 13:29:33 stdout platform = integration.get_platform(platform_name)
2021-04-19 13:29:33 stdout File "/usr/src/homeassistant/homeassistant/helpers/integration_platform.py", line 30, in _process
2021-04-19 13:29:33 stdout Traceback (most recent call last):
2021-04-19 13:29:33 stdout �[31m2021-04-19 15:29:32 ERROR (MainThread) [homeassistant.helpers.integration_platform] Unexpected error importing homewizard_energy/system_health.py
2021-04-19 13:29:33 stdout ModuleNotFoundError: No module named 'custom_components.homewizard_energy_p1.logbook'�[0m
2021-04-19 13:29:33 stdout File "", line 973, in _find_and_load_unlocked
2021-04-19 13:29:33 stdout File "", line 991, in _find_and_load
2021-04-19 13:29:33 stdout File "", line 1014, in _gcd_import
2021-04-19 13:29:33 stdout return _bootstrap._gcd_import(name[level:], package, level)
2021-04-19 13:29:33 stdout File "/usr/local/lib/python3.8/importlib/init.py", line 127, in import_module
2021-04-19 13:29:33 stdout return importlib.import_module(f"{self.pkg_path}.{platform_name}")
2021-04-19 13:29:33 stdout File "/usr/src/homeassistant/homeassistant/loader.py", line 490, in _import_platform
2021-04-19 13:29:33 stdout cache[full_name] = self._import_platform(platform_name)
2021-04-19 13:29:33 stdout File "/usr/src/homeassistant/homeassistant/loader.py", line 485, in get_platform
2021-04-19 13:29:33 stdout platform = integration.get_platform(platform_name)
2021-04-19 13:29:33 stdout File "/usr/src/homeassistant/homeassistant/helpers/integration_platform.py", line 30, in _process
2021-04-19 13:29:33 stdout Traceback (most recent call last):
2021-04-19 13:29:33 stdout �[31m2021-04-19 15:29:32 ERROR (MainThread) [homeassistant.helpers.integration_platform] Unexpected error importing homewizard_energy/logbook.py
2021-04-19 13:29:33 stdout ModuleNotFoundError: No module named 'custom_components.homewizard_energy_p1.group'�[0m
2021-04-19 13:29:33 stdout File "", line 973, in _find_and_load_unlocked
2021-04-19 13:29:33 stdout File "", line 991, in _find_and_load
2021-04-19 13:29:33 stdout File "", line 1014, in _gcd_import
2021-04-19 13:29:33 stdout return _bootstrap._gcd_import(name[level:], package, level)
2021-04-19 13:29:33 stdout File "/usr/local/lib/python3.8/importlib/init.py", line 127, in import_module
2021-04-19 13:29:33 stdout return importlib.import_module(f"{self.pkg_path}.{platform_name}")
2021-04-19 13:29:33 stdout File "/usr/src/homeassistant/homeassistant/loader.py", line 490, in _import_platform
2021-04-19 13:29:33 stdout cache[full_name] = self._import_platform(platform_name)
2021-04-19 13:29:33 stdout File "/usr/src/homeassistant/homeassistant/loader.py", line 485, in get_platform
2021-04-19 13:29:33 stdout platform = integration.get_platform(platform_name)
2021-04-19 13:29:33 stdout File "/usr/src/homeassistant/homeassistant/helpers/integration_platform.py", line 30, in _process
2021-04-19 13:29:33 stdout Traceback (most recent call last):
2021-04-19 13:29:33 stdout �[31m2021-04-19 15:29:32 ERROR (MainThread) [homeassistant.helpers.integration_platform] Unexpected error importing homewizard_energy/group.py
2021-04-19 13:29:33 stdout ModuleNotFoundError: No module named 'custom_components.homewizard_energy_p1.media_source'�[0m
2021-04-19 13:29:33 stdout File "", line 973, in _find_and_load_unlocked
2021-04-19 13:29:33 stdout File "", line 991, in _find_and_load
2021-04-19 13:29:33 stdout File "", line 1014, in _gcd_import
2021-04-19 13:29:33 stdout return _bootstrap._gcd_import(name[level:], package, level)
2021-04-19 13:29:33 stdout File "/usr/local/lib/python3.8/importlib/init.py", line 127, in import_module
2021-04-19 13:29:33 stdout return importlib.import_module(f"{self.pkg_path}.{platform_name}")
2021-04-19 13:29:33 stdout File "/usr/src/homeassistant/homeassistant/loader.py", line 490, in _import_platform
2021-04-19 13:29:33 stdout cache[full_name] = self._import_platform(platform_name)
2021-04-19 13:29:33 stdout File "/usr/src/homeassistant/homeassistant/loader.py", line 485, in get_platform
2021-04-19 13:29:33 stdout platform = integration.get_platform(platform_name)
2021-04-19 13:29:33 stdout File "/usr/src/homeassistant/homeassistant/helpers/integration_platform.py", line 30, in _process
2021-04-19 13:29:33 stdout Traceback (most recent call last):
2021-04-19 13:29:32 stdout �[31m2021-04-19 15:29:32 ERROR (MainThread) [homeassistant.helpers.integration_platform] Unexpected error importing homewizard_energy/media_source.py

To Reproduce
Steps to reproduce the behavior:
Just installed the custom module and started up home assistant. Error pops-up in the home assistant log but the integration works..

Environment (please complete the following information):

  • Integration version: latest on github
  • Home Assistant version: latest docker container 2021.4.4?

HomeWizard device is rediscoverd after installing Home Assistant 2022.2.0b0

My HomeWizard Energy plug is rediscoverd after installing Home Assistant 2022.2.0b0. It was working fine in the last non-beta version (2021.12.10).

Environment (please complete the following information)

  • Integration version: 0.12.1
  • Home Assistant version: 2022.2.0b0 supervised
  • Python version (if known): unknown to me

To Reproduce

  1. Upgrade from your current Home Assistant version to version Home Assistant 2022.2.0b0
  2. Click on 'Notifications': the notification is mentioned here

Expected behavior

Since my HomeWizard Energy Plug is already integrated, i am expecting no notification at all about HomeWizard Energy.

Screenshots

image
image
It's already installed and my Energy Plug is just working fine.
image

Log Output

Additional context

Add any other context about the problem here.

P1 meter configuratie mislukt

Vandaag kwam ik tot de conclusie dat ik de entiteiten van de P1 meter niet meer zag in HA. Gisteren heb ik HA geüpdate naar de laatste versie, alles werkte maar in de loop van de nacht is hij dus gestopt. Ik heb daarjuist de integratie eens verwijderd en terug toegevoegd maar hij blijft op 'Instellen mislukt' staan. De HomeWizard app werkt nog dus de P1 meter zelf werkt nog zonder problemen.

Hoe zet ik debug aan? Ik heb homeassistant.components.homewizard: debug geprobeerd in mijn configuration file maar dat doet niets.

High spike in Gas consumption

Screenshot_20210428_103751
Describe the bug
I have a P1 connected to the digital meter, and this integration installed for Home Assistant.

A few days ago I observed a huge spike (a sudden ±1800 m^3 consumption) in the gas consumption collected by P1, both seen in Home Assistant, and the HomeWizard companion app on the smart phone.

This spike totally ruined the historical data (using utility component) of the consumptions and calculated costs, as expected. However, in HomeWizard app, the daily consumption and its cost look normal (i.e. that spike was not taken into account).

Do you know why that spike was present? And since the historical data in HA is now corrupted due to the wrong data, is there a way to correct/reset them?

Limited API Call when installing HACS. Therefore unable to pull HomeWizard

Hello,

I am becoming a fan of the homewizard products but would like them to be integrated in HA.
Following your recommended option to download the integration via HACS I stubled upon the problem that HACS can't pull anything from GITHUB because of the call limitation. I have an authenticated (with token) account on github.

Error (in dutch, I'm from belgium): HACS is uitgeschakeld - Ratelimiet
GitHub API calls zijn gelimiteerd, dit zal over een uur weg zijn.

This is probably not a homewizard problem but since this is your prefered method of installation. You are probably aware of this.
Could you point me in the right direction to get this solved or should I focus on the manual install?

Regards,
Sami

Two errors after updating to HA core 2021.12.0

After upgrading to Home Assistant 2021.12.0 I'm getting two errors in the HA log.

A clear and concise description of what the bug is.

Made this report from my phone, so excuses if not filled in properly.
Was upgrading from latest November Core build. Using 0.12.0 version of the HW integration.

Environment (please complete the following information)

  • Integration version:
  • Home Assistant version:
  • Python version (if known):

To Reproduce

Eg. Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior

A clear and concise description of what you expected to happen.

Screenshots

If applicable, add screenshots to help explain your problem.

Log Output
Logger: homeassistant.helpers.frame
Source: helpers/frame.py:103
First occurred: 11:00:55 (1 occurrences)
Last logged: 11:00:55

Detected integration that accessed discovery_info['0'] instead of discovery_info.0; this will fail in version 2022.6. Please report issue to the custom component author for homewizard_energy using this method at custom_components/homewizard_energy/config_flow.py, line 63: "host" not in discovery_info

And

Logger: homeassistant
Source: components/zeroconf/init.py:126
First occurred: 11:00:55 (7 occurrences)
Last logged: 11:23:51

Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/discovery_flow.py", line 74, in async_process_pending_flows
await gather_with_concurrency(
File "/usr/src/homeassistant/homeassistant/util/async
.py", line 170, in gather_with_concurrency
return await gather(
File "/usr/src/homeassistant/homeassistant/util/async_.py", line 168, in sem_task
return await task
File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 203, in async_init
flow, result = await task
File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 230, in _async_init
result = await self._async_handle_step(flow, flow.init_step, data, init_done)
File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 325, in _async_handle_step
result: FlowResult = await getattr(flow, method)(user_input)
File "/config/custom_components/homewizard_energy/config_flow.py", line 63, in async_step_zeroconf
"host" not in discovery_info
File "/usr/src/homeassistant/homeassistant/components/zeroconf/init.py", line 126, in getitem
return getattr(self, name)
TypeError: getattr(): attribute name must be string

If applicable
To get more output, enable debug output

# configuration.yaml
logger:
  default: info
  logs:
    custom_components.homewizard_energy: debug

Additional context

Add any other context about the problem here.

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.