-
Notifications
You must be signed in to change notification settings - Fork 70
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
Error while setting up ecowitt platform for sensor WH57 Lightning Detection #128
Comments
I am not a programmer .... and tried the following to reduce the number of errors in the log: file: const.py line 500-503 was: result: no more errors after reboot HASSIO ... not sure what else I might have ... up ;-) |
UPDATE: I have just tested the change in my production environment. Using a piezo lighter near the sensor .... drumroll In the ecowitt app it shows: The value stored in this sensor is (epoch) 1657620032 Now as I am unfamilliar with Github how can I get this into the official code? Or are there other suggestions / improvements it turns out this is broken due to HA21 DEVICE_CLASS_* constants deprecated |
I think this will be corrected by the PR I just submitted... |
what is the status of this PR ? |
Ok., have uninstalled this version completely and using the official supported integration home-assistant/core#77441 |
See also Issue #112 slightly different log
Recently added WH57 Lightning Detection sensor
Data shows in app & ecowitt environment (sensor is cretead and no error messages displayed)
Sensor values are transmited from the HACS addon except last lightning:
Logger: homeassistant.components.sensor
Source: components/sensor/init.py:408
Integration: Sensor (documentation, issues)
First occurred: 11:23:52 (2 occurrences)
Last logged: 11:23:52
Error adding entities for domain sensor with platform ecowitt
Error while setting up ecowitt platform for sensor
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/sensor/init.py", line 397, in state
if value.tzinfo is None:
AttributeError: 'str' object has no attribute 'tzinfo'
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 382, in async_add_entities
await asyncio.gather(*tasks)
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 619, in _async_add_entity
await entity.add_to_platform_finish()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 810, in add_to_platform_finish
self.async_write_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 533, in async_write_ha_state
self._async_write_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 571, in _async_write_ha_state
state = self._stringify_state(available)
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 539, in _stringify_state
if (state := self.state) is None:
File "/usr/src/homeassistant/homeassistant/components/sensor/init.py", line 408, in state
raise ValueError(
ValueError: Invalid datetime: sensor.last_lightning_strike has a timestamp device class but does not provide a datetime state but <class 'str'>
The text was updated successfully, but these errors were encountered: