Coder Social home page Coder Social logo

hass-wattbox's People

Contributors

chorty avatar eseglem avatar weirded avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

hass-wattbox's Issues

Unable to import component: No module named 'pywattbox.base'

Core 2023.11.2
Supervisor 2023.11.3
Operating System 11.1
Frontend 20231030.2

Version of the custom_component

v0.9.0b1

Configuration

wattbox:

  • host: !secret wattbox1_ip
    username: !secret it_user
    password: !secret it_psswd
    name: wattbox1
    resources:
    • current_value
    • power_value
    • voltage_value
  • host: !secret wattbox2_ip
    username: !secret it_user
    password: !secret it_psswd
    name: wattbox2
    resources:
    • current_value
    • power_value
    • voltage_value

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'

Describe the bug

Invalid config
The following integrations and platforms could not be set up:

Debug log


Unable to restart due to bad config

pywattbox update breaks hass-wattbox

Version of the custom_component

v0.8.1

Configuration

Any configuration

Describe the bug

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.

Debug log


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)

Component not working with HA 0.115.0b

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.

Integration is using deprecated `DEVICE_CLASS_*` constants

Version of the custom_component

All

Configuration

n/a

Describe the bug

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

Debug log


n/a

Error in logs

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>


BUG: custom_components/wattbox/__init__.py (ERROR)

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'

Voltage/Current Sensors Reading Zero

Version of the custom_component

0.8.2

Configuration

wattbox:
- host: 192.168.2.62
  name: Theater-PDU
  username: !secret wattbox_user
  password: !secret wattbox_pw
  scan_interval: 00:00:10

Describe the bug

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

image

Debug log

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>

Error "Not enough lines: 1. Getting more"

Version of the custom_component

v0.9.0b5

Configuration

  - 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

Describe the bug

A clear and concise description of what the bug is.

annoying repeating error in logs

Debug log

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.

Error during setup of component wattbox

Version of the custom_component

Configuration

wattbox:

  • host: 10.10.10.204
    username: !secret wattbox_username
    password: !secret wattbox_password
    name: 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

Describe the bug

Wattbox addon not loading at all.

Debug log

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

  • wattbox (Show logs)
    2022-08-07 11:05:45.600 DEBUG (MainThread) [homeassistant.components.websocket_api.http.connection] [140618375077200] Sending {"id":2,"type":"event","event":{"a":{"persistent_notification.invalid_config":{"s":"notifying","a":{"message":"The following integrations and platforms could not be set up:\n\n - wattbox (Show logs)\n\nPlease check your config and logs.","title":"Invalid config","friendly_name":"Invalid config"},"c":"01G9WQQZQT16WEGNZ1ZHY4GVAA","lc":1659895545.594447}}}}
    2022-08-07 11:05:45.663 DEBUG (MainThread) [homeassistant.components.websocket_api.http.connection] [140618375077200] Sending {"id":41,"type":"result","success":true,"result":[{"notification_id":"invalid_config","message":"The following integrations and platforms could not be set up:\n\n - wattbox (Show logs)\n\nPlease check your config and logs.","status":"unread","title":"Invalid config","created_at":"2022-08-07T18:05:45.594761+00:00"}]}

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

Depreciated and invalid issues

Version of the custom_component

v0.9.0b5

Configuration

  - 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

Describe the bug

A clear and concise description of what the bug is.

Debug log


Add your logs 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.