-
-
Notifications
You must be signed in to change notification settings - Fork 137
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
Added support for door sensors #1592
base: master
Are you sure you want to change the base?
Conversation
## Motivation: I wanted to have additional sensors for my doors inside better thermostat with different timing, because a open door should not always shut down the heater if only for a minute, I did this with NodeRed and a Helper before. But having all in one place is more convinient ## Changes: 1. File: controlling.py Added handling for door sensors: Similar to window sensors, we added logic to check door sensors and turn off the HVAC system if a door is open. Added debugging logs: We included debugging logs to trace the state of door sensors and ensure they are being processed correctly. 2. File: config_flow.py - Added configuration options for door sensors similar to window sensors. This allows users to specify door sensors in the thermostat configuration. 3. File: trv.py - Modified `trigger_trv_change` and `update_hvac_action` functions to handle door sensors similar to window sensors. This ensures the HVAC mode is adjusted when a door is open. - Added debugging logs to ensure door sensor events are recognized and processed correctly. 4. File: __init__.py - Fixed a syntax error related to an unclosed parenthesis in the `async_update_entry` call. This ensures the code is syntactically correct and can be executed without errors. 5. File: door.py - Added logic to handle door sensors. This implementation monitors the state of door sensors and triggers appropriate actions based on their state. 6. File: climate.py - Integrated door sensor checks into the climate control logic. This ensures that the HVAC mode is adjusted when a door is open. 7. File: strings.json - Added strings related to door sensor configuration and states. This supports the new functionality for handling door sensors in the user interface. 8. File: const.py - Defined new constants for door sensor configuration and states. These constants are used to manage door sensor settings and actions throughout the application. 9. File: de.json - Added German translations for the new strings related to door sensor settings and states. This ensures that the user interface supports the new door sensor functionality in German. ## Related issue (check one): - [ ] fixes #<issue number goes here> - [ X] There is no related issue ticket ## Checklist (check one): - [ ] I did not change any code (e.g. documentation changes) - [X ] The code change is tested and works locally. ## Test-Hardware list (for code changes) Raspberry Pi5. , Homeassistent Supervised Core 2025.1.4 Supervisor 2024.12.3 Operating System 14.2 Frontend 20250109.2 Zigbee2MQTT Version: [2.1.0] TRV Hardware: SONOFF | TRVZB
Hope now everything is correct with the Git Structure ;) |
Yep, everything is fine now! |
Have you tested this code locally? |
Yes, Tested with Virtual Devices first, also tested with real sensors. Door or window open turns off heater. Found no problem while day testing yesterday. Actually the changed version is running on my HA in normal use. |
Motivation:
I wanted to have additional sensors for my doors inside better thermostat with different timing, because a open door should not always shut down the heater if only for a minute, I did this with NodeRed and a Helper before. But having all in one place is more convinient
Changes:
File: controlling.py
Added handling for door sensors: Similar to window sensors, we added logic to check door sensors and turn off the HVAC system if a door is open.
Added debugging logs: We included debugging logs to trace the state of door sensors and ensure they are being processed correctly.
File: config_flow.py
trigger_trv_change
andupdate_hvac_action
functions to handle door sensors similar to window sensors. This ensures the HVAC mode is adjusted when a door is open.async_update_entry
call. This ensures the code is syntactically correct and can be executed without errors.Related issue (check one):
Checklist (check one):
Test-Hardware list (for code changes)
Raspberry Pi5. , Homeassistent Supervised
Core 2025.1.4
Supervisor 2024.12.3
Operating System 14.2
Frontend 20250109.2
Zigbee2MQTT Version: [2.1.0]
TRV Hardware: SONOFF | TRVZB