eseglem / hass-wattbox

Home Assistant WattBox Component
MIT License
15 stars 8 forks source link

Voltage/Current Sensors Reading Zero #21

Open kernelpanic85 opened 7 months ago

kernelpanic85 commented 7 months ago

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>
kernelpanic85 commented 7 months ago

Update: I found the HA community thread and updated to 0.9.0b5 and I see this in the logs now:

2024-04-10 12:23:52.394 ERROR (MainThread) [homeassistant.setup] Error during setup of component wattbox
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/setup.py", line 390, in _async_setup_component
result = await task
^^^^^^^^^^
File "/config/custom_components/wattbox/__init__.py", line 106, in async_setup
wattbox = await async_create_http_wattbox(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/pywattbox/http_wattbox.py", line 223, in async_create_http_wattbox
return await _async_create_wattbox(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/pywattbox/base.py", line 110, in _async_create_wattbox
await wattbox.async_get_initial()
File "/usr/local/lib/python3.12/site-packages/pywattbox/http_wattbox.py", line 39, in async_get_initial
response.raise_for_status()
File "/usr/local/lib/python3.12/site-packages/httpx/_models.py", line 761, in raise_for_status
raise HTTPStatusError(message, request=request, response=self)
httpx.HTTPStatusError: Client error '401 Unauthorized' for url 'http://192.168.2.62/wattbox_info.xml'
For more information check: https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/401
sheyman1 commented 3 months ago

Similar or same issue for me, except my power, voltage and current are showing unavailable.

2024-07-31 00:22:35.921 WARNING (ImportExecutor_0) [homeassistant.const] 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 report it to the author of the 'wattbox' custom integration 2024-07-31 00:22:35.923 WARNING (ImportExecutor_0) [homeassistant.const] 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 report it to the author of the 'wattbox' custom integration 2024-07-31 00:22:35.924 WARNING (ImportExecutor_0) [homeassistant.const] 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 report it to the author of the 'wattbox' custom integration 2024-07-31 00:22:35.926 INFO (MainThread) [homeassistant.setup] Setting up wattbox 2024-07-31 00:22:35.926 INFO (MainThread) [custom_components.wattbox]

wattbox Version: 0.9.0

zacs commented 1 month ago

I have only had this component for a couple weeks, but I've never had any sensor created for power, voltage, and current. I'm running HA 2024.10.1 and component 0.9.0b5.

It looks like it has been address in PR #22 by @aleksrozman in case anyone wants to cherry pick that into HACS.