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:
- 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). - I uninstalled the official Tuya integration.
- I successfully installed the
localtuya
custom component (HACS). - Using the Tuya IoT Platform (“Get device specification attributes”), I identified the necessary DP IDs.
- 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 intemplates.yaml
(at the same level assensor:
, without leading-
) - same error. - Tried putting the full
template humidifier
config directly inconfiguration.yaml
undertemplate:
(using the list structure- humidifier:
) - same error. - Tried simplifying the
humidifier
config inhumidifiers.yaml
down to justname
,unique_id
,device_class
- same error. - Tried commenting out the entire
sensor:
block intemplates.yaml
- same error persisted on thehumidifier:
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?..