-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ValueError Inverter State #6
Comments
I do have the same issue. A solution for this would be awesome. Loving this integration a lot and until the core update yesterday it was running like a "cat"!!! |
@mieschc May i ask where did you set the state class of Piko Inverter to None in HA? Thanks in advance! |
@dinomyte76 Go to folder custom components / kostal piko and open const.py. There you find the entry for the Inverter state. As mentioned the fetching ist interupted but Energy Dashboard is still working. |
I do have the same issue. |
I have the same issue. |
I tried a bunch of things in the last days (also tried other integrations) and yesterday evening - after upgrading to latest core version - i gave this integration another try, but this time i commented the complete part of the inverter state which @mieschc suggested. |
@dinomyte76 |
@dinomyte76 good idea. Did the same now and working as well. |
@dinomyte76 sadly still not working for me :( |
@leon2908 Hmm dunno. Do you see anything suspicious in your home-assistatnt.log file? |
@dinomyte76 I´m sorry, I only tryed to comment out the lines and after a restart of HA I saw the number only update once I shut down HA an loaded a Backup from yesterday. |
Any Update with the new HA Operating System 10.2 or the Core Update 2023.5.4 ? |
@leon2908 Looks not like Stefan ist still maintaining this Integration. I suggest to try commenting the Inverter state again. Maybe you Just missed one line last time. |
I give this one another go and now I get the following Error in the Log and had the same Error again.. @mieschc :( Logger: homeassistant.components.sensor Error adding entities for domain sensor with platform kostal_piko The above exception was the direct cause of the following exception: Traceback (most recent call last): |
@leon2908 Sorry, I cannot help you really. I did the same like you. Did you restart Home Assistant after the change? |
Sorry folks, for some reason I do not get any notification when a new issue is created. I will take a look at the issue in the evening and come up with a solution. Maybe you can be my testers, since I do not have this kind of Kostal inverter. This should be the new way the sensor should be defined (according to the documentation): KostalPikoSensorEntityDescription(
description=SensorEntityDescription(
key="kostal_piko_inverter_state",
name="Kostal PIKO Inverter State",
device_class=None,
state_class=SensorDeviceClass.ENUM,
native_unit_of_measurement=None,
icon="mdi:power-plug",
options=[
"Off",
"Idle",
"Starting",
"Input (MPP)",
"Input (limited)"
]),
dxs_id=16780032,
formatter=KostalPikoFormatter.format_inverter_state
), if it does not work, I will release a new version with the following configuration for the inverter state sensor as it seems to work: KostalPikoSensorEntityDescription(
description=SensorEntityDescription(
key="kostal_piko_inverter_state",
name="Kostal PIKO Inverter State",
device_class=None,
state_class=None,
native_unit_of_measurement=None,
icon="mdi:power-plug"),
dxs_id=16780032,
formatter=KostalPikoFormatter.format_inverter_state
), BTW I have changed my mail notifications, maybe someone of you can create another dummy issue so |
Moin Stefan, unfo I am traveling abroud until October and have only limited access to my HA Installation. If I have a chance to test it, I will do, but hopefully someone else is faster. |
I can also just release a new version that does what is mentioned here as the working solution. I will go for that approach. |
I have just release a new version with the fix. Please give it another try - I hope it solves your issues. Otherwise feel free to open the bug again. :) Thanks to @mieschc for providing the fix and testing my email notification settings 👯 |
|
Thanks. the second option works. the first gives an error: ValueError: Sensor sensor.kostal_piko_inverter_state is providing enum options, but is missing the enum device clas |
The second option is part of the latest release. Thank you for testing |
Moin Stefan,
after the core update yesterday evening Home Assistant lost connection to my Piko 20 Inverter. I had following error message in the logs:
Logger: homeassistant.components.sensor
Source: components/sensor/init.py:583
Integration: Sensor (documentation, issues)
First occurred: 10:06:34 (2 occurrences)
Last logged: 10:06:34
Error adding entities for domain sensor with platform kostal_piko
Error while setting up kostal_piko platform for sensor
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/sensor/init.py", line 579, in state
numerical_value = int(value)
ValueError: invalid literal for int() with base 10: 'Input (MPP)'
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 455, in async_add_entities
await asyncio.gather(*tasks)
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 731, in _async_add_entity
await entity.add_to_platform_finish()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 846, in add_to_platform_finish
self.async_write_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 585, in async_write_ha_state
self._async_write_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 649, in _async_write_ha_state
state = self._stringify_state(available)
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 591, in _stringify_state
if (state := self.state) is None:
File "/usr/src/homeassistant/homeassistant/components/sensor/init.py", line 583, in state
raise ValueError(
ValueError: Sensor sensor.kostal_piko_inverter_state has device class None, state class measurement unit None and suggested precision None thus indicating it has a numeric value; however, it has the non-numeric value: Input (MPP) (<class 'str'>)
After a restart Home Assistant picked only up one updated value and stopped fetching values again.
I changed now the state class of Piko Inverter to None to fix the problem temporarly and it is working again. I now get updated values again, but the values are interuppted. See screenshots.
After change:
Before change:
Do you have any better solution for it?
Brgds
Christopher
The text was updated successfully, but these errors were encountered: