### Installation and Usage Source: https://github.com/signalkraft/mypyllant/blob/main/README.md Instructions on how to install and use the myPyllant library via pip or Docker, and command-line examples for exporting system data and energy reports. ```APIDOC ## Installation Requires Python 3.10 or higher. ```shell pip install myPyllant # Optional, for systems without a timezone database (e.g., Windows): pip install tzdata ``` Alternatively, use Docker: ```shell docker run -ti ghcr.io/signalkraft/mypyllant:latest uv run -m myPyllant.export user password brand --country country ``` ## Usage ### Exporting System Data Exports information about your system as JSON. Use `--data` to export historical data. ```bash python3 -m myPyllant.export user password brand --country country # For more options, see: python3 -m myPyllant.export -h ``` ### Exporting Energy Reports Generates CSV reports for each heat generator, defaulting to the current year. Specify `--year` for a different year. ```bash python3 -m myPyllant.report user password brand --country country # Example output: # Wrote 2023 report to energy_data_2023_ArothermPlus_XYZ.csv # Wrote 2023 report to energy_data_2023_HydraulicStation_XYZ.csv ``` ``` -------------------------------- ### Setup Development Environment Source: https://github.com/signalkraft/mypyllant/blob/main/README.md Commands to clone the repository and initialize the pre-commit hooks and testing environment. ```shell git clone https://github.com/signalkraft/myPyllant.git cd myPyllant uv tool install pre-commit --with pre-commit-uv pre-commit install uv run pytest ``` -------------------------------- ### Install myPyllant Source: https://github.com/signalkraft/mypyllant/blob/main/README.md Install the myPyllant library using pip. On Windows or systems without a timezone database, also install tzdata. ```shell pip install myPyllant # Only on Windows, and other systems without a timezone database: pip install tzdata ``` -------------------------------- ### Interact with myPyllant API in Python Source: https://github.com/signalkraft/mypyllant/blob/main/README.md Example Python script demonstrating how to use the MyPyllantAPI to interact with Vaillant systems. It covers setting temperatures, quick veto, holiday mode, and domestic hot water boosts. ```python #!/usr/bin/env python3 import argparse import asyncio import logging from datetime import datetime, timedelta from myPyllant.api import MyPyllantAPI from myPyllant.const import ALL_COUNTRIES, BRANDS, DEFAULT_BRAND parser = argparse.ArgumentParser(description="Export data from myVaillant API .") parser.add_argument("user", help="Username (email address) for the myVaillant app") parser.add_argument("password", help="Password for the myVaillant app") parser.add_argument( "brand", help="Brand your account is registered in, i.e. 'vaillant'", default=DEFAULT_BRAND, choices=BRANDS.keys(), ) parser.add_argument( "--country", help="Country your account is registered in, i.e. 'germany'", choices=ALL_COUNTRIES.keys(), required=False, ) parser.add_argument( "-v", "--verbose", help="increase output verbosity", action="store_true" ) async def main(user, password, brand, country): async with MyPyllantAPI(user, password, brand, country) as api: async for system in api.get_systems(): if not system.zones: print(f"Skipping {system} because there are no active zones") continue print(await api.set_set_back_temperature(system.zones[0], 18)) print(await api.quick_veto_zone_temperature(system.zones[0], 21, 5)) print(await api.cancel_quick_veto_zone_temperature(system.zones[0])) setpoint = 10.0 if system.control_identifier.is_vrc700 else None print( await api.set_holiday( system, datetime.now(system.timezone), datetime.now(system.timezone) + timedelta(days=7), setpoint, # Setpoint is only required for VRC700 systems ) ) print(await api.cancel_holiday(system)) if system.domestic_hot_water: print(await api.boost_domestic_hot_water(system.domestic_hot_water[0])) print(await api.cancel_hot_water_boost(system.domestic_hot_water[0])) print( await api.set_domestic_hot_water_temperature( system.domestic_hot_water[0], 46 ) ) if __name__ == "__main__": args = parser.parse_args() if args.verbose: logging.basicConfig(level=logging.DEBUG) asyncio.run(main(args.user, args.password, args.brand, args.country)) ``` -------------------------------- ### Python API Usage Source: https://github.com/signalkraft/mypyllant/blob/main/README.md Example of how to use the myPyllant API within a Python script to interact with your heating system. ```APIDOC ## Using the API in Python This example demonstrates how to authenticate, retrieve system information, and control various aspects of your heating system using the `myPyllant` library. ### Authentication and System Retrieval ```python #!/usr/bin/env python3 import argparse import asyncio import logging from datetime import datetime, timedelta from myPyllant.api import MyPyllantAPI from myPyllant.const import ALL_COUNTRIES, BRANDS, DEFAULT_BRAND parser = argparse.ArgumentParser(description="Export data from myVaillant API .") parser.add_argument("user", help="Username (email address) for the myVaillant app") parser.add_argument("password", help="Password for the myVaillant app") parser.add_argument( "brand", help="Brand your account is registered in, i.e. 'vaillant'", default=DEFAULT_BRAND, choices=BRANDS.keys(), ) parser.add_argument( "--country", help="Country your account is registered in, i.e. 'germany'", choices=ALL_COUNTRIES.keys(), required=False, ) parser.add_argument( "-v", "--verbose", help="increase output verbosity", action="store_true" ) async def main(user, password, brand, country): async with MyPyllantAPI(user, password, brand, country) as api: async for system in api.get_systems(): if not system.zones: print(f"Skipping {system} because there are no active zones") continue print(await api.set_set_back_temperature(system.zones[0], 18)) print(await api.quick_veto_zone_temperature(system.zones[0], 21, 5)) print(await api.cancel_quick_veto_zone_temperature(system.zones[0])) setpoint = 10.0 if system.control_identifier.is_vrc700 else None print( await api.set_holiday( system, datetime.now(system.timezone), datetime.now(system.timezone) + timedelta(days=7), setpoint, # Setpoint is only required for VRC700 systems ) ) print(await api.cancel_holiday(system)) if system.domestic_hot_water: print(await api.boost_domestic_hot_water(system.domestic_hot_water[0])) print(await api.cancel_hot_water_boost(system.domestic_hot_water[0])) print( await api.set_domestic_hot_water_temperature( system.domestic_hot_water[0], 46 ) ) if __name__ == "__main__": args = parser.parse_args() if args.verbose: logging.basicConfig(level=logging.DEBUG) asyncio.run(main(args.user, args.password, args.brand, args.country)) ``` ``` -------------------------------- ### Fetch Homes and System Data Source: https://context7.com/signalkraft/mypyllant/llms.txt Retrieve detailed information about heating installations, including zones, devices, and optional telemetry data like power consumption and runtime statistics. ```python import asyncio from myPyllant.api import MyPyllantAPI async def fetch_system_data(): async with MyPyllantAPI("user@example.com", "password", "vaillant", "germany") as api: # Get all homes async for home in api.get_homes(): print(f"Home: {home.home_name} ({home.nomenclature})") print(f"System ID: {home.system_id}") print(f"Country: {home.country_code}") print(f"Timezone: {home.timezone}") # Get systems with all optional data async for system in api.get_systems( include_connection_status=True, include_diagnostic_trouble_codes=True, include_rts=True, # Runtime statistics (on/off cycles, operation time) include_mpc=True, # Live power consumption include_ambisense_rooms=True, include_energy_management=True, include_eebus=True ): print(f"\nSystem: {system.system_name}") print(f"Brand: {system.brand_name}") print(f"Connected: {system.connected}") print(f"Controller: {system.control_identifier}") print(f"Outdoor temp: {system.outdoor_temperature}°C") print(f"24h avg temp: {system.outdoor_temperature_average_24h}°C") print(f"Water pressure: {system.water_pressure} bar") print(f"System flow temp: {system.system_flow_temperature}°C") # Access zones for zone in system.zones: print(f"\n Zone: {zone.name}") print(f" Current temp: {zone.current_room_temperature}°C") print(f" Desired temp: {zone.desired_room_temperature_setpoint}°C") print(f" Humidity: {zone.current_room_humidity}%") print(f" Heating mode: {zone.heating.operation_mode_heating}") print(f" Active: {zone.is_active}") # Access devices for device in system.devices: print(f"\n Device: {device.name_display}") print(f" Type: {device.device_type}") print(f" Serial: {device.device_serial_number}") print(f" Current power: {device.current_power} W") print(f" On/off cycles: {device.on_off_cycles}") print(f" Operation time: {device.operation_time} h") asyncio.run(fetch_system_data()) ``` -------------------------------- ### Initialize the MyPyllantAPI Client Source: https://context7.com/signalkraft/mypyllant/llms.txt Use the MyPyllantAPI class as an async context manager to handle authentication and establish a connection to the Vaillant API. ```python import asyncio from myPyllant.api import MyPyllantAPI from myPyllant.const import BRANDS, ALL_COUNTRIES # Basic initialization with async context manager async def main(): async with MyPyllantAPI( username="user@example.com", password="your_password", brand="vaillant", # Options: vaillant, sdbg, bulex, glow-worm, demirdokum country="germany" # See ALL_COUNTRIES for full list ) as api: # API is now authenticated and ready to use async for system in api.get_systems(): print(f"Found system: {system.system_name}") print(f"Outdoor temperature: {system.outdoor_temperature}°C") print(f"Water pressure: {system.water_pressure} bar") asyncio.run(main()) ``` -------------------------------- ### Export System Data and Reports via CLI Source: https://context7.com/signalkraft/mypyllant/llms.txt Use command-line tools to export system information, historical data, and energy reports. ```bash # Export system information as JSON python3 -m myPyllant.export user@example.com password vaillant --country germany # Export with historical device data python3 -m myPyllant.export user@example.com password vaillant --country germany --data # Export with specific date range and resolution python3 -m myPyllant.export user@example.com password vaillant --country germany \ --data --resolution DAY --start 2024-01-01 --end 2024-01-31 # Generate yearly energy reports as CSV files python3 -m myPyllant.report user@example.com password vaillant --country germany --year 2024 # Output: energy_data_2024_ArothermPlus_ABC123.csv # Using Docker docker run -ti ghcr.io/signalkraft/mypyllant:latest \ uv run -m myPyllant.export user@example.com password vaillant --country germany ``` -------------------------------- ### Control Ambisense Room Thermostats Source: https://context7.com/signalkraft/mypyllant/llms.txt Demonstrates how to retrieve room status and apply operations like quick veto, manual mode setpoints, and operation mode changes. ```python import asyncio from myPyllant.api import MyPyllantAPI from myPyllant.enums import AmbisenseRoomOperationMode async def ambisense_control(): async with MyPyllantAPI("user@example.com", "password", "vaillant", "germany") as api: async for system in api.get_systems(include_ambisense_rooms=True): if not system.ambisense_capability: print("System does not support Ambisense") continue for room in system.ambisense_rooms: print(f"\nRoom: {room.name}") print(f"Current temp: {room.room_configuration.current_temperature}°C") print(f"Setpoint: {room.room_configuration.temperature_setpoint}°C") print(f"Humidity: {room.room_configuration.current_humidity}%") print(f"Mode: {room.room_configuration.operation_mode}") print(f"Window state: {room.room_configuration.window_state}") # Set room operation mode await api.set_ambisense_room_operation_mode( room=room, mode=AmbisenseRoomOperationMode.AUTO ) # Quick veto for room (minimum 30 minutes) await api.quick_veto_ambisense_room( room=room, temperature=22.0, duration_minutes=120 ) print(f"Room quick veto set, ends: {room.room_configuration.quick_veto_end_time}") # Cancel room quick veto await api.cancel_quick_veto_ambisense_room(room) # Set manual mode temperature await api.set_ambisense_room_manual_mode_setpoint_temperature( room=room, temperature=21.0 ) asyncio.run(ambisense_control()) ``` -------------------------------- ### Authentication and Initialization Source: https://context7.com/signalkraft/mypyllant/llms.txt Initializes the MyPyllantAPI client using OAuth2/OIDC credentials to establish a session with the myVAILLANT API. ```APIDOC ## Initialization ### Description Initializes the API client using an async context manager to handle authentication and session management. ### Parameters #### Request Body - **username** (string) - Required - The user email address. - **password** (string) - Required - The user password. - **brand** (string) - Required - The brand identifier (vaillant, sdbg, bulex, glow-worm, demirdokum). - **country** (string) - Required - The country code for the account region. ``` -------------------------------- ### Enable and Manage EEBUS Integration Source: https://context7.com/signalkraft/mypyllant/llms.txt Demonstrates how to retrieve system EEBUS status and toggle the interface state using the MyPyllantAPI. ```python import asyncio from myPyllant.api import MyPyllantAPI async def eebus_example(): async with MyPyllantAPI("user@example.com", "password", "vaillant", "germany") as api: async for system in api.get_systems(include_eebus=True, include_energy_management=True): # Check EEBUS status if system.eebus: print(f"EEBUS info: {system.eebus}") print(f"Spine enabled: {system.eebus.get('spline_enabled')}") # Energy management state if system.energy_management: print(f"Energy management: {system.energy_management}") print(f"Energy manager state: {system.energy_manager_state}") # Enable EEBUS interface await api.toggle_eebus(system, enabled=True) print("EEBUS enabled") # Disable EEBUS await api.toggle_eebus(system, enabled=False) print("EEBUS disabled") asyncio.run(eebus_example()) ``` -------------------------------- ### Control Cooling Mode Settings Source: https://context7.com/signalkraft/mypyllant/llms.txt Shows how to check cooling support and apply cooling schedules, accounting for differences between VRC700 and TLI controller types. ```python import asyncio from datetime import datetime, timedelta from myPyllant.api import MyPyllantAPI async def cooling_example(): async with MyPyllantAPI("user@example.com", "password", "vaillant", "germany") as api: async for system in api.get_systems(): # Check cooling support print(f"Cooling allowed: {system.is_cooling_allowed}") print(f"Manual cooling ongoing: {system.manual_cooling_ongoing}") print(f"Manual cooling days remaining: {system.manual_cooling_days}") if system.is_cooling_allowed: # Set cooling for a number of days if system.control_identifier.is_vrc700: # VRC700 uses duration_days await api.set_cooling_for_days( system=system, duration_days=7 ) else: # TLI uses start/end dates await api.set_cooling_for_days( system=system, start=datetime.now(system.timezone), end=datetime.now(system.timezone) + timedelta(days=7) ) print("Cooling mode activated") # Cancel cooling mode await api.cancel_cooling_for_days(system) print("Cooling mode cancelled") # Set time-controlled cooling setpoint for zones for zone in system.zones: if zone.is_cooling_allowed_circuit: await api.set_time_controlled_cooling_setpoint( zone=zone, temperature=24.0 ) asyncio.run(cooling_example()) ``` -------------------------------- ### Run myPyllant CLI with Docker Source: https://github.com/signalkraft/mypyllant/blob/main/README.md Use Docker to run myPyllant as a CLI tool for exporting data. Replace user, password, brand, and country with your credentials. ```shell docker run -ti ghcr.io/signalkraft/mypyllant:latest uv run -m myPyllant.export user password brand --country country ``` -------------------------------- ### Fetching Homes and Systems Source: https://context7.com/signalkraft/mypyllant/llms.txt Retrieves information about configured homes and detailed system data including zones, devices, and runtime statistics. ```APIDOC ## GET /homes ### Description Retrieves a list of all homes associated with the authenticated account. ## GET /systems ### Description Retrieves detailed information about heating systems, including zones, domestic hot water, and device status. ### Query Parameters - **include_connection_status** (boolean) - Optional - Include connection status. - **include_diagnostic_trouble_codes** (boolean) - Optional - Include diagnostic trouble codes. - **include_rts** (boolean) - Optional - Include runtime statistics. - **include_mpc** (boolean) - Optional - Include live power consumption. - **include_ambisense_rooms** (boolean) - Optional - Include Ambisense room data. - **include_energy_management** (boolean) - Optional - Include energy management data. - **include_eebus** (boolean) - Optional - Include EEBUS data. ``` -------------------------------- ### Configure Heating Circuit Curves Source: https://context7.com/signalkraft/mypyllant/llms.txt Shows how to read circuit state and update heating curve parameters, minimum flow temperatures, and heat demand limits. ```python import asyncio from myPyllant.api import MyPyllantAPI async def circuit_configuration(): async with MyPyllantAPI("user@example.com", "password", "vaillant", "germany") as api: async for system in api.get_systems(): for circuit in system.circuits: print(f"\nCircuit {circuit.index}:") print(f"State: {circuit.circuit_state}") print(f"Flow temperature: {circuit.current_circuit_flow_temperature}°C") print(f"Flow setpoint: {circuit.heating_circuit_flow_setpoint}°C") print(f"Heating curve: {circuit.heating_curve}") print(f"Min flow temp: {circuit.heating_flow_temperature_minimum_setpoint}°C") print(f"Max flow temp: {circuit.heating_flow_temperature_maximum_setpoint}°C") print(f"Heat demand limit temp: {circuit.heat_demand_limited_by_outside_temperature}°C") # Adjust heating curve (affects flow temperature calculation) await api.set_circuit_heating_curve( circuit=circuit, heating_curve=0.8 # Typical range: 0.2 - 1.5 ) # Set minimum flow temperature await api.set_circuit_min_flow_temperature_setpoint( circuit=circuit, min_flow_temperature_setpoint=25.0 ) # Set heat demand outdoor temperature limit await api.set_circuit_heat_demand_limited_by_outside_temperature( circuit=circuit, heat_demand_limited_by_outside_temperature=18.0 ) asyncio.run(circuit_configuration()) ``` -------------------------------- ### Check Supported Countries Source: https://github.com/signalkraft/mypyllant/blob/main/README.md Run the script to identify supported countries and brands within the myVAILLANT OIDC configuration. ```shell uv run -m myPyllant.tests.find_countries ``` -------------------------------- ### Export System Data using myPyllant CLI Source: https://github.com/signalkraft/mypyllant/blob/main/README.md Export system information or historical data using the myPyllant command-line interface. Use -h for more options and a list of countries. ```bash python3 -m myPyllant.export user password brand --country country # See python3 -m myPyllant.export -h for more options and a list of countries ``` -------------------------------- ### Manage Heating Zone Time Programs Source: https://context7.com/signalkraft/mypyllant/llms.txt Access and update heating schedules and setpoints for specific zones. ```python import asyncio from myPyllant.api import MyPyllantAPI from myPyllant.models import ZoneTimeProgram, ZoneTimeProgramDay async def time_program_example(): async with MyPyllantAPI("user@example.com", "password", "vaillant", "germany") as api: async for system in api.get_systems(): for zone in system.zones: # Access existing time program time_program = zone.heating.time_program_heating if time_program and time_program.has_time_program: print(f"\nTime program for {zone.name}:") for day in time_program.weekday_names(): slots = getattr(time_program, day) for slot in slots: print(f" {day}: {slot.start_datetime_time} - " f"{slot.end_datetime_time}: {slot.setpoint}°C") # Update all setpoints in current time program to new temperature if time_program: await api.set_time_program_temperature( zone=zone, program_type="heating", temperature=21.0 ) print(f"Updated all time program setpoints to 21°C") asyncio.run(time_program_example()) ``` -------------------------------- ### Export Energy Reports using myPyllant CLI Source: https://github.com/signalkraft/mypyllant/blob/main/README.md Generate energy reports for heat generators using the myPyllant CLI. By default, it generates reports for the current year, but a specific year can be provided with the --year argument. ```bash python3 -m myPyllant.report user password brand --country country # Wrote 2023 report to energy_data_2023_ArothermPlus_XYZ.csv # Wrote 2023 report to energy_data_2023_HydraulicStation_XYZ.csv ``` -------------------------------- ### Fetch Energy Data and Device Statistics Source: https://context7.com/signalkraft/mypyllant/llms.txt Retrieves historical energy consumption data and device statistics, including runtime and live power consumption. Requires including RTS and MPC data when fetching systems. ```python import asyncio from datetime import datetime, timedelta, timezone from myPyllant.api import MyPyllantAPI from myPyllant.enums import DeviceDataBucketResolution async def fetch_energy_data(): async with MyPyllantAPI("user@example.com", "password", "vaillant", "germany") as api: async for system in api.get_systems(include_rts=True, include_mpc=True): for device in system.devices: print(f"\nDevice: {device.name_display}") print(f"Product: {device.product_name_display}") print(f"Brand: {device.brand_name}") print(f"First data: {device.first_data}") print(f"Last data: {device.last_data}") # Runtime statistics (if RTS was included) if device.rts_statistics: print(f"On/off cycles: {device.on_off_cycles}") print(f"Operation time: {device.operation_time} hours") # Live power consumption (if MPC was included) if device.current_power is not None: print(f"Current power: {device.current_power} W") # Fetch historical data end_date = datetime.now(timezone.utc) start_date = end_date - timedelta(days=30) async for device_data in api.get_data_by_device( device=device, data_resolution=DeviceDataBucketResolution.DAY, data_from=start_date, data_to=end_date ): print(f"\n Data type: {device_data.operation_mode} - {device_data.energy_type}") print(f" Total consumption: {device_data.total_consumption_rounded} kWh") print(f" Period: {device_data.start_date} to {device_data.end_date}") # Individual data buckets for bucket in device_data.data[:5]: # First 5 entries print(f" {bucket.start_date.date()}: {bucket.value:.2f} kWh") asyncio.run(fetch_energy_data()) ``` -------------------------------- ### Configure Holiday and Away Mode Source: https://context7.com/signalkraft/mypyllant/llms.txt Use set_holiday and cancel_holiday to manage heating during absences. VRC700 controllers require an additional setpoint temperature parameter. ```python import asyncio from datetime import datetime, timedelta from myPyllant.api import MyPyllantAPI async def holiday_mode_example(): async with MyPyllantAPI("user@example.com", "password", "vaillant", "germany") as api: async for system in api.get_systems(): # Set holiday mode start = datetime.now(system.timezone) end = start + timedelta(days=14) if system.control_identifier.is_vrc700: # VRC700 requires a setpoint temperature updated_system = await api.set_holiday( system=system, start=start, end=end, setpoint=15.0 # Required for VRC700 ) else: # TLI controllers don't use setpoint updated_system = await api.set_holiday( system=system, start=start, end=end ) print(f"Holiday mode set from {start} to {end}") # Check holiday status on zones for zone in updated_system.zones: print(f"Zone {zone.name}:") print(f" Holiday planned: {zone.general.holiday_planned}") print(f" Holiday ongoing: {zone.general.holiday_ongoing}") print(f" Holiday remaining: {zone.general.holiday_remaining}") # Cancel holiday mode await api.cancel_holiday(system) print("Holiday mode cancelled") asyncio.run(holiday_mode_example()) ``` -------------------------------- ### Zone Temperature Control with Quick Veto Source: https://context7.com/signalkraft/mypyllant/llms.txt Temporarily overrides zone temperature for a specified duration, bypassing the regular schedule. Requires MyPyllantAPI initialization with credentials and system details. The duration defaults to 3 hours if not specified. ```python import asyncio from myPyllant.api import MyPyllantAPI async def quick_veto_example(): async with MyPyllantAPI("user@example.com", "password", "vaillant", "germany") as api: async for system in api.get_systems(): for zone in system.zones: # Set temporary temperature override for 3 hours updated_zone = await api.quick_veto_zone_temperature( zone=zone, temperature=22.0, duration_hours=3.0 # Optional, defaults to 3 hours ) print(f"Quick veto set for {zone.name}") print(f"New setpoint: {updated_zone.desired_room_temperature_setpoint}°C") print(f"Ends at: {updated_zone.quick_veto_end_date_time}") # Check if quick veto is active if updated_zone.quick_veto_ongoing: print(f"Time remaining: {updated_zone.quick_veto_remaining}") # Update duration of existing quick veto await api.quick_veto_zone_duration(zone, duration_hours=5.0) # Cancel quick veto cancelled_zone = await api.cancel_quick_veto_zone_temperature(zone) print(f"Quick veto cancelled, special function: {cancelled_zone.current_special_function}") asyncio.run(quick_veto_example()) ``` -------------------------------- ### Control Ventilation System Source: https://context7.com/signalkraft/mypyllant/llms.txt Demonstrates setting ventilation operation modes and fan stages. Note that some controls like setting operation mode and boost are only available for non-VRC700 systems. ```python import asyncio from myPyllant.api import MyPyllantAPI from myPyllant.enums import VentilationOperationMode, VentilationFanStageType async def ventilation_control(): async with MyPyllantAPI("user@example.com", "password", "vaillant", "germany") as api: async for system in api.get_systems(): for vent in system.ventilation: print(f"Ventilation unit index: {vent.index}") print(f"Current mode: {vent.operation_mode_ventilation}") print(f"Day fan stage: {vent.maximum_day_fan_stage}") print(f"Night fan stage: {vent.maximum_night_fan_stage}") # Set operation mode (TLI only) if not vent.control_identifier.is_vrc700: await api.set_ventilation_operation_mode( vent, mode=VentilationOperationMode.TIME_CONTROLLED ) print("Ventilation set to TIME_CONTROLLED") # Set fan stage (1-6) await api.set_ventilation_fan_stage( ventilation=vent, maximum_fan_stage=4, fan_stage_type=VentilationFanStageType.DAY ) print("Day fan stage set to 4") # Set ventilation boost (TLI only) if not system.control_identifier.is_vrc700: await api.set_ventilation_boost(system) print("Ventilation boost activated") await api.cancel_ventilation_boost(system) print("Ventilation boost cancelled") asyncio.run(ventilation_control()) ``` -------------------------------- ### Generate Test Data Source: https://github.com/signalkraft/mypyllant/blob/main/README.md Commands to generate API test data for library development, either directly or via Docker. ```shell uv run -m myPyllant.tests.generate_test_data -h uv run -m myPyllant.tests.generate_test_data username password brand --country country ``` ```shell docker run -v $(pwd)/test_data:/build/src/myPyllant/tests/json -ti ghcr.io/signalkraft/mypyllant:latest uv run -m myPyllant.tests.generate_test_data username password brand --country country ``` -------------------------------- ### Generate Yearly Energy Reports Source: https://context7.com/signalkraft/mypyllant/llms.txt Generates and saves yearly energy consumption reports in CSV format. The reports are saved to files named after the report's file name attribute. ```python import asyncio from datetime import date from myPyllant.api import MyPyllantAPI async def generate_reports(): async with MyPyllantAPI("user@example.com", "password", "vaillant", "germany") as api: async for system in api.get_systems(): print(f"Generating reports for {system.system_name}") # Get reports for current year async for report in api.get_yearly_reports( system=system, year=date.today().year ): print(f"Report: {report.file_name}") # Write to file with open(report.file_name, "w") as f: f.write(report.file_content) print(f"Saved to {report.file_name}") asyncio.run(generate_reports()) ``` -------------------------------- ### Retrieve System Diagnostics and Connectivity Status Source: https://context7.com/signalkraft/mypyllant/llms.txt Check system connectivity, diagnostic trouble codes, and retrieve runtime or power consumption statistics. ```python import asyncio from myPyllant.api import MyPyllantAPI async def diagnostics_example(): async with MyPyllantAPI("user@example.com", "password", "vaillant", "germany") as api: async for system in api.get_systems( include_connection_status=True, include_diagnostic_trouble_codes=True ): print(f"System: {system.system_name}") print(f"Connected: {system.connected}") # Check for diagnostic trouble codes if system.has_diagnostic_trouble_codes: print("\nDiagnostic Trouble Codes:") for device in system.devices: if device.diagnostic_trouble_codes: print(f" {device.name_display}:") for code in device.diagnostic_trouble_codes: print(f" - {code}") # Get control identifier type control_id = await api.get_control_identifier(system) print(f"Controller type: {control_id} (VRC700: {control_id.is_vrc700})") # Get system timezone timezone = await api.get_time_zone(system) print(f"Timezone: {timezone}") # Get RTS statistics (runtime data) rts_data = await api.get_rts(system) print(f"RTS devices: {len(rts_data.get('statistics', []))}") # Get MPC data (live power consumption) mpc_data = await api.get_mpc(system) print(f"MPC devices: {len(mpc_data.get('devices', []))}") asyncio.run(diagnostics_example()) ``` -------------------------------- ### Setting Zone Operating Mode Source: https://context7.com/signalkraft/mypyllant/llms.txt Changes the heating or cooling mode of a zone between manual, time-controlled, or off. Supports different options for TLI and VRC700 controllers. Also includes setting manual mode setpoints and setback temperatures. ```python import asyncio from myPyllant.api import MyPyllantAPI from myPyllant.enums import ZoneOperatingMode, ZoneOperatingModeVRC700 async def set_operating_mode(): async with MyPyllantAPI("user@example.com", "password", "vaillant", "germany") as api: async for system in api.get_systems(): for zone in system.zones: # For TLI controllers if not zone.control_identifier.is_vrc700: # Options: MANUAL, TIME_CONTROLLED, OFF await api.set_zone_operating_mode( zone=zone, mode=ZoneOperatingMode.TIME_CONTROLLED, operating_type="heating" # or "cooling" ) print(f"Set {zone.name} to TIME_CONTROLLED mode") # For VRC700 controllers else: # Options: DAY, AUTO, SET_BACK, OFF await api.set_zone_operating_mode( zone=zone, mode=ZoneOperatingModeVRC700.AUTO, operating_type="heating" ) print(f"Set {zone.name} to AUTO mode (VRC700)") # Set manual mode temperature await api.set_manual_mode_setpoint( zone=zone, temperature=20.0, setpoint_type="heating" ) # Set setback temperature (used in away mode) await api.set_set_back_temperature( zone=zone, temperature=16.0 ) asyncio.run(set_operating_mode()) ``` -------------------------------- ### Manage Domestic Hot Water Source: https://context7.com/signalkraft/mypyllant/llms.txt Control hot water temperature, boost status, and operation modes. Note that temperature setpoints must be provided as integers. ```python import asyncio from myPyllant.api import MyPyllantAPI from myPyllant.enums import DHWOperationMode, DHWOperationModeVRC700 async def hot_water_control(): async with MyPyllantAPI("user@example.com", "password", "vaillant", "germany") as api: async for system in api.get_systems(): for dhw in system.domestic_hot_water: print(f"Hot water unit index: {dhw.index}") print(f"Current temperature: {dhw.current_dhw_temperature}°C") print(f"Setpoint: {dhw.tapping_setpoint}°C") print(f"Min/Max: {dhw.min_setpoint}°C - {dhw.max_setpoint}°C") print(f"Operation mode: {dhw.operation_mode_dhw}") print(f"Boosting: {dhw.is_cylinder_boosting}") # Set hot water temperature (integers only) await api.set_domestic_hot_water_temperature(dhw, temperature=50) print("Hot water setpoint updated to 50°C") # Start hot water boost boosted_dhw = await api.boost_domestic_hot_water(dhw) print(f"Boost activated: {boosted_dhw.is_cylinder_boosting}") # Cancel boost await api.cancel_hot_water_boost(dhw) print("Boost cancelled") # Set operation mode if dhw.control_identifier.is_vrc700: await api.set_domestic_hot_water_operation_mode( dhw, mode=DHWOperationModeVRC700.AUTO ) else: await api.set_domestic_hot_water_operation_mode( dhw, mode=DHWOperationMode.TIME_CONTROLLED ) asyncio.run(hot_water_control()) ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.