### Development Environment Setup Source: https://github.com/zxdavb/evohome-async/blob/main/README.md Steps to clone the repository, set up the development environment using uv, and install pre-commit hooks. ```bash git clone https://github.com/zxdavb/evohome-async cd evohome-async uv sync --all-extras # creates .venv/ Python pinned via .python-version prek install # install pre-commit git hooks ``` -------------------------------- ### Install CLI Source: https://github.com/zxdavb/evohome-async/blob/main/README.md Install the evohome-async library with CLI support using pip. ```bash pip install 'evohome-async[cli]' evo-client --help ``` -------------------------------- ### Basic Asynchronous Client Initialization Source: https://github.com/zxdavb/evohome-async/blob/main/README.md Example of initializing the EvohomeClient with a TokenManager and performing an initial update. Ensure to close the websession afterwards. ```python websession = aiohttp.ClientSession() token_manager = TokenManager(username, password, websession) await token_manager.load_access_token() evo = EvohomeClient(token_manager) await evo.update() ... # Your logic here await token_manager.save_access_token() await websession.close() ``` -------------------------------- ### Logging Setup Source: https://github.com/zxdavb/evohome-async/blob/main/CONTRIBUTING.md Use this logger for library code. The T201 Ruff rule enforces its use over print statements. ```python import logging _LOGGER = logging.getLogger(__name__) ``` -------------------------------- ### Example Evohome Debug Log Output Source: https://github.com/zxdavb/evohome-async/wiki/Hass:-Evohome-Debug-Logs This is an example of the debug log output you might see after configuring and running Home Assistant with evohome debug logging enabled. Pay attention to 'Config =', 'Temperatures =', and 'Status =' lines. ```log 2023-09-15 15:36:09.373 DEBUG (MainThread) [homeassistant.components.evohome] Config = {'locationInfo': {'timeZone': {'timeZoneId': 'GMTStandardTime'... 2023-09-15 15:36:13.557 DEBUG (MainThread) [homeassistant.components.evohome] Temperatures = {'3432579': 128.0, '3449740': 21.3, '3432521': 128.0... 2023-09-15 15:36:13.708 DEBUG (MainThread) [homeassistant.components.evohome] Status = {'locationId': '2738909', 'gateways': [{'gatewayId': '2499896'... 2023-09-15 15:36:13.722 DEBUG (MainThread) [homeassistant.components.evohome.climate] Found the Location/Controller (EvoTouch), id=3432522, name=My Home (location_idx=0) 2023-09-15 15:36:13.723 DEBUG (MainThread) [homeassistant.components.evohome.climate] Adding: RadiatorZone (HeatingZone), id=3432577, name=Front Room 2023-09-15 15:36:13.723 DEBUG (MainThread) [homeassistant.components.evohome.climate] Adding: RadiatorZone (HeatingZone), id=3432578, name=Kitchen 2023-09-15 15:36:13.723 DEBUG (MainThread) [homeassistant.components.evohome.climate] Adding: RadiatorZone (HeatingZone), id=3432579, name=Bathroom 2023-09-15 15:36:14.129 DEBUG (MainThread) [homeassistant.components.evohome] Schedule['Front Room'] = {'DailySchedules': [{'DayOfWeek': 0... ``` -------------------------------- ### Clone Core Repository for Evohome Source: https://github.com/zxdavb/evohome-async/wiki/Hass:-Multiple-Evohome-Locations Clones the Home Assistant core repository to access the official evohome component files. This is a one-time setup step. ```bash cd /config/custom_components git clone --filter=blob:none --no-checkout --depth 1 --sparse https://github.com/home-assistant/core cd core git sparse-checkout add homeassistant/components/evohome ``` -------------------------------- ### Example Schedule for a Room Source: https://github.com/zxdavb/evohome-async/blob/main/tests/tests/fixtures_v2/hass_102505/schedules.py.txt Defines a daily heating schedule for 'Matts bedroom' with multiple switchpoints for different times of the day. This structure allows for granular control over temperature settings throughout the week. ```python schedule["Matts bedroom"] = { "DailySchedules": [ { "DayOfWeek": 0, "Switchpoints": [ {"heatSetpoint": 16.0, "TimeOfDay": "00:00:00"}, {"heatSetpoint": 19.0, "TimeOfDay": "06:00:00"}, {"heatSetpoint": 16.0, "TimeOfDay": "09:00:00"}, {"heatSetpoint": 20.0, "TimeOfDay": "20:00:00"}, ], }, { "DayOfWeek": 1, "Switchpoints": [ {"heatSetpoint": 16.0, "TimeOfDay": "00:00:00"}, {"heatSetpoint": 19.0, "TimeOfDay": "06:00:00"}, {"heatSetpoint": 16.0, "TimeOfDay": "09:00:00"}, {"heatSetpoint": 20.0, "TimeOfDay": "20:00:00"}, ], }, { "DayOfWeek": 2, "Switchpoints": [ {"heatSetpoint": 16.0, "TimeOfDay": "00:00:00"}, {"heatSetpoint": 19.0, "TimeOfDay": "06:00:00"}, {"heatSetpoint": 16.0, "TimeOfDay": "09:00:00"}, {"heatSetpoint": 20.0, "TimeOfDay": "20:00:00"}, ], }, { "DayOfWeek": 3, "Switchpoints": [ {"heatSetpoint": 16.0, "TimeOfDay": "00:00:00"}, {"heatSetpoint": 19.0, "TimeOfDay": "06:00:00"}, {"heatSetpoint": 16.0, "TimeOfDay": "09:00:00"}, {"heatSetpoint": 20.0, "TimeOfDay": "20:00:00"}, ], }, { "DayOfWeek": 4, "Switchpoints": [ {"heatSetpoint": 16.0, "TimeOfDay": "00:00:00"}, {"heatSetpoint": 19.0, "TimeOfDay": "06:00:00"}, {"heatSetpoint": 16.0, "TimeOfDay": "09:00:00"}, {"heatSetpoint": 20.0, "TimeOfDay": "20:00:00"}, ], }, { "DayOfWeek": 5, "Switchpoints": [ {"heatSetpoint": 16.0, "TimeOfDay": "00:00:00"}, {"heatSetpoint": 19.0, "TimeOfDay": "06:00:00"}, {"heatSetpoint": 16.0, "TimeOfDay": "09:00:00"}, {"heatSetpoint": 20.0, "TimeOfDay": "20:00:00"}, ], }, { "DayOfWeek": 6, "Switchpoints": [ {"heatSetpoint": 16.0, "TimeOfDay": "00:00:00"}, {"heatSetpoint": 19.0, "TimeOfDay": "06:00:00"}, {"heatSetpoint": 16.0, "TimeOfDay": "09:00:00"}, {"heatSetpoint": 20.0, "TimeOfDay": "20:00:00"}, ], }, ] } ``` -------------------------------- ### Evohome Configuration with Location Index Source: https://github.com/zxdavb/evohome-async/wiki/Hass:-Multiple-Evohome-Locations Example configuration for the evohome integration in Home Assistant, specifying the `location_idx` to select a particular evohome location. The `location_idx` is only necessary if it's non-zero. ```yaml evohome: username: !secret TCC_USERNAME password: !secret TCC_PASSWORD location_idx: 3 # location_idx is only required if non-zero ``` -------------------------------- ### Copy Evohome Integration to Custom Components Source: https://github.com/zxdavb/evohome-async/wiki/Hass:-Multiple-Evohome-Locations Copies the evohome integration files from the cloned core repository to a new custom component directory (e.g., `evohome_1`). Ensure the target directory is removed if it exists from a previous setup. ```bash cd /config/custom_components cp -r core/homeassistant/components/evohome evohome_1 ``` -------------------------------- ### Checkout Specific HA Version for Evohome Source: https://github.com/zxdavb/evohome-async/wiki/Hass:-Multiple-Evohome-Locations Fetches all tags and checks out a specific version of the Home Assistant core repository to match the installed HA version. This ensures compatibility. ```bash cd /config/custom_components/core git fetch --tags git checkout 2024.7.2 ``` -------------------------------- ### Timezone-Aware Datetime Example Source: https://github.com/zxdavb/evohome-async/blob/main/CONTRIBUTING.md Demonstrates the correct way to create timezone-aware datetime objects using UTC. Incorrectly created naive datetimes will be flagged by the DTZ005 linter rule. ```python # ✅ Correct from datetime import UTC, datetime as dt now = dt.now(tz=UTC) # ❌ Wrong — will be caught by DTZ005 from datetime import datetime now = datetime.now() ``` -------------------------------- ### Run All Pre-commit Tests with Prek Source: https://github.com/zxdavb/evohome-async/blob/main/CONTRIBUTING.md Use the 'prek' tool to conveniently run all configured pre-commit checks. This is the recommended way to ensure your code meets project standards. ```bash prek run --all ``` -------------------------------- ### Backup Schedules using CLI Source: https://github.com/zxdavb/evohome-async/blob/main/README.md Use the evo-client to backup schedules for a specific location index to a JSON file. ```bash evo-client -u username@gmail.com -p password get-schedules --loc-idx 2 > schedules.json ``` -------------------------------- ### Project Structure Overview Source: https://github.com/zxdavb/evohome-async/blob/main/CONTRIBUTING.md This is the standard directory layout for the evohome-async project, separating library code from the CLI tool and tests. ```text cli/ evohome_cli/ # CLI tool (excluded from coverage) src/ _evohome/ # Shared internals (auth, exceptions, helpers, timezone) evohomeasync/ # Legacy v0 API client (backward compat) evohomeasync2/ # Primary v2 API client — most work happens here tests/ tests/ # Main test suite tests_rf/ # Request/response fixture tests ``` -------------------------------- ### Run Linting, Formatting, and Type Checking Source: https://github.com/zxdavb/evohome-async/blob/main/CONTRIBUTING.md Execute all pre-commit checks to ensure code quality and consistency before submitting changes. This includes linting, formatting, and strict type checking. ```bash ruff check . ruff format --check . ``` ```bash mypy ``` ```bash pytest ``` -------------------------------- ### Daily Schedule Configuration Source: https://github.com/zxdavb/evohome-async/blob/main/tests/tests/fixtures_v2/hass_102505/schedules.py.txt Defines a daily heating schedule for a room, specifying switchpoints with heat setpoints and times of day for each day of the week. ```python schedule["Guest Bedroom"] = { "DailySchedules": [ { "DayOfWeek": 0, "Switchpoints": [ {"heatSetpoint": 14.0, "TimeOfDay": "00:00:00"}, {"heatSetpoint": 14.0, "TimeOfDay": "06:00:00"}, {"heatSetpoint": 14.0, "TimeOfDay": "08:30:00"}, {"heatSetpoint": 14.0, "TimeOfDay": "20:00:00"}, ], }, { "DayOfWeek": 1, "Switchpoints": [ {"heatSetpoint": 14.0, "TimeOfDay": "00:00:00"}, {"heatSetpoint": 14.0, "TimeOfDay": "06:00:00"}, {"heatSetpoint": 14.0, "TimeOfDay": "08:30:00"}, {"heatSetpoint": 14.0, "TimeOfDay": "20:00:00"}, ], }, { "DayOfWeek": 2, "Switchpoints": [ {"heatSetpoint": 14.0, "TimeOfDay": "00:00:00"}, {"heatSetpoint": 14.0, "TimeOfDay": "06:00:00"}, {"heatSetpoint": 14.0, "TimeOfDay": "08:30:00"}, {"heatSetpoint": 14.0, "TimeOfDay": "20:00:00"}, ], }, { "DayOfWeek": 3, "Switchpoints": [ {"heatSetpoint": 14.0, "TimeOfDay": "00:00:00"}, {"heatSetpoint": 14.0, "TimeOfDay": "06:00:00"}, {"heatSetpoint": 14.0, "TimeOfDay": "08:30:00"}, {"heatSetpoint": 14.0, "TimeOfDay": "20:00:00"}, ], }, { "DayOfWeek": 4, "Switchpoints": [ {"heatSetpoint": 14.0, "TimeOfDay": "00:00:00"}, {"heatSetpoint": 14.0, "TimeOfDay": "06:00:00"}, {"heatSetpoint": 14.0, "TimeOfDay": "08:30:00"}, {"heatSetpoint": 14.0, "TimeOfDay": "20:00:00"}, ], }, { "DayOfWeek": 5, "Switchpoints": [ {"heatSetpoint": 14.0, "TimeOfDay": "00:00:00"}, {"heatSetpoint": 14.0, "TimeOfDay": "06:00:00"}, {"heatSetpoint": 14.0, "TimeOfDay": "08:30:00"}, {"heatSetpoint": 14.0, "TimeOfDay": "20:00:00"}, ], }, { "DayOfWeek": 6, "Switchpoints": [ {"heatSetpoint": 14.0, "TimeOfDay": "00:00:00"}, {"heatSetpoint": 14.0, "TimeOfDay": "06:00:00"}, {"heatSetpoint": 14.0, "TimeOfDay": "08:30:00"}, {"heatSetpoint": 14.0, "TimeOfDay": "20:00:00"}, ], }, ] } ``` -------------------------------- ### Running Tests and Linting Source: https://github.com/zxdavb/evohome-async/blob/main/README.md Commands to execute linting, formatting checks, type checking, and tests within the development environment. Activation of the virtual environment is required, or prefix commands with 'uv run'. ```bash source .venv/bin/activate ruff check . ruff format --check . mypy pytest --cov=src --cov-report=term-missing prek run --all-files # all pre-commit hooks # Alternatively, prefix each command with "uv run" to skip activation. ``` -------------------------------- ### Configure Evohome Debug Logging Source: https://github.com/zxdavb/evohome-async/wiki/Hass:-Evohome-Debug-Logs Add this to your Home Assistant configuration.yaml to enable debug logging for the evohome component. This helps in diagnosing issues by capturing detailed information. ```yaml logger: default: info logs: homeassistant.components.evohome: debug homeassistant.components.evohome.climate: debug homeassistant.components.evohome.water_heater: debug ``` -------------------------------- ### Restore Schedules using CLI Source: https://github.com/zxdavb/evohome-async/blob/main/README.md Use the evo-client to restore schedules from a JSON file for a specific location index. The client attempts to restore access tokens by default. ```bash evo-client -u username@gmail.com -p password set-schedules --loc-idx 2 -f schedules.json ``` -------------------------------- ### Check Modified Evohome Integration Files Source: https://github.com/zxdavb/evohome-async/wiki/Hass:-Multiple-Evohome-Locations Verifies the changes made to `manifest.json` and `const.py` by displaying the relevant lines. This confirms the domain and version have been updated correctly. ```bash cat manifest.json | grep -E 'dom|ver' ``` ```bash cat const.py | grep 'DOMAIN' ``` -------------------------------- ### Configure Multiple Evohome Integrations in YAML Source: https://github.com/zxdavb/evohome-async/wiki/Hass:-Multiple-Evohome-Locations Adds configurations for multiple Evohome integrations to `configuration.yaml`. Each integration requires unique credentials or location indices to differentiate between locations. ```yaml # this account has multiple locations evohome: username: !secret TCC_USERNAME password: !secret TCC_PASSWORD location_idx: 0 # value depends upon your configuration # this secondary account has only one location evohome_1: username: !secret TCC_USERNAME_1 password: !secret TCC_PASSWORD_1 ``` -------------------------------- ### Define Kitchen Heating Schedule Source: https://github.com/zxdavb/evohome-async/blob/main/tests/tests/fixtures_v2/hass_102505/schedules.py.txt This snippet defines a daily heating schedule for the 'Kitchen' zone. It includes multiple switchpoints for different times of the day, specifying heat setpoints. Note the variation in switchpoints for weekdays versus weekends. ```python schedule = {} schedule["Kitchen"] = { "DailySchedules": [ { "DayOfWeek": 0, "Switchpoints": [ {"heatSetpoint": 19.0, "TimeOfDay": "06:30:00"}, {"heatSetpoint": 16.0, "TimeOfDay": "09:00:00"}, {"heatSetpoint": 19.0, "TimeOfDay": "17:30:00"}, {"heatSetpoint": 16.0, "TimeOfDay": "23:00:00"}, ], }, { "DayOfWeek": 1, "Switchpoints": [ {"heatSetpoint": 19.0, "TimeOfDay": "06:30:00"}, {"heatSetpoint": 16.0, "TimeOfDay": "09:00:00"}, {"heatSetpoint": 19.0, "TimeOfDay": "17:30:00"}, {"heatSetpoint": 16.0, "TimeOfDay": "23:00:00"}, ], }, { "DayOfWeek": 2, "Switchpoints": [ {"heatSetpoint": 19.0, "TimeOfDay": "06:30:00"}, {"heatSetpoint": 16.0, "TimeOfDay": "09:00:00"}, {"heatSetpoint": 19.0, "TimeOfDay": "17:30:00"}, {"heatSetpoint": 16.0, "TimeOfDay": "23:00:00"}, ], }, { "DayOfWeek": 3, "Switchpoints": [ {"heatSetpoint": 19.0, "TimeOfDay": "06:30:00"}, {"heatSetpoint": 16.0, "TimeOfDay": "09:00:00"}, {"heatSetpoint": 19.0, "TimeOfDay": "17:30:00"}, {"heatSetpoint": 16.0, "TimeOfDay": "23:00:00"}, ], }, { "DayOfWeek": 4, "Switchpoints": [ {"heatSetpoint": 19.0, "TimeOfDay": "06:30:00"}, {"heatSetpoint": 16.0, "TimeOfDay": "09:00:00"}, {"heatSetpoint": 19.0, "TimeOfDay": "17:30:00"}, {"heatSetpoint": 16.0, "TimeOfDay": "23:00:00"}, ], }, { "DayOfWeek": 5, "Switchpoints": [ {"heatSetpoint": 19.0, "TimeOfDay": "06:30:00"}, {"heatSetpoint": 19.0, "TimeOfDay": "17:30:00"}, {"heatSetpoint": 16.0, "TimeOfDay": "23:00:00"}, ], }, { "DayOfWeek": 6, "Switchpoints": [ {"heatSetpoint": 19.0, "TimeOfDay": "06:30:00"}, {"heatSetpoint": 19.0, "TimeOfDay": "17:30:00"}, {"heatSetpoint": 16.0, "TimeOfDay": "23:00:00"}, ], }, ] } ``` -------------------------------- ### Define Hab visitas Schedule Source: https://github.com/zxdavb/evohome-async/blob/main/tests/tests/fixtures_v2/hass_110047/schedules.py.txt Establishes a simple daily heating schedule for the 'Hab visitas' room. This schedule has only one switchpoint per day, maintaining a constant temperature. ```python schedule["Hab visitas"] = { "DailySchedules": [ { "DayOfWeek": 0, "Switchpoints": [{"heatSetpoint": 18.0, "TimeOfDay": "00:00:00"}], }, { "DayOfWeek": 1, "Switchpoints": [{"heatSetpoint": 18.0, "TimeOfDay": "00:00:00"}], }, { "DayOfWeek": 2, "Switchpoints": [{"heatSetpoint": 18.0, "TimeOfDay": "00:00:00"}], }, { "DayOfWeek": 3, "Switchpoints": [{"heatSetpoint": 18.0, "TimeOfDay": "00:00:00"}], }, { "DayOfWeek": 4, "Switchpoints": [{"heatSetpoint": 18.0, "TimeOfDay": "00:00:00"}], }, { "DayOfWeek": 5, "Switchpoints": [{"heatSetpoint": 18.0, "TimeOfDay": "00:00:00"}], }, { "DayOfWeek": 6, "Switchpoints": [{"heatSetpoint": 18.0, "TimeOfDay": "00:00:00"}], }, ] } ``` -------------------------------- ### Landing Room Schedule Source: https://github.com/zxdavb/evohome-async/blob/main/tests/tests/fixtures_v2/hass_102505/schedules.py.txt Defines a daily heating schedule for the Landing with a single switchpoint for the morning. ```python schedule["Landing"] = { "DailySchedules": [ { "DayOfWeek": 0, "Switchpoints": [{"heatSetpoint": 16.0, "TimeOfDay": "06:00:00"}], }, { "DayOfWeek": 1, "Switchpoints": [{"heatSetpoint": 16.0, "TimeOfDay": "06:00:00"}], }, { "DayOfWeek": 2, "Switchpoints": [{"heatSetpoint": 16.0, "TimeOfDay": "06:00:00"}], }, { "DayOfWeek": 3, "Switchpoints": [{"heatSetpoint": 16.0, "TimeOfDay": "06:00:00"}], }, { "DayOfWeek": 4, "Switchpoints": [{"heatSetpoint": 16.0, "TimeOfDay": "06:00:00"}], }, { "DayOfWeek": 5, "Switchpoints": [{"heatSetpoint": 16.0, "TimeOfDay": "06:00:00"}], }, { "DayOfWeek": 6, "Switchpoints": [{"heatSetpoint": 16.0, "TimeOfDay": "06:00:00"}], }, ] } ``` -------------------------------- ### Simplified Schedule for a Room Source: https://github.com/zxdavb/evohome-async/blob/main/tests/tests/fixtures_v2/hass_102505/schedules.py.txt Defines a simplified daily heating schedule for 'Basement Two' with only one switchpoint per day. This is useful for basic temperature maintenance at a specific time. ```python schedule["Basement Two"] = { "DailySchedules": [ { "DayOfWeek": 0, "Switchpoints": [{"heatSetpoint": 16.0, "TimeOfDay": "06:00:00"}], }, { "DayOfWeek": 1, "Switchpoints": [{"heatSetpoint": 16.0, "TimeOfDay": "06:00:00"}], }, { "DayOfWeek": 2, "Switchpoints": [{"heatSetpoint": 16.0, "TimeOfDay": "06:00:00"}], }, { "DayOfWeek": 3, "Switchpoints": [{"heatSetpoint": 16.0, "TimeOfDay": "06:00:00"}], }, { "DayOfWeek": 4, "Switchpoints": [{"heatSetpoint": 16.0, "TimeOfDay": "06:00:00"}], }, { "DayOfWeek": 5, "Switchpoints": [{"heatSetpoint": 16.0, "TimeOfDay": "06:00:00"}], }, { "DayOfWeek": 6, "Switchpoints": [{"heatSetpoint": 16.0, "TimeOfDay": "06:00:00"}], }, ] } ``` -------------------------------- ### Define Comedor Schedule Source: https://github.com/zxdavb/evohome-async/blob/main/tests/tests/fixtures_v2/hass_110047/schedules.py.txt Configures a daily heating schedule for the 'Comedor' room. It includes multiple switchpoints for weekdays and weekends, setting specific heat setpoints at different times. ```python schedule = {} schedule["Comedor"] = { "DailySchedules": [ { "DayOfWeek": 0, "Switchpoints": [ {"heatSetpoint": 20.0, "TimeOfDay": "06:00:00"}, {"heatSetpoint": 18.0, "TimeOfDay": "08:00:00"}, {"heatSetpoint": 20.0, "TimeOfDay": "18:00:00"}, {"heatSetpoint": 18.0, "TimeOfDay": "20:00:00"}, ], }, { "DayOfWeek": 1, "Switchpoints": [ {"heatSetpoint": 20.0, "TimeOfDay": "06:00:00"}, {"heatSetpoint": 18.0, "TimeOfDay": "08:00:00"}, {"heatSetpoint": 20.0, "TimeOfDay": "18:00:00"}, {"heatSetpoint": 18.0, "TimeOfDay": "20:00:00"}, ], }, { "DayOfWeek": 2, "Switchpoints": [ {"heatSetpoint": 20.0, "TimeOfDay": "06:00:00"}, {"heatSetpoint": 18.0, "TimeOfDay": "08:00:00"}, {"heatSetpoint": 20.0, "TimeOfDay": "18:00:00"}, {"heatSetpoint": 18.0, "TimeOfDay": "20:00:00"}, ], }, { "DayOfWeek": 3, "Switchpoints": [ {"heatSetpoint": 20.0, "TimeOfDay": "06:00:00"}, {"heatSetpoint": 18.0, "TimeOfDay": "08:00:00"}, {"heatSetpoint": 20.0, "TimeOfDay": "18:00:00"}, {"heatSetpoint": 18.0, "TimeOfDay": "20:00:00"}, ], }, { "DayOfWeek": 4, "Switchpoints": [ {"heatSetpoint": 20.0, "TimeOfDay": "06:00:00"}, {"heatSetpoint": 18.0, "TimeOfDay": "08:00:00"}, {"heatSetpoint": 20.0, "TimeOfDay": "18:00:00"}, {"heatSetpoint": 18.0, "TimeOfDay": "20:00:00"}, ], }, { "DayOfWeek": 5, "Switchpoints": [ {"heatSetpoint": 20.0, "TimeOfDay": "08:00:00"}, {"heatSetpoint": 18.0, "TimeOfDay": "20:00:00"}, ], }, { "DayOfWeek": 6, "Switchpoints": [ {"heatSetpoint": 20.0, "TimeOfDay": "08:00:00"}, {"heatSetpoint": 18.0, "TimeOfDay": "20:00:00"}, ], }, ] } ``` -------------------------------- ### Search Evohome Debug Logs Source: https://github.com/zxdavb/evohome-async/wiki/Hass:-Evohome-Debug-Logs After enabling debug logging and restarting Home Assistant, use this command to filter the log file for evohome-related messages. This helps in quickly locating relevant information for troubleshooting. ```bash cat ~/.homeassistant/home-assistant.log | grep evohome ``` -------------------------------- ### Verify Code Changes with Ruff and Mypy Source: https://github.com/zxdavb/evohome-async/blob/main/CLAUDE.md After making code changes, run these commands to check for linting errors, formatting issues, and type errors. ```bash ruff check . ruff format --check . mypy ``` -------------------------------- ### Define Basement One Heating Schedule Source: https://github.com/zxdavb/evohome-async/blob/main/tests/tests/fixtures_v2/hass_102505/schedules.py.txt This snippet defines a simple daily heating schedule for the 'Basement One' zone. It sets a single heat setpoint for each day of the week at 06:00:00. ```python schedule["Basement One"] = { "DailySchedules": [ { "DayOfWeek": 0, "Switchpoints": [{"heatSetpoint": 16.0, "TimeOfDay": "06:00:00"}], }, { "DayOfWeek": 1, "Switchpoints": [{"heatSetpoint": 16.0, "TimeOfDay": "06:00:00"}], }, { "DayOfWeek": 2, "Switchpoints": [{"heatSetpoint": 16.0, "TimeOfDay": "06:00:00"}], }, { "DayOfWeek": 3, "Switchpoints": [{"heatSetpoint": 16.0, "TimeOfDay": "06:00:00"}], }, { "DayOfWeek": 4, "Switchpoints": [{"heatSetpoint": 16.0, "TimeOfDay": "06:00:00"}], }, { "DayOfWeek": 5, "Switchpoints": [{"heatSetpoint": 16.0, "TimeOfDay": "06:00:00"}], }, { "DayOfWeek": 6, "Switchpoints": [{"heatSetpoint": 16.0, "TimeOfDay": "06:00:00"}], }, ] } ``` -------------------------------- ### Evohome Daily Schedule Structure Source: https://github.com/zxdavb/evohome-async/blob/main/tests/tests/fixtures_v2/hass_102505/schedules.py.txt Defines a daily heating schedule for a room, including switchpoints with specific heat setpoints and times of day. This structure is used for configuring heating patterns. ```python schedule["Sues Bedroom"] = { "DailySchedules": [ { "DayOfWeek": 0, "Switchpoints": [ {"heatSetpoint": 14.0, "TimeOfDay": "00:00:00"}, {"heatSetpoint": 20.0, "TimeOfDay": "06:00:00"}, {"heatSetpoint": 14.0, "TimeOfDay": "08:30:00"}, {"heatSetpoint": 20.0, "TimeOfDay": "20:00:00"}, ], }, { "DayOfWeek": 1, "Switchpoints": [ {"heatSetpoint": 14.0, "TimeOfDay": "00:00:00"}, {"heatSetpoint": 20.0, "TimeOfDay": "06:00:00"}, {"heatSetpoint": 14.0, "TimeOfDay": "08:30:00"}, {"heatSetpoint": 20.0, "TimeOfDay": "20:00:00"}, ], }, { "DayOfWeek": 2, "Switchpoints": [ {"heatSetpoint": 14.0, "TimeOfDay": "00:00:00"}, {"heatSetpoint": 20.0, "TimeOfDay": "06:00:00"}, {"heatSetpoint": 14.0, "TimeOfDay": "08:30:00"}, {"heatSetpoint": 20.0, "TimeOfDay": "20:00:00"}, ], }, { "DayOfWeek": 3, "Switchpoints": [ {"heatSetpoint": 14.0, "TimeOfDay": "00:00:00"}, {"heatSetpoint": 20.0, "TimeOfDay": "06:00:00"}, {"heatSetpoint": 14.0, "TimeOfDay": "08:30:00"}, {"heatSetpoint": 20.0, "TimeOfDay": "20:00:00"}, ], }, { "DayOfWeek": 4, "Switchpoints": [ {"heatSetpoint": 14.0, "TimeOfDay": "00:00:00"}, {"heatSetpoint": 20.0, "TimeOfDay": "06:00:00"}, {"heatSetpoint": 14.0, "TimeOfDay": "08:30:00"}, {"heatSetpoint": 20.0, "TimeOfDay": "20:00:00"}, ], }, { "DayOfWeek": 5, "Switchpoints": [ {"heatSetpoint": 14.0, "TimeOfDay": "00:00:00"}, {"heatSetpoint": 20.0, "TimeOfDay": "06:00:00"}, {"heatSetpoint": 14.0, "TimeOfDay": "08:30:00"}, {"heatSetpoint": 20.0, "TimeOfDay": "20:00:00"}, ], }, { "DayOfWeek": 6, "Switchpoints": [ {"heatSetpoint": 14.0, "TimeOfDay": "00:00:00"}, {"heatSetpoint": 20.0, "TimeOfDay": "06:00:00"}, {"heatSetpoint": 14.0, "TimeOfDay": "08:30:00"}, {"heatSetpoint": 20.0, "TimeOfDay": "20:00:00"}, ], }, ] } ``` -------------------------------- ### Dining Room Schedule Source: https://github.com/zxdavb/evohome-async/blob/main/tests/tests/fixtures_v2/hass_102505/schedules.py.txt Defines a daily heating schedule for the Dining room with multiple switchpoints for different times of the day. ```python schedule["Dining room"] = { "DailySchedules": [ { "DayOfWeek": 0, "Switchpoints": [ {"heatSetpoint": 19.0, "TimeOfDay": "06:30:00"}, {"heatSetpoint": 14.0, "TimeOfDay": "09:00:00"}, {"heatSetpoint": 21.0, "TimeOfDay": "17:30:00"}, {"heatSetpoint": 14.0, "TimeOfDay": "23:00:00"}, ], }, { "DayOfWeek": 1, "Switchpoints": [ {"heatSetpoint": 19.0, "TimeOfDay": "06:30:00"}, {"heatSetpoint": 14.0, "TimeOfDay": "09:00:00"}, {"heatSetpoint": 21.0, "TimeOfDay": "17:30:00"}, {"heatSetpoint": 14.0, "TimeOfDay": "23:00:00"}, ], }, { "DayOfWeek": 2, "Switchpoints": [ {"heatSetpoint": 19.0, "TimeOfDay": "06:30:00"}, {"heatSetpoint": 14.0, "TimeOfDay": "09:00:00"}, {"heatSetpoint": 21.0, "TimeOfDay": "17:30:00"}, {"heatSetpoint": 14.0, "TimeOfDay": "23:00:00"}, ], }, { "DayOfWeek": 3, "Switchpoints": [ {"heatSetpoint": 19.0, "TimeOfDay": "06:30:00"}, {"heatSetpoint": 14.0, "TimeOfDay": "09:00:00"}, {"heatSetpoint": 21.0, "TimeOfDay": "17:30:00"}, {"heatSetpoint": 14.0, "TimeOfDay": "23:00:00"}, ], }, { "DayOfWeek": 4, "Switchpoints": [ {"heatSetpoint": 19.0, "TimeOfDay": "06:30:00"}, {"heatSetpoint": 14.0, "TimeOfDay": "09:00:00"}, {"heatSetpoint": 21.0, "TimeOfDay": "17:30:00"}, {"heatSetpoint": 14.0, "TimeOfDay": "23:00:00"}, ], }, { "DayOfWeek": 5, "Switchpoints": [ {"heatSetpoint": 19.0, "TimeOfDay": "06:30:00"}, {"heatSetpoint": 21.0, "TimeOfDay": "17:30:00"}, {"heatSetpoint": 14.0, "TimeOfDay": "23:00:00"}, ], }, { "DayOfWeek": 6, "Switchpoints": [ {"heatSetpoint": 19.0, "TimeOfDay": "06:30:00"}, {"heatSetpoint": 21.0, "TimeOfDay": "17:30:00"}, {"heatSetpoint": 14.0, "TimeOfDay": "23:00:00"}, ], }, ] } ``` -------------------------------- ### Define Cocina Schedule Source: https://github.com/zxdavb/evohome-async/blob/main/tests/tests/fixtures_v2/hass_110047/schedules.py.txt Sets up a daily heating schedule for the 'Cocina' room. This schedule has fewer switchpoints, defining only two temperature changes per day. ```python schedule["Cocina"] = { "DailySchedules": [ { "DayOfWeek": 0, "Switchpoints": [ {"heatSetpoint": 18.0, "TimeOfDay": "06:30:00"}, {"heatSetpoint": 17.0, "TimeOfDay": "22:30:00"}, ], }, { "DayOfWeek": 1, "Switchpoints": [ {"heatSetpoint": 18.0, "TimeOfDay": "06:30:00"}, {"heatSetpoint": 17.0, "TimeOfDay": "22:30:00"}, ], }, { "DayOfWeek": 2, "Switchpoints": [ {"heatSetpoint": 18.0, "TimeOfDay": "06:30:00"}, {"heatSetpoint": 17.0, "TimeOfDay": "22:30:00"}, ], }, { "DayOfWeek": 3, "Switchpoints": [ {"heatSetpoint": 18.0, "TimeOfDay": "06:30:00"}, {"heatSetpoint": 17.0, "TimeOfDay": "22:30:00"}, ], }, { "DayOfWeek": 4, "Switchpoints": [ {"heatSetpoint": 18.0, "TimeOfDay": "06:30:00"}, {"heatSetpoint": 17.0, "TimeOfDay": "22:30:00"}, ], }, { "DayOfWeek": 5, "Switchpoints": [ {"heatSetpoint": 18.0, "TimeOfDay": "06:30:00"}, {"heatSetpoint": 17.0, "TimeOfDay": "22:30:00"}, ], }, { "DayOfWeek": 6, "Switchpoints": [ {"heatSetpoint": 18.0, "TimeOfDay": "06:30:00"}, {"heatSetpoint": 17.0, "TimeOfDay": "22:30:00"}, ], }, ] } ``` -------------------------------- ### Report Evohome Active Faults Source: https://github.com/zxdavb/evohome-async/wiki/Hass:-Evohome-Debug-Logs When reporting issues, include any active fault warnings found in your logs. These warnings indicate specific problems with zones or actuators. ```log 2024-08-01 22:15:50.524 WARNING (MainThread) [evohomeasync2] Active fault: Zone(id='3432576'): TempZoneActuatorCommunicationLost, since 2022-03-02T15:56:01 2024-08-01 22:15:50.524 WARNING (MainThread) [evohomeasync2] Active fault: Zone(id='3432577'): TempZoneActuatorLowBattery, since 2022-03-02T04:50:20 ``` -------------------------------- ### Define 'Hab Mapi' Daily Heating Schedule Source: https://github.com/zxdavb/evohome-async/blob/main/tests/tests/fixtures_v2/hass_110047/schedules.py.txt This snippet defines a daily heating schedule named 'Hab Mapi'. It includes switchpoints for each day of the week, specifying heat setpoints at different times. Note the varied setpoint on Thursday at 18:30. ```python schedule["Hab Mapi"] = { "DailySchedules": [ { "DayOfWeek": 0, "Switchpoints": [ {"heatSetpoint": 21.0, "TimeOfDay": "00:00:00"}, {"heatSetpoint": 18.0, "TimeOfDay": "08:00:00"}, {"heatSetpoint": 21.0, "TimeOfDay": "18:30:00"}, ], }, { "DayOfWeek": 1, "Switchpoints": [ {"heatSetpoint": 21.0, "TimeOfDay": "00:00:00"}, {"heatSetpoint": 18.0, "TimeOfDay": "08:00:00"}, {"heatSetpoint": 21.0, "TimeOfDay": "18:30:00"}, ], }, { "DayOfWeek": 2, "Switchpoints": [ {"heatSetpoint": 21.0, "TimeOfDay": "00:00:00"}, {"heatSetpoint": 18.0, "TimeOfDay": "08:00:00"}, {"heatSetpoint": 21.0, "TimeOfDay": "18:30:00"}, ], }, { "DayOfWeek": 3, "Switchpoints": [ {"heatSetpoint": 21.0, "TimeOfDay": "00:00:00"}, {"heatSetpoint": 18.0, "TimeOfDay": "08:00:00"}, {"heatSetpoint": 23.0, "TimeOfDay": "18:30:00"}, ], }, { "DayOfWeek": 4, "Switchpoints": [ {"heatSetpoint": 21.0, "TimeOfDay": "00:00:00"}, {"heatSetpoint": 18.0, "TimeOfDay": "08:00:00"}, {"heatSetpoint": 21.0, "TimeOfDay": "18:30:00"}, ], }, { "DayOfWeek": 5, "Switchpoints": [ {"heatSetpoint": 21.0, "TimeOfDay": "00:00:00"}, {"heatSetpoint": 18.0, "TimeOfDay": "08:00:00"}, {"heatSetpoint": 21.0, "TimeOfDay": "18:30:00"}, ], }, { "DayOfWeek": 6, "Switchpoints": [ {"heatSetpoint": 21.0, "TimeOfDay": "00:00:00"}, {"heatSetpoint": 18.0, "TimeOfDay": "08:00:00"}, {"heatSetpoint": 21.0, "TimeOfDay": "18:30:00"}, ], }, ] } ``` -------------------------------- ### Modify Evohome Integration Manifest and Const Source: https://github.com/zxdavb/evohome-async/wiki/Hass:-Multiple-Evohome-Locations Modifies the `manifest.json` and `const.py` files to rename the integration's domain to `evohome_1` and add a version number. This is crucial for creating a distinct custom integration. ```bash cd /config/custom_components/evohome_1 sed -i '/domain/ s/evohome/evohome_1/' manifest.json sed -i '/{/a "version": "0.0.1",' manifest.json sed -i '/DOMAIN/ s/evohome/evohome_1/' const.py ```