Closed marcsauter75 closed 1 month ago
Do you see the values of
sensor.ups_accumulated_running_time
sensor.ups_input_report_voltage
sensor.ups_micro_usb_voltage
sensor.ups_battery_empty_voltage
sensor.ups_running_time
being reported correctly or are they missing sometimes/completely?
What version of HA are you using?
What sensor are you using for "30% Battery" ?
What Firmware version are you using ?
hi
yes - sensor.ups_accumulated_running_time yes - sensor.ups_input_report_voltage yes - sensor.ups_micro_usb_voltage yes - sensor.ups_battery_empty_voltage yes - sensor.ups_running_time
being reported correctly or are they missing sometimes/completely?
need to check this ....
What version of HA are you using? newest 2024.3.1
using UPS battery capacity
firmware: 10
Ok with "missing sometimes/completely" I mean in the history do you see unregular steps in sensor.ups_accumulated_running_time
And what type of are you running? (Core/Supervised/OS)
In the history is the "UPS battery capacity" sensor below 30% sometimes?
Supervisor 2024.03.0 Operating System 12.1 Frontend 20240307.0
Below 30% then i had a shutdown. As I said I changed it now to lower 4v for >20s then shutdown. Cause never seen in history voltage lower 4v. I will view capacity over next days...
what i have seen some peek where % is going to 125 or 300 or something over 100
you can also see the capacity in the history
Maybe also update your UPS. docs
Yeah that should definitely not happen please try updating the UPS.
ok will try it soon, takes time cause the raspberry is in my caravan ;)
Ok be sure to have a backup of the PI just in case anything goes wrong.
ok will try it soon, takes time cause the raspberry is in my caravan ;)
did you update it? did that fix it?
Do you have the same error? Also with 0% capacity and the error message?
Do you have the same error? Also with 0% capacity and the error message?
Maybe, it would seem I have a very similar error.
Source: helpers/entity.py:950
First occurred: May 24, 2024 at 3:48:57 PM (758 occurrences)
Last logged: 11:42:02 AM
Update for sensor.ups_processor_voltage fails
Update for sensor.ups_micro_usb_voltage fails
Update for sensor.ups_battery_capacity fails
Update for sensor.ups_restart_countdown fails
Update for sensor.ups_sampling_period fails
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 950, in async_update_ha_state
await self.async_device_update()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1293, in async_device_update
await self.async_update()
File "/config/custom_components/upsplus/sensor.py", line 69, in async_update
state = read_buff(self._bus, *self._entity.get("index"))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/upsplus/battery.py", line 35, in read_buff
result = result | bus.read_byte_data(DEVICE_ADDR, index) << (8 * i)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/smbus2/smbus2.py", line 433, in read_byte_data
ioctl(self.fd, I2C_SMBUS, msg)
OSError: [Errno 5] I/O error
I intermittently get a good reading for each sensor, but have only recently had this issue of getting nothing at times. Throughout my entire use of this integration, I have had instances of enormously incorrect readings, though I cannot say if this is a result of the integration or if it is to do with the actual data the UPS transmits.
For example, the battery capacity sensor: and the battery temperature sensor: both have insane spikes which make historical data nearly impossible to see, and tend to be really harmful to the accuracy of the moving averages depicted in things like the line graph cards. This happens with all sensors.
Could you tell me your UPS firmware version?
Could you tell me your UPS firmware version?
I don't know off the top of my head, I'll have to look up how to check.
Could you tell me your UPS firmware version?
Integration says it's version 10, same as the other person having errors.
It is in my integration in the device info.
It is in my integration in the device info.
Ah, thank you!
Firmware: 10
Latest is 15 or 16 so try updating. https://github.com/archef2000/homeassistant-upsplus/blob/main/docs.md#updating-the-ups
Latest is 15 or 16 so try updating. https://github.com/archef2000/homeassistant-upsplus/blob/main/docs.md#updating-the-ups
I've been trying, but when I press "Call Service" it says Failed to call service upsplus.update. Unknown error
if I have all the checks on the checklist checked. If I don't have them all checked, it only returns
success: false
error: Please finish the preperation
This is what I submit:
Do you see something in the log? Have you done all steps in the doc?
Do you see something in the log? Have you done all steps in the doc?
I did everything that the doc explicitly says to do, but got stuck at the updating service call for obvious reasons, so no step past that. Some logs:
Logger: homeassistant.helpers.script.websocket_api_script
Source: helpers/script.py:501
First occurred: 2:01:19 PM (4 occurrences)
Last logged: 2:09:40 PM
websocket_api script: Error executing script. Unexpected error for call_service at pos 1: [Errno 121] Remote I/O error
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 501, in _async_step
await getattr(self, handler)()
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 736, in _async_call_service_step
response_data = await self._async_run_long_action(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 699, in _async_run_long_action
return await long_task
^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/core.py", line 2738, in async_call
response_data = await coro
^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/core.py", line 2779, in _execute_service
return await target(service_call)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/upsplus/__init__.py", line 79, in update
ups_manager = UPSManager()
^^^^^^^^^^^^
File "/config/custom_components/upsplus/battery.py", line 23, in __init__
self.sw_version = read_buff(self.bus,40,41)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/upsplus/battery.py", line 31, in read_buff
result = bus.read_byte_data(DEVICE_ADDR, index1)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/smbus2/smbus2.py", line 433, in read_byte_data
ioctl(self.fd, I2C_SMBUS, msg)
OSError: [Errno 121] Remote I/O error
Logger: homeassistant.components.websocket_api.http.connection
Source: custom_components/upsplus/battery.py:31
integration: Home Assistant WebSocket API (documentation, issues)
First occurred: 2:01:19 PM (4 occurrences)
Last logged: 2:09:40 PM
[547680825280] Error handling message: Unknown error (unknown_error) Meme from fe80::1d3:a2a5:8bb7:fb21 (Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:126.0) Gecko/20100101 Firefox/126.0)
[547605170624] Error handling message: Unknown error (unknown_error) Meme from fe80::1d3:a2a5:8bb7:fb21 (Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:126.0) Gecko/20100101 Firefox/126.0)
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/websocket_api/decorators.py", line 27, in _handle_async_response
await func(hass, connection, msg)
File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 793, in handle_execute_script
script_result = await script_obj.async_run(
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 1731, in async_run
return await asyncio.shield(create_eager_task(run.async_run()))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 451, in async_run
await self._async_step(log_exceptions=False)
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 503, in _async_step
self._handle_exception(
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 533, in _handle_exception
raise exception
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 501, in _async_step
await getattr(self, handler)()
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 736, in _async_call_service_step
response_data = await self._async_run_long_action(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 699, in _async_run_long_action
return await long_task
^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/core.py", line 2738, in async_call
response_data = await coro
^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/core.py", line 2779, in _execute_service
return await target(service_call)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/upsplus/__init__.py", line 79, in update
ups_manager = UPSManager()
^^^^^^^^^^^^
File "/config/custom_components/upsplus/battery.py", line 23, in __init__
self.sw_version = read_buff(self.bus,40,41)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/upsplus/battery.py", line 31, in read_buff
result = bus.read_byte_data(DEVICE_ADDR, index1)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/smbus2/smbus2.py", line 433, in read_byte_data
ioctl(self.fd, I2C_SMBUS, msg)
OSError: [Errno 121] Remote I/O error
Plaese check that all pins make good contact.
Plaese check that all pins make good contact.
They all look good to me. Is there anything else?
And you powered it down completly battery and cord?
And you powered it down completly battery and cord?
Yes. I removed the batteries and unplugged the pi (in the correct order, of course) after shutting it down.
They there would be the manual way to run the script from https://github.com/geeekpi/upsplus
They there would be the manual way to run the script from https://github.com/geeekpi/upsplus
I keep getting this error when running the script via python3 OTA_firmware_upgrade.py
:
Traceback (most recent call last):
File "/root/upsplus/OTA_firmware_upgrade.py", line 19, in <module>
bus = smbus2.SMBus(DEVICE_BUS)
^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.12/site-packages/smbus2/smbus2.py", line 280, in __init__
self.open(bus)
File "/usr/lib/python3.12/site-packages/smbus2/smbus2.py", line 310, in open
self.fd = os.open(filepath, os.O_RDWR)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
PermissionError: [Errno 1] Operation not permitted: '/dev/i2c-1'
Have you enabled i2c via raspi-config? Does the device i2c-1 exist? Maybe try sudo.
Have you enabled i2c via raspi-config? Does the device i2c-1 exist? Maybe try sudo.
Not via raspi-config. I used the HassOS I2C Configurator. Checking home assistant's hardware, I see that i2c-1
seems to exist.
And with sudo?
And with sudo?
Same thing, just about.
With sudo python3 OTA_firmware_upgrade.py
:
Traceback (most recent call last):
File "/root/upsplus/OTA_firmware_upgrade.py", line 19, in <module>
bus = smbus2.SMBus(DEVICE_BUS)
^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.12/site-packages/smbus2/smbus2.py", line 280, in __init__
self.open(bus)
File "/usr/lib/python3.12/site-packages/smbus2/smbus2.py", line 310, in open
self.fd = os.open(filepath, os.O_RDWR)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
PermissionError: [Errno 1] Operation not permitted: '/dev/i2c-1'
Load up an sd card via RPI-OS and try it with that
Load up an sd card via RPI-OS and try it with that
In what sense? Install home assistant on the new card or just do it in RPI-OS?
Just with RPI-OS without HA.
Just with RPI-OS without HA.
Alright. Might not be possible, since most of the SD cards I have are either corrupted or historically unreliable. The definitely working ones are all slotted into Pi's, but I'll see if I get lucky.
The update appears to have been successful! The version is now reported to be 14. I suppose I got lucky.
Interestingly, the integration startup times show the 52PI UPS integration starting -3.03 seconds before the rest.
That aside, it looks like the errors have also stopped. I am getting regular readings again. Wildly incorrect readings have yet to show up, though given their irregularity that may simply be a matter of time.
Around 8pm on May 25th was when I updated the UPS's firmware from version 10 to version 14. This is important because it reveals the huge improvement in the lack of abnormal spikes when looking at the graphs of the data. (I'm not showing all the graphs here, just enough to illustrate my point.)
And looking in the logs, I haven't seen any errors reported by your UPS integration since then. Thank you!
Ok then I will close this issue for now. If you or @marcsauter75 have any more problems feel free to comment or create a new issue. Would just like to know why the update function is not working. Could you now tell me your firmware version again please.
Ok then I will close this issue for now. If you or @marcsauter75 have any more problems feel free to comment or create a new issue. Would just like to know why the update function is not working. Could you now tell me your firmware version again please.
I edited my comment to include the firmware version. I hope that's what you meant.
Yeah thx
Hi, I configured automation to shutdown and send me telegram message on 30% Battery. But I have the problem that this happen also some times when power supply is connected normaly. Any Idea on this or do I have any miss configurations ? I changed it for now on "Battery Voltage to <4V" hope that helps
Also I have this error message in the logs: Logger: homeassistant.helpers.entity Quelle: helpers/entity.py:945 Erstmals aufgetreten: 09:24:17 (26 Vorkommnisse) Zuletzt protokolliert: 10:02:37
Update for sensor.ups_accumulated_running_time fails Update for sensor.ups_input_report_voltage fails Update for sensor.ups_micro_usb_voltage fails Update for sensor.ups_battery_empty_voltage fails Update for sensor.ups_running_time fails Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 945, in async_update_ha_state await self.async_device_update() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1262, in async_device_update await self.async_update() File "/config/custom_components/upsplus/sensor.py", line 69, in async_update state = read_buff(self._bus, *self._entity.get("index")) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/upsplus/battery.py", line 31, in read_buff result = bus.read_byte_data(DEVICE_ADDR, index1) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/smbus2/smbus2.py", line 433, in read_byte_data ioctl(self.fd, I2C_SMBUS, msg) OSError: [Errno 5] I/O error