Persistent "Property humidifier is not allowed" error with Template Humidifier config (using LocalTuya)

Hello Home Assistant Community,

I’m running into a persistent and puzzling configuration error while trying to set up a template humidifier entity for my Tuya dehumidifier (Model is D16 Ario) integrated via LocalTuya. I’m hoping someone might have encountered something similar or have an idea what could be wrong.

My Goal: I want to create a template humidifier (with device_class: dehumidifier) to aggregate the controls/sensors from my LocalTuya entities. This is primarily so I can use the standard Lovelace humidifier card for a unified interface.

Background:

  1. I initially used the official Tuya integration. It did detect the dehumidifier and created a humidifier entity, but it didn’t expose all the features I wanted (specifically operating modes, Anion switch, UV switch).
  2. I uninstalled the official Tuya integration.
  3. I successfully installed the localtuya custom component (HACS).
  4. Using the Tuya IoT Platform (“Get device specification attributes”), I identified the necessary DP IDs.
  5. I successfully configured all relevant functions using localtuya, and these individual entities work perfectly:
  • switch.d16_ario_on_off (DP 1 - Power)
  • number.d16_ario_dehumidify_set_val (DP 2 - Target Humidity: min 25, max 80, step 5)
  • sensor.d16_ario_humidity_indoor (DP 6 - Current Humidity)
  • select.d16_ario_working_mode (DP 5 - Operating Mode: values “manual”, “purifying”, “Clothdrying”, “SLeeping”)
  • switch.d16_ario_anion_on_off (DP 10 - Anion)
  • switch.d16_ario_uv_on_off (DP 13 - UV)
  • switch.d16_ario_child_lock_on_off (DP 16 - Child Lock)
  • select.d16_ario_countdown_on_off (DP 17 - Timer: values “cancel”, “1h”, “2h”, “3h”)
  • sensor.d16_ario_fault (DP 19 - Fault Bitmap: includes “tankfull”, “defrost”, “E1”, “E2”)
  • (I also created binary_sensor templates based on the fault bitmap for Tank Full and Defrosting, which work).

The Problem: When I try to add the template humidifier configuration to my YAML files, Home Assistant’s configuration check fails consistently with the following error:

Invalid config for 'template' at templates.yaml, line 41: 'humidifier' is an invalid option for 'template', check: humidifier (The exact filename and line number might vary slightly depending on the structure tested, but the error message ‘humidifier’ is an invalid option for ‘template’ persists)

My Configuration Structure:

configuration.yaml:

# configuration.yaml
# ... other config ...
template: !include templates.yaml
# ... other includes like automation, script etc ...

templates.yaml (Current structure that should work but fails):

sensor:
  - name: house_consumption_power
    # ... my working sensor config ...
  - name: "Simple Daylight Phase"
    # ... my other working sensor config ...

# ERROR OCCURS ON THE NEXT LINE (or when humidifier block is inline)
humidifier: !include humidifiers.yaml

humidifiers.yaml (Included file content):

# humidifiers.yaml
- name: "Dezumidificator D16 Ario"
  unique_id: dezumidificator_d16_ario_template
  device_class: dehumidifier

  # --- Power Control ---
  value_template: >
    {{ is_state('switch.d16_ario_on_off', 'on') }}
  turn_on:
    service: switch.turn_on
    target:
      entity_id: switch.d16_ario_on_off
  turn_off:
    service: switch.turn_off
    target:
      entity_id: switch.d16_ario_on_off

  # --- Target Humidity ---
  target_humidity_template: >
    {{ states('number.d16_ario_dehumidify_set_val') | int(0) }}
  set_humidity:
    service: number.set_value
    target:
      entity_id: number.d16_ario_dehumidify_set_val
    data:
      value: "{{ humidity }}"
  min_humidity: 25
  max_humidity: 80

  # --- Current Humidity ---
  current_humidity_template: >
    {{ states('sensor.d16_ario_humidity_indoor') | int(0) }}

  # --- Mode ---
  mode_template: >
    {{ states('select.d16_ario_working_mode') }}
  set_mode:
    service: select.select_option
    target:
      entity_id: select.d16_ario_working_mode
    data:
      option: "{{ mode }}"
  available_modes:
    - "manual"
    - "purifying"
    - "Clothdrying"
    - "SLeeping"

  # --- Attributes ---
  attributes:
    anion_on: >
      {{ is_state('switch.d16_ario_anion_on_off', 'on') }}
    uv_on: >
      {{ is_state('switch.d16_ario_uv_on_off', 'on') }}
    child_lock_on: >
      {{ is_state('switch.d16_ario_child_lock_on_off', 'on') }}
    timer_setting: >
      {{ states('select.d16_ario_countdown_on_off') }}
    fault_code_raw: >
      {{ states('sensor.d16_ario_fault') }}
    tank_full: >
      {{ states('sensor.d16_ario_fault') | int(0) & 4 > 0 }}
    defrosting: >
      {{ states('sensor.d16_ario_fault') | int(0) & 8 > 0 }}
    error_e1: >
      {{ states('sensor.d16_ario_fault') | int(0) & 1 > 0 }}
    error_e2: >
      {{ states('sensor.d16_ario_fault') | int(0) & 2 > 0 }}

Troubleshooting Steps Taken:

  • Tried to confirmed template humidifier is a standard HA feature.
  • Meticulously checked YAML indentation (using spaces, not tabs) and syntax in all files multiple times. Validated snippets online.
  • Tried putting the humidifier: block directly in templates.yaml (at the same level as sensor:, without leading -) - same error.
  • Tried putting the full template humidifier config directly in configuration.yaml under template: (using the list structure - humidifier:) - same error.
  • Tried simplifying the humidifier config in humidifiers.yaml down to just name, unique_id, device_class - same error.
  • Tried commenting out the entire sensor: block in templates.yaml - same error persisted on the humidifier: line/include.
  • Ensured files are UTF-8 encoded.
  • Restarted Home Assistant core many times. [even Full Host Reboot].
  • The error always occurs during “Check Configuration”, not just a linter warning in the editor.

System Information:

  • Home Assistant Version: 2025.4.4
  • Installation Type: Home Assistant OS on x64
  • LocalTuya Version: 5.2.3

My Question: Why would Home Assistant consistently fail to recognize humidifier: as a valid key/platform within the template: integration structure, even when the YAML appears correct and follows documentation? Has anyone seen this specific error persist like this? Are there any other potential conflicts or hidden issues I should look for?

Any help or ideas would be greatly appreciated! Thank you!

PS It’s even possible what I want?..

Can you share where/how you confirmed this? If the answer contains the name of any of the LLM bullshit engines, then you now know why this forum has a rule against using them for answers… they often produce plausible-looking configuration that contains significant flaws that are not obvious to many users.

As far as I am aware, there is no core Template Humidifier integration.

There is a core integration Generic Hygrostat which is configured under its own top-level key, generic_hygrostat; and there are two custom integrations Humidifier Template and Switch Humidifier (which hasn’t been updated in 4 years), that can be configured under the humidifier key.

None are configured under template.

my bad… "tried to confirm template humidifier is a standard HA feature. "

Thanks for the replay

After re-checking the main Template integration documentation page again carefully (Template - Home Assistant) and considering the feedback here, I realize my approach was likely based on a misunderstanding. The documentation page does not explicitly list humidifier alongside the other platforms directly configurable under the main template: key (like sensor, number, etc.).

Combined with the persistent validation errors (Property humidifier is not allowed) I encountered when trying to place the humidifier: key under the template: structure (either directly or via includes), I have to conclude that my attempt to configure a humidifier under the core template: key was based on a misunderstanding. This specific functionality does not appear to exist within the standard template: integration as I initially believed.

My apologies for any confusion caused by pursuing this incorrect path based on my initial assumptions.

The good news is that my underlying LocalTuya entities (switch.*, number.*, sensor.*, select.*) for the dehumidifier are working correctly. Therefore, I will now focus on creating a good Lovelace UI using those existing, functional entities directly with standard or custom cards (like Mushroom).

Thanks everyone for the input and patience!