### Climate Presets Example Source: https://github.com/oyvindwe/connectlife-ha/blob/main/custom_components/connectlife/data_dictionaries/README.md Example of how to expose 'eco' as a preset for a climate entity to allow users to switch the device into Eco mode. ```yaml climate: presets: - preset: eco t_work_mode: 5 ``` -------------------------------- ### Base File Declaring Start, Stop, and Pause Buttons Source: https://github.com/oyvindwe/connectlife-ha/blob/main/custom_components/connectlife/data_dictionaries/README.md This example shows how to declare base button entities for start, stop, and pause actions. It includes icon definitions, availability conditions based on the 'Remote_control_monitoring_set_commands_actions' property, and the specific 'Actions' values to be written to the device. ```yaml # 015.yaml (base) buttons: - key: start icon: mdi:play available_when: Remote_control_monitoring_set_commands_actions: 2 write: Actions: 2 - key: stop icon: mdi:stop write: Actions: 1 - key: pause icon: mdi:pause available_when: Remote_control_monitoring_set_commands_actions: 2 write: Actions: 3 ``` -------------------------------- ### Install Dev Dependencies Source: https://github.com/oyvindwe/connectlife-ha/blob/main/DEVELOPMENT.md Installs development dependencies using uv. This command should be run from the root of the connectlife-ha repository. ```bash uv sync ``` -------------------------------- ### Install ConnectLife Package Source: https://github.com/oyvindwe/connectlife-ha/blob/main/custom_components/connectlife/data_dictionaries/README.md Installs the ConnectLife Python package. This is a prerequisite for generating mapping files. ```bash pip install connectlife ``` -------------------------------- ### Base Mapping File Example Source: https://github.com/oyvindwe/connectlife-ha/blob/main/custom_components/connectlife/data_dictionaries/README.md Example of a base mapping file (009.yaml) defining properties for a climate entity. ```yaml 009.yaml (base) - property: t_temp climate: target: target_temperature min_value: 16 max_value: 32 ``` -------------------------------- ### Run Local Development Test Server Source: https://github.com/oyvindwe/connectlife-ha/blob/main/CLAUDE.md Starts a local test server for development, requiring a directory for dumps. ```bash uv run python -m connectlife.test_server -d ``` -------------------------------- ### Base Mapping File with Combine Example Source: https://github.com/oyvindwe/connectlife-ha/blob/main/custom_components/connectlife/data_dictionaries/README.md Example of a base mapping file (025.yaml) using 'combine' to merge multiple properties into a single sensor entity. ```yaml 025.yaml (base — virtual sensor combining int and decimal source properties) - property: StandardElectricitConsumption sensor: device_class: energy unit: kWh state_class: total_increasing combine: - property: StandardElectricitConsumption_int - property: StandardElectricitconsumption_decimal multiplier: 0.01 ``` -------------------------------- ### Install Custom Component Source: https://github.com/oyvindwe/connectlife-ha/blob/main/DEVELOPMENT.md Links the connectlife-ha repository into the Home Assistant custom_components directory. Ensure Home Assistant and connectlife-ha repositories are cloned locally. ```bash home_assistant_repo= connectlife_ha_repo= cd ${home_assistant_repo} mkdir -p config/custom_components cd config/custom_components ln -s ${connectlife_ha_repo}>/custom_componnents/connectlife . ``` -------------------------------- ### Run Test Server Source: https://github.com/oyvindwe/connectlife-ha/blob/main/DEVELOPMENT.md Starts a local test server for the connectlife integration. This requires cloning the connectlife repository and running the server from its root directory. ```bash python -m connectlife.test_server -d dumps ``` -------------------------------- ### Feature Override Mapping File Example Source: https://github.com/oyvindwe/connectlife-ha/blob/main/custom_components/connectlife/data_dictionaries/README.md Example of a feature override mapping file (009-120.yaml) that modifies a property defined in a base file. ```yaml 009-120.yaml (feature override — caps at 30 °C, inherits target and min_value) - property: t_temp climate: max_value: 30 ``` -------------------------------- ### IntegerOrTemperature Minimum Value (Celsius/Fahrenheit) Source: https://github.com/oyvindwe/connectlife-ha/blob/main/custom_components/connectlife/data_dictionaries/README.md Example of setting a minimum value with both Celsius and Fahrenheit specified for the IntegerOrTemperature type. ```yaml min_value: celsius: 0 fahrenheit: 32 ``` -------------------------------- ### Water Heater State Translations Source: https://github.com/oyvindwe/connectlife-ha/blob/main/custom_components/connectlife/data_dictionaries/README.md Example of how to define translation strings for water heater states. These should be placed under 'state' and not 'state_attributes'. ```json { "entity": { "water_heater": { "connectlife": { "state": { "auto": "Auto" } } } } } ``` -------------------------------- ### Feature Override Mapping File - No Combine Example Source: https://github.com/oyvindwe/connectlife-ha/blob/main/custom_components/connectlife/data_dictionaries/README.md Example of a feature override mapping file that reads a property directly, disabling the 'combine' behavior from the base file. ```yaml 025-{feature}.yaml (override — read the property directly, no combine) - property: StandardElectricitConsumption combine: null ``` -------------------------------- ### IntegerOrTemperature Minimum Value (Integer) Source: https://github.com/oyvindwe/connectlife-ha/blob/main/custom_components/connectlife/data_dictionaries/README.md Example of setting a minimum value as a simple integer for the IntegerOrTemperature type. ```yaml min_value: 10 ``` -------------------------------- ### Configure Binary Sensor with Custom Options Source: https://github.com/oyvindwe/connectlife-ha/blob/main/custom_components/connectlife/data_dictionaries/README.md Configure a 'binary_sensor' entity to represent a property like an alarm status. This example shows how to map specific integer values from the device to 'on' or 'off' states using the 'options' dictionary, overriding the default mapping. ```yaml - property: alarm binary_sensor: device_class: problem options: 0: off 1: on ``` -------------------------------- ### Combine Hours, Minutes, and Seconds into Total Duration Source: https://github.com/oyvindwe/connectlife-ha/blob/main/custom_components/connectlife/data_dictionaries/README.md This example demonstrates combining hours, minutes, and seconds into a total duration in seconds. Each time component is multiplied by its corresponding factor (3600 for hours, 60 for minutes) before summation. The 'unknown_value' is handled for each component. ```yaml - property: Sand_timer_1_duration hide: true sensor: device_class: duration unit: s combine: - property: Sand_timer_1_duration_hours multiplier: 3600 unknown_value: 255 - property: Sand_timer_1_duration_minutes multiplier: 60 unknown_value: 255 - property: Sand_timer_1_duration_seconds unknown_value: 255 ``` -------------------------------- ### Map Climate Fan Speed Options Source: https://github.com/oyvindwe/connectlife-ha/blob/main/custom_components/connectlife/data_dictionaries/README.md Maps climate entity fan speed options to specific string values. This example defines options for 't_fan_speed' in a climate entity. ```yaml properties: - property: t_fan_speed climate: target: fan_mode options: 0: auto 5: low 6: medium_low 7: medium 8: medium_high 9: high ``` -------------------------------- ### Switch Command with Offset Source: https://github.com/oyvindwe/connectlife-ha/blob/main/custom_components/connectlife/data_dictionaries/README.md Use 'command.adjust' when the write property uses a value encoding offset from the read property. This example shows how to configure a switch where the status property uses a different encoding than the command property. ```yaml - property: Adaptive_sense_setting # status: 1 = off, 2 = on switch: "off": 1 "on": 2 command: name: Adaptive_sense_setting_cmd # write target adjust: 1 # sends 0 for off, 1 for on ``` -------------------------------- ### Feature Override to Disable Pause Button Source: https://github.com/oyvindwe/connectlife-ha/blob/main/custom_components/connectlife/data_dictionaries/README.md This example demonstrates how to use a feature override to disable a button that is inherited from the base configuration. In this case, the 'pause' button is disabled because the specific device variant does not support 'Actions: 3'. ```yaml # 015-{feature}.yaml (override — drops the pause button, keeps start/stop) buttons: - key: pause disable: true ``` -------------------------------- ### Translate Sensor Entity States Source: https://github.com/oyvindwe/connectlife-ha/blob/main/custom_components/connectlife/data_dictionaries/README.md Defines translations for sensor entity states in strings.json and en.json. This example shows how to translate 'closed' and 'open' states for a 'Door_status' sensor. ```json { "entity": { "sensor": { "Door_status": { "name": "Door", "state": { "closed": "Closed", "open": "Open" } } } } } ``` -------------------------------- ### Translate Climate Fan Mode States Source: https://github.com/oyvindwe/connectlife-ha/blob/main/custom_components/connectlife/data_dictionaries/README.md Defines translations for climate entity fan mode states in strings.json and en.json. This example translates 'medium_low' and 'medium_high' fan speeds. ```json { "entity": { "climate": { "connectlife": { "state_attributes": { "fan_mode": { "state": { "medium_low": "Medium low", "medium_high": "Medium high" } } } } } } } ``` -------------------------------- ### Entity Creation Pattern Source: https://github.com/oyvindwe/connectlife-ha/blob/main/CLAUDE.md Illustrates the common pattern for creating per-property entities across multiple platforms. ```python for appliance in coordinator.data.values(): dictionary = Dictionaries.get_dictionary(appliance) for s in appliance.status_list: if is_entity(Platform.XXX, dictionary.properties[s], appliance.status_list[s]): # create entity ``` -------------------------------- ### Configure Dishwasher Statistics Source: https://github.com/oyvindwe/connectlife-ha/blob/main/custom_components/connectlife/data_dictionaries/README.md Enable daily energy and water consumption tracking for dishwashers and similar appliances by setting the source to 'energy_consumption_curve'. ```yaml # 015.yaml (base) statistics: source: energy_consumption_curve daily_energy_kwh: true daily_water_consumption: true ``` -------------------------------- ### Generate Data Dictionary Skeleton Source: https://github.com/oyvindwe/connectlife-ha/blob/main/custom_components/connectlife/data_dictionaries/README.md Generates a skeleton data dictionary file using the ConnectLife package. Replace and with your ConnectLife credentials. ```bash python -m connectlife.dump --username --password --format dd ``` -------------------------------- ### Configure Air Conditioner Statistics Source: https://github.com/oyvindwe/connectlife-ha/blob/main/custom_components/connectlife/data_dictionaries/README.md Enable daily energy consumption tracking for air conditioners by setting the source to 'air_duct_energy'. Water consumption is not applicable for this source. ```yaml # 009.yaml (base) statistics: source: air_duct_energy daily_energy_kwh: true ``` -------------------------------- ### Check Translation Files Source: https://github.com/oyvindwe/connectlife-ha/blob/main/DEVELOPMENT.md Checks for missing translation keys in a specified language file or all files if no language is provided. ```bash uv run python -m scripts.check_translations [lang] ``` -------------------------------- ### Climate Presets Configuration Source: https://github.com/oyvindwe/connectlife-ha/blob/main/custom_components/connectlife/data_dictionaries/README.md Define presets for climate devices to control specific properties like power, eco mode, and fan speed. The first matching preset in the list is used. ```yaml climate: presets: - preset: eco t_power: 1 # turn on t_eco: 1 t_fan_speed: 0 # auto - preset: ai t_power: 1 # turn on t_tms: 1 ``` -------------------------------- ### Type Checking Source: https://github.com/oyvindwe/connectlife-ha/blob/main/DEVELOPMENT.md Performs static type checking on the codebase using Pyright. This helps catch type-related errors before runtime. ```bash uv run pyright ``` -------------------------------- ### Sort Translation Files Source: https://github.com/oyvindwe/connectlife-ha/blob/main/DEVELOPMENT.md Sorts translation files alphabetically. This command should be run after manually editing translation files. ```bash uv run python -m scripts.sort_translations ``` -------------------------------- ### Update Translation Strings Source: https://github.com/oyvindwe/connectlife-ha/blob/main/custom_components/connectlife/data_dictionaries/README.md Updates the strings.json file with new translation keys. This command should be run from the base directory of the repository. ```bash python -m scripts.gen_strings ``` -------------------------------- ### Generate Translation Files Source: https://github.com/oyvindwe/connectlife-ha/blob/main/DEVELOPMENT.md Generates strings.json and en.json files. This script updates translation files by adding new strings, removing stale keys, and sorting files. It can also report missing translation keys. ```bash uv run python -m scripts.gen_strings ``` ```bash uv run python -m scripts.gen_strings --show-missing [lang] ``` -------------------------------- ### Map Temperature Unit to Property Source: https://github.com/oyvindwe/connectlife-ha/blob/main/custom_components/connectlife/data_dictionaries/README.md Maps a sensor's temperature unit to a property that can be dynamically set, like a select entity. The unit is determined during initialization based on the property's value. ```yaml - property: Meat_probe_measured_temperature sensor: device_class: temperature unit: property.Oven_temperature_unit - property: Oven_temperature_unit select: options: 1: celsius 2: fahrenheit ``` -------------------------------- ### CI Hassfest Execution Source: https://github.com/oyvindwe/connectlife-ha/blob/main/CLAUDE.md CI command that runs only hassfest, without linter, formatter, or type checker. ```bash # CI runs hassfest only (no linter/formatter/type checker configured) ``` -------------------------------- ### Combine Integer and Decimal Parts for Energy Consumption Source: https://github.com/oyvindwe/connectlife-ha/blob/main/custom_components/connectlife/data_dictionaries/README.md Use the 'combine' field to create a single sensor entity from multiple source properties, such as the integer and decimal parts of electricity consumption. The 'multiplier' is applied to each source value before summing them. ```yaml - property: Electricit_consumption icon: mdi:lightning-bolt sensor: device_class: energy unit: kWh read_only: true state_class: total_increasing combine: - property: Electricit_consumption_int - property: Electricit_consumption_decimal multiplier: 0.01 ``` -------------------------------- ### Validate Mapping Files Source: https://github.com/oyvindwe/connectlife-ha/blob/main/DEVELOPMENT.md Validates the mapping files used within the component. This script checks for inconsistencies or errors in the mapping configurations. ```bash uv run python -m scripts.validate_mappings ``` -------------------------------- ### Define Custom Entity Names and States Source: https://github.com/oyvindwe/connectlife-ha/blob/main/custom_components/connectlife/data_dictionaries/README.md Provides custom English names and states for sensor entities by adding properties to strings.json and translation files. This allows for more user-friendly entity names and state translations. ```yaml properties: - property: Door_status unavailable: 0 sensor: device_class: enum options: 1: closed 2: open ``` -------------------------------- ### Regenerate Translation Strings Source: https://github.com/oyvindwe/connectlife-ha/blob/main/CLAUDE.md Regenerates 'strings.json' and 'en.json' from data dictionaries and sorts all translations. ```bash uv run python -m scripts.gen_strings ``` -------------------------------- ### Set Sensor Read-Only Property Source: https://github.com/oyvindwe/connectlife-ha/blob/main/README.md Configure a sensor to be read-only within the data dictionary. This prevents accidental modification via the `set_value` service. ```yaml - property: f_status sensor: read_only: true ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.