Skip to content

ValueError: Key [delayTime] Value [0] - Allowed: min 1 max 99 step 1 when calling hon.update_settings #270

@Koberer33

Description

@Koberer33

Problem description

When attempting to change any settings of the extractor hood via the hon.update_settings service (e.g., turning the light on/off, adjusting the fan speed), I repeatedly receive the error message. ValueError: Key [delayTime] Value [0] - Allowed: min 1 max 99 step 1.

This error occurs even though a value of 1 (or another valid value > 0) is explicitly passed in the delayTime parameters. It seems the integration is internally attempting to set delayTime to 0 before processing or validating the passed parameters.

Steps to Reproduction

The hon Custom Component is installed and the extractor hood is integrated as device ed95833e0b0a68c2abf38b84fbf6d85d (or similar ID).
Template entities for light, fan and overrun were created that call the hon.update_settings service (see "Configuration" below).
Try controlling one of the created entities in Home Assistant (e.g., turn on light.extractor_hood_light).
The service call fails and the error shown below is logged in the Home Assistant log.

Expected behavior

The hon.update_settings service should accept the passed parameters and change the corresponding settings on the device without triggering a ValueError due to delayTime, since delayTime is always passed with a valid value (>= 1).

Actual behavior

The service failed with ValueError: Key [delayTime] Value [0] - Allowed: min 1 max 99 step 1.

Vicinity

Home Assistant Core Version: 
HoN Integration Version: latest
Gerät: Dunstabzugshaube 
Device ID: ed95833e0b0a68c2abf38b84fbf6d85d

Traceback/Fehlerprotokoll
Erwartetes Verhalten

Der hon.update_settings Dienst sollte die übergebenen Parameter akzeptieren und die entsprechenden Einstellungen am Gerät ändern, ohne eine ValueError wegen delayTime auszulösen, da delayTime immer mit einem gültigen Wert (>= 1) übergeben wird.

Tatsächliches Verhalten

Der Dienst schlägt fehl mit ValueError: Key [delayTime] Value [0] - Allowed: min 1 max 99 step 1.

Umgebung

Home Assistant Core Version: 2025.12.5
HoN Integration Version: latest
Gerät: Dunstabzugshaube HTS6CBK3XWIFI

Logger: homeassistant.helpers.script.dunstabzugshaube_licht_turn_on

Quelle: helpers/script.py:524
Erstmals aufgetreten: 00:56:38 (4 Vorkommnisse)
Zuletzt protokolliert: 01:10:08

Dunstabzugshaube Licht turn_on: Error executing script. Unexpected error for call_service at pos 1: Key [delayTime] Value [0] - Allowed: min 1 max 99 step 1
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 524, in _async_step
await getattr(self, handler)()
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 1009, in _async_step_call_service
response_data = await self._async_run_long_action(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
...<9 lines>...
)
^
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 624, in _async_run_long_action
return await long_task
^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/core.py", line 2835, in async_call
response_data = await coro
^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/core.py", line 2878, in _execute_service
return await target(service_call)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/hon/init.py", line 421, in handle_update_settings
await device.settings_command(parameters).send()
~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^
File "/config/custom_components/hon/device.py", line 198, in settings_command
self.update_command(command, self.attributes["parameters"])
~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/hon/device.py", line 192, in update_command
command.parameters.get(key).value = parameters.get(key)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/hon/parameter.py", line 105, in value
raise ValueError(f"Key [{self.key}] Value [{value}] - Allowed: min {self._min} max {self._max} step {self._step}")
ValueError: Key [delayTime] Value [0] - Allowed: min 1 max 99 step 1
Konfiguration (templates/dunstabzugshaube_templates.yaml)
yaml

templates/dunstabzugshaube_templates.yaml

--- Licht-Entität ---

  • light:
    • name: "Dunstabzugshaube Licht"
      unique_id: dunstabzugshaube_light_control
      state: "{{ is_state('binary_sensor.device_id_15_light', 'on') }}"
      turn_on:
      • service: hon.update_settings
        data:
        parameters: >-
        {'clockHH':0,'clockMM':0,'clockSS':0,'delayTime':1,'delayTimeStatus':0,'lightStatus':1,'quickDelayTimeStatus':0,'windSpeed':0}
        target:
        device_id: ed95833e0b0a68c2abf38b84fbf6d85d
        turn_off:
      • service: hon.update_settings
        data:
        parameters: >-
        {'clockHH':0,'clockMM':0,'clockSS':0,'delayTime':1,'delayTimeStatus':0,'lightStatus':0,'quickDelayTimeStatus':0,'windSpeed':0}
        target:
        device_id: ed95833e0b0a68c2abf38b84fbf6d85d

--- Gebläse-Entität ---

  • fan:
    • name: "Dunstabzugshaube Gebläse"
      unique_id: dunstabzugshaube_fan_control
      speed_count: 4
      preset_modes:
      • "Stufe 1"
      • "Stufe 2"
      • "Stufe 3"
      • "Stufe 4"
        turn_on:
      • service: hon.update_settings
        data:
        parameters: >-
        {'clockHH':0,'clockMM':0,'clockSS':0,'delayTime':1,'delayTimeStatus':0,'lightStatus':0,'quickDelayTimeStatus':0,'windSpeed':1}
        target:
        device_id: ed95833e0b0a68c2abf38b84fbf6d85d
        turn_off:
      • service: hon.update_settings
        data:
        parameters: >-
        {'clockHH':0,'clockMM':0,'clockSS':0,'delayTime':1,'delayTimeStatus':0,'lightStatus':0,'quickDelayTimeStatus':0,'windSpeed':0}
        target:
        device_id: ed95833e0b0a68c2abf38b84fbf6d85d
        set_percentage:
      • service: hon.update_settings
        data:
        parameters: >-
        {% set percentage = percentage | int %}
        {% set wind_speed_value = 0 %}
        {% if percentage == 0 %} {% set wind_speed_value = 0 %}
        {% elif percentage <= 25 %} {% set wind_speed_value = 1 %}
        {% elif percentage <= 50 %} {% set wind_speed_value = 2 %}
        {% elif percentage <= 75 %} {% set wind_speed_value = 3 %}
        {% else %} {% set wind_speed_value = 4 %}
        {% endif %}
        {'clockHH':0,'clockMM':0,'clockSS':0,'delayTime':1,'delayTimeStatus':0,'lightStatus':0,'quickDelayTimeStatus':0,'windSpeed':{{ wind_speed_value }}}
        target:
        device_id: ed95833e0b0a68c2abf38b84fbf6d85d
        set_preset_mode:
      • service: hon.update_settings
        data:
        parameters: >-
        {% set wind_speed_value = 0 %}
        {% if preset_mode == "Stufe 1" %} {% set wind_speed_value = 1 %}
        {% elif preset_mode == "Stufe 2" %} {% set wind_speed_value = 2 %}
        {% elif preset_mode == "Stufe 3" %} {% set wind_speed_value = 3 %}
        {% elif preset_mode == "Stufe 4" %} {% set wind_speed_value = 4 %}
        {% else %} {% set wind_speed_value = 0 %}
        {% endif %}
        {'clockHH':0,'clockMM':0,'clockSS':0,'delayTime':1,'delayTimeStatus':0,'lightStatus':0,'quickDelayTimeStatus':0,'windSpeed':{{ wind_speed_value }}}
        target:
        device_id: ed95833e0b0a68c2abf38b84fbf6d85d

--- Schalter-Entitäten für Verzögerung ---

  • switch:
    • name: "Dunstabzugshaube Nachlauf"
      unique_id: dunstabzugshaube_delay_switch
      state: "{{ is_state('switch.dunstabzugshaube_nachlauf', 'on') }}"
      turn_on:

      • service: hon.update_settings
        data:
        parameters: >-
        {'clockHH':0,'clockMM':0,'clockSS':0,'delayTime':10,'delayTimeStatus':1,'lightStatus':0,'quickDelayTimeStatus':0,'windSpeed':0}
        target:
        device_id: ed95833e0b0a68c2abf38b84fbf6d85d
        turn_off:
      • service: hon.update_settings
        data:
        parameters: >-
        {'clockHH':0,'clockMM':0,'clockSS':0,'delayTime':1,'delayTimeStatus':0,'lightStatus':0,'quickDelayTimeStatus':0,'windSpeed':0}
        target:
        device_id: ed95833e0b0a68c2abf38b84fbf6d85d
    • name: "Dunstabzugshaube Schnell-Nachlauf"
      unique_id: dunstabzugshaube_quick_delay_switch
      state: "{{ is_state('switch.dunstabzugshaube_schnell_nachlauf', 'on') }}"
      turn_on:

      • service: hon.update_settings
        data:
        parameters: >-
        {'clockHH':0,'clockMM':0,'clockSS':0,'delayTime':1,'delayTimeStatus':0,'lightStatus':0,'quickDelayTimeStatus':1,'windSpeed':0}
        target:
        device_id: ed95833e0b0a68c2abf38b84fbf6d85d
        turn_off:
      • service: hon.update_settings
        data:
        parameters: >-
        {'clockHH':0,'clockMM':0,'clockSS':0,'delayTime':1,'delayTimeStatus':0,'lightStatus':0,'quickDelayTimeStatus':0,'windSpeed':0}
        target:
        device_id: ed95833e0b0a68c2abf38b84fbf6d85d

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions