eseglem / hass-wattbox Goto Github PK
View Code? Open in Web Editor NEWHome Assistant WattBox Component
License: MIT License
Home Assistant WattBox Component
License: MIT License
I might be completely stupid and misreading the documentation, but how do I turn on/off individual outlets rather than the master switch? Thanks!
Core 2023.11.2
Supervisor 2023.11.3
Operating System 11.1
Frontend 20231030.2
v0.9.0b1
wattbox:
HA Log Error
2023-11-15 14:47:43.778 ERROR (MainThread) [homeassistant.setup] Setup failed for custom integration wattbox: Unable to import component: No module named 'pywattbox.base'
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/setup.py", line 215, in _async_setup_component
component = integration.get_component()
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/loader.py", line 816, in get_component
ComponentProtocol, importlib.import_module(self.pkg_path)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/importlib/__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "<frozen importlib._bootstrap>", line 1204, in _gcd_import
File "<frozen importlib._bootstrap>", line 1176, in _find_and_load
File "<frozen importlib._bootstrap>", line 1147, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 940, in exec_module
File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
File "/config/custom_components/wattbox/__init__.py", line 28, in <module>
from pywattbox.base import BaseWattBox
ModuleNotFoundError: No module named 'pywattbox.base'
Invalid config
The following integrations and platforms could not be set up:
Unable to restart due to bad config
v0.8.1
Any configuration
The latest pywattbox releases on pypi make a breaking change that causes this integration to fail to init. Compare pywattbox's __init__.py
between v0.4.0 and v0.7.2 to see the break.
I worked around this locally by pinning the pywattbox dependency to 0.4.0 exactly.
Logger: homeassistant.setup
Source: setup.py:288
First occurred: 5:42:51 PM (1 occurrences)
Last logged: 5:42:51 PM
Error during setup of component wattbox
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/setup.py", line 288, in _async_setup_component
result = await task
^^^^^^^^^^
File "/config/custom_components/wattbox/__init__.py", line 76, in async_setup
from pywattbox import WattBox # pylint: disable=import-outside-toplevel
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ImportError: cannot import name 'WattBox' from 'pywattbox' (/usr/local/lib/python3.11/site-packages/pywattbox/__init__.py)
Use device_info
for each Entity
so they can be consolidated by HA. See: https://developers.home-assistant.io/docs/device_registry_index
May be blocked by #12 ?
Use Config Flow to handle config rather than the configuration.yaml
Make sure it can:
Component is not working with HA on the newest beta. System upgraded but threw a lot of errors during startup and eventually started with this error.
Log Details (ERROR)
Logger: homeassistant.setup
Source: setup.py:138
First occurred: 7:46:14 PM (1 occurrences)
Last logged: 7:46:14 PM
Setup failed for wattbox: Unable to import component: cannot import name 'UNIT_PERCENTAGE' from 'homeassistant.const' (/usr/src/homeassistant/homeassistant/const.py)
The server also won't restart now as the config checker is throwing an error. I am going to have to remove the repo from hacs to get my system to start up properly.
All
n/a
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
n/a
I am seeing this error in logs?
Log Details (WARNING)
Logger: homeassistant.components.recorder
Source: components/recorder/__init__.py:374
Integration: Recorder (documentation, issues)
First occurred: 8:38:37 PM (3 occurrences)
Last logged: 8:38:37 PM
Event is not JSON serializable: <Event platform_discovered[L]: service=load_platform.binary_sensor, platform=wattbox, discovered=host=192.168.1.244, name=wattbox1, username=xxxxxx, password=xxxxxxx!, resources=['auto_reboot', 'mute', 'safe_voltage_status', 'current_value', 'power_value', 'voltage_value'], port=80, scan_interval=0:00:30>
Event is not JSON serializable: <Event platform_discovered[L]: service=load_platform.switch, platform=wattbox, discovered=host=192.168.1.244, name=wattbox1, username=xxxxxx, password=xxxxxxx!, resources=['auto_reboot', 'mute', 'safe_voltage_status', 'current_value', 'power_value', 'voltage_value'], port=80, scan_interval=0:00:30>
Event is not JSON serializable: <Event platform_discovered[L]: service=load_platform.sensor, platform=wattbox, discovered=host=192.168.1.244, name=wattbox1, username=xxxxxxx, password=xxxxxx!, resources=['auto_reboot', 'mute', 'safe_voltage_status', 'current_value', 'power_value', 'voltage_value'], port=80, scan_interval=0:00:30>
Rather than having to restart HA, have it retry. See: https://developers.home-assistant.io/docs/integration_setup_failures#handling-offline-or-unavailable-devices-and-services
Getting this error. Tried updating in HACS and nothing. Any help would be great.
Upgraded to 94.3 from 93.2 and got this error:
Error during setup of component wattbox
9:18 AM custom_components/wattbox/__init__.py (ERROR)
Intel NUC, Ubuntu 18.04.2 LTS, Hassio install, Hass.io supervisor 166.
From ha-log:
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/setup.py", line 153, in _async_setup_component
hass, processed_config)
File "/config/custom_components/wattbox/__init__.py", line 69, in async_setup
from pywattbox import WattBox
ModuleNotFoundError: No module named 'pywattbox'
0.8.2
wattbox:
- host: 192.168.2.62
name: Theater-PDU
username: !secret wattbox_user
password: !secret wattbox_pw
scan_interval: 00:00:10
The voltage and current sensors read zero for my WB-800VPS-IPVM-12. Is it possible to fix or add support for this model? It seems to use this API
2024-04-10 11:18:29.836 DEBUG (MainThread) [custom_components.wattbox] Updated: (http://192.168.2.62:80): None - <pywattbox.wattbox.WattBox object at 0x5c9dc3d8>
2024-04-10 11:18:39.820 DEBUG (MainThread) [custom_components.wattbox] Updated: (http://192.168.2.62:80): None - <pywattbox.wattbox.WattBox object at 0x5c9dc3d8>
2024-04-10 11:18:49.824 DEBUG (MainThread) [custom_components.wattbox] Updated: (http://192.168.2.62:80): None - <pywattbox.wattbox.WattBox object at 0x5c9dc3d8>
2024-04-10 11:18:59.830 DEBUG (MainThread) [custom_components.wattbox] Updated: (http://192.168.2.62:80): None - <pywattbox.wattbox.WattBox object at 0x5c9dc3d8>
2024-04-10 11:19:09.827 DEBUG (MainThread) [custom_components.wattbox] Updated: (http://192.168.2.62:80): None - <pywattbox.wattbox.WattBox object at 0x5c9dc3d8>
2024-04-10 11:19:19.826 DEBUG (MainThread) [custom_components.wattbox] Updated: (http://192.168.2.62:80): None - <pywattbox.wattbox.WattBox object at 0x5c9dc3d8>
2024-04-10 11:19:29.840 DEBUG (MainThread) [custom_components.wattbox] Updated: (http://192.168.2.62:80): None - <pywattbox.wattbox.WattBox object at 0x5c9dc3d8>
v0.9.0b5
- host: 10.30.46.119
port: 22
name: Network Wattbox
username: myusername
password: mypassword
scan_interval: 00:00:30
resources:
- cloud_status
- auto_reboot
- mute
- safe_voltage_status
- current_value
- power_value
- voltage_value
Add your logs here.
Logger: pywattbox.async_driver
Source: custom_components/wattbox/__init__.py:143
Integration: WattBox (documentation, issues)
First occurred: 4:04:02 PM (19 occurrences)
Last logged: 4:26:32 PM
Not enough lines: 1. Getting more
A clear and concise description of what the bug is.
annoying repeating error in logs
only thing I see when enabling debug
2023-12-12 16:36:32.925 DEBUG (MainThread) [custom_components.wattbox] Updated: WattBox (10.30.46.119): WB-800-IPVM-6 - <pywattbox.ip_wattbox.IpWattBox object at 0x7f6d938e6050>
Add your logs here.
wattbox:
Add your logs here.
2022-08-07 11:00:05.712 ERROR (MainThread) [homeassistant.setup] Error during setup of component wattbox
File "/config/custom_components/wattbox/init.py", line 94, in async_setup
File "/usr/local/lib/python3.10/site-packages/pywattbox/wattbox.py", line 76, in init
File "/usr/local/lib/python3.10/site-packages/pywattbox/wattbox.py", line 135, in update
Wattbox addon not loading at all.
2022-08-07 11:05:45.165 INFO (MainThread) [homeassistant.setup] Setting up wattbox
2022-08-07 11:05:45.166 INFO (MainThread) [custom_components.wattbox]
wattbox
https://github.com/eseglem/hass-wattbox/issues
2022-08-07 11:05:45.593 ERROR (MainThread) [homeassistant.setup] Error during setup of component wattbox
File "/config/custom_components/wattbox/init.py", line 94, in async_setup
File "/usr/local/lib/python3.10/site-packages/pywattbox/wattbox.py", line 76, in init
File "/usr/local/lib/python3.10/site-packages/pywattbox/wattbox.py", line 135, in update
Add your logs here.
Logger: homeassistant.setup
Source: custom_components/wattbox/init.py:94
Integration: wattbox (documentation, issues)
First occurred: 11:31:33 AM (1 occurrences)
Last logged: 11:31:33 AM
Error during setup of component wattbox
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/wattbox/init.py", line 94, in async_setup
hass.data[DOMAIN_DATA][name] = await hass.async_add_executor_job(
File "/usr/local/lib/python3.10/concurrent/futures/thread.py", line 58, in run
result = self.fn(*self.args, **self.kwargs)
File "/usr/local/lib/python3.10/site-packages/pywattbox/wattbox.py", line 76, in init
self.update()
File "/usr/local/lib/python3.10/site-packages/pywattbox/wattbox.py", line 135, in update
self.outlets[i].method = outlet_methods[i - 1]
IndexError: list index out of range
v0.9.0b5
- host: 10.30.46.119
port: 22
name: Network Wattbox
username: redacted
password: redacted
scan_interval: 00:00:30
Logger: homeassistant.const
Source: helpers/deprecation.py:205
First occurred: 4:31:18 PM (3 occurrences)
Last logged: 4:31:18 PM
ELECTRIC_POTENTIAL_VOLT was used from wattbox, this is a deprecated constant which will be removed in HA Core 2025.1. Use UnitOfElectricPotential.VOLT instead, please create a bug report at https://github.com/eseglem/hass-wattbox/issues
POWER_WATT was used from wattbox, this is a deprecated constant which will be removed in HA Core 2025.1. Use UnitOfPower.WATT instead, please create a bug report at https://github.com/eseglem/hass-wattbox/issues
TIME_MINUTES was used from wattbox, this is a deprecated constant which will be removed in HA Core 2025.1. Use UnitOfTime.MINUTES instead, please create a bug report at https://github.com/eseglem/hass-wattbox/issues
Logger: homeassistant.components.sensor
Source: components/sensor/__init__.py:396
Integration: Sensor (documentation, issues)
First occurred: 4:31:22 PM (3 occurrences)
Last logged: 4:31:22 PM
<class 'custom_components.wattbox.sensor.WattBoxSensor'> sets an invalid suggested_unit_of_measurement. Please create a bug report at https://github.com/eseglem/hass-wattbox/issues. This warning will become an error in Home Assistant Core 2024.5
A clear and concise description of what the bug is.
Add your logs here.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.