Skip to content
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

Validation errors getting third-party enviroment sensors #82

Closed
famichiki opened this issue Aug 25, 2024 · 3 comments · Fixed by #89
Closed

Validation errors getting third-party enviroment sensors #82

famichiki opened this issue Aug 25, 2024 · 3 comments · Fixed by #89

Comments

@famichiki
Copy link

In the EnvironmentSensorAttributes class in environment_sensor.py could you please add = None to the optional attributes as below? It's to resolve field required when getting third-party sensors that don't support PM2.5 ov VOC. I get this error with the Sonoff temperature/humidity sensors. Thanks.

class EnvironmentSensorAttributes(Attributes):
    current_temperature: float
    current_r_h: int
    current_p_m25: Optional[int] = None
    max_measured_p_m25: Optional[int] = None
    min_measured_p_m25: Optional[int] = None
    voc_index: Optional[int] = None
@LarsJensen69
Copy link

LarsJensen69 commented Aug 27, 2024

Thanks for adding this issue. I see the same. Unfortunately the sensor added causes the module to crash even sensor is not called. Just added in Dirigera. Did you find a way arround until added here?
Added: If I follow your suggestion the Enviroment sensor will not work. The temperature and RH will have same name.

@famichiki
Copy link
Author

Which sensor are you using and can you post the message data received here?

@LarsJensen69
Copy link

I am using "Vindstyrka" which works fine as enviromental sensor.
When adding the Sonoff SNZB-02P it crashes because it also shows up as enviromental sensor but the variablel names are a bit different for temperature and RH.

@Leggin Leggin linked a pull request Sep 2, 2024 that will close this issue
@Leggin Leggin closed this as completed in #89 Sep 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants