So ExtremeBias had the most helpful info breaking down the Entities, but hereâs what I have for use with local tuya:
Entity |
Name |
Platform |
Value |
1 |
Power |
switch |
- |
2 |
Dehumifier Mode |
Number |
0-3 |
4 |
Humidity Target |
Number |
0-100 |
6 |
Fan Speed |
Number |
1-3 |
7 |
Unkown |
binary_sensor |
- |
11 |
Empty Tank |
sensor |
- |
12 |
Unknown |
binary_sensor |
- |
101 |
Unknown |
binary_sensor |
- |
102 |
Night Mode |
switch |
- |
103 |
Temperature |
sensor |
Device Class: temperature, Unit: ° |
104 |
Humidity |
sensor |
Device Class: humidity, Unit: % |
105 |
Defrost |
binary_sensor |
- |
This gets the device setup, but I wanted it to work a little better than having to move a number line to select the fan speed or mode.
I made some helpers to use in the UI with automations to translate the change in value and send it to the device.
Type |
Name |
Options |
input_boolean |
Dehumidifier Remote Lock |
- |
input_select |
Dehumifier Mode |
Auto, Continuous, Laundry, Ventilation |
input_select |
Dehumifier Fan Speed |
Low, High |
I also added some template sensors to track the state of the inputs and used them as triggers for updating the UI when the device is changed using the buttons on the device itself.
- sensor:
- name: "Dehumidifier Fan Speed"
state: "{{ states('number.fan_speed') }}"
- name: "Dehumidifier mode"
state: "{{ states('number.dehumidifier_mode') }}"
- sensor:
- name: "Dehumidifier Empty Tank"
state: >
{% if states('sensor.empty_tank') == '0' %}
{{ "Tank Fine" }}
{% else %}
{{ "Empty Tank" }}
{% endif %}
Now there are just 4 automations to make it work. 2 each for the mode and fan speed, with one monitoring for changes in Home Assistant and the other for changes from the device. One issue I did come across was that changing on the device updated the values in home assistant which then triggered the automations to change it back on the dehumidifier, hence why I added the remote lock helper.
Fan Speed on Home Assitant:
alias: Dehumidifier Fan Speed - Changed Local
description: ""
trigger:
- platform: state
entity_id:
- input_select.dehumidifier_fan_speed
condition:
- condition: state
entity_id: input_boolean.dehumidifier_remote_lock
state: "off"
action:
- if:
- condition: state
entity_id: input_select.dehumidifier_fan_speed
state: Low
then:
- service: number.set_value
data:
value: "1"
target:
entity_id:
- number.fan_speed
else:
- service: number.set_value
data:
value: "3"
target:
entity_id: number.fan_speed
mode: single
Fan Speed on Device:
alias: Dehumidifier Fan Speed - Changed Remote
description: ""
trigger:
- platform: state
entity_id:
- sensor.dehumidifier_mode
condition: []
action:
- service: input_boolean.turn_on
data: {}
target:
entity_id: input_boolean.dehumidifier_remote_lock
- if:
- condition: state
entity_id: sensor.dehumidifier_mode
state: "0"
then:
- service: input_select.select_option
data:
option: Auto
target:
entity_id: input_select.dehumidifier_mode
else: []
- delay:
hours: 0
minutes: 0
seconds: 5
milliseconds: 0
- service: input_boolean.turn_off
data: {}
target:
entity_id: input_boolean.dehumidifier_remote_lock
mode: single
Mode on Home Assistant:
alias: Dehumidifier Mode - Changed Local
description: ""
trigger:
- platform: state
entity_id:
- input_select.dehumidifier_mode
alias: When Dehumidifier Mode Select is changed
condition:
- condition: state
entity_id: input_boolean.dehumidifier_remote_lock
state: "off"
action:
- choose:
- conditions:
- condition: state
entity_id: input_select.dehumidifier_mode
state: Auto
sequence:
- service: number.set_value
data:
value: "0"
target:
entity_id: number.dehumidifier_mode
- conditions:
- condition: state
entity_id: input_select.dehumidifier_mode
state: Continuous
sequence:
- service: number.set_value
data:
value: "1"
target:
entity_id: number.dehumidifier_mode
- conditions:
- condition: state
entity_id: input_select.dehumidifier_mode
state: Laundry
sequence:
- service: number.set_value
data:
value: "2"
target:
entity_id: number.dehumidifier_mode
- conditions:
- condition: state
entity_id: input_select.dehumidifier_mode
state: Ventilation
sequence:
- service: number.set_value
data:
value: "3"
target:
entity_id: number.dehumidifier_mode
mode: single
Mode on device:
alias: Dehumidifier Mode - Changed Remote
description: ""
trigger:
- platform: state
entity_id:
- sensor.dehumidifier_mode
condition: []
action:
- service: input_boolean.turn_on
data: {}
target:
entity_id: input_boolean.dehumidifier_remote_lock
- if:
- condition: state
entity_id: sensor.dehumidifier_mode
state: "0"
then:
- service: input_select.select_option
data:
option: Auto
target:
entity_id: input_select.dehumidifier_mode
else:
- if:
- condition: state
entity_id: sensor.dehumidifier_mode
state: "1"
then:
- service: input_select.select_option
data:
option: Continuous
target:
entity_id: input_select.dehumidifier_mode
else:
- if:
- condition: state
entity_id: sensor.dehumidifier_mode
state: "2"
then:
- service: input_select.select_option
data:
option: Laundry
target:
entity_id: input_select.dehumidifier_mode
else:
- service: input_select.select_option
data:
option: Ventilation
target:
entity_id: input_select.dehumidifier_mode
- delay:
hours: 0
minutes: 0
seconds: 5
milliseconds: 0
- service: input_boolean.turn_off
data: {}
target:
entity_id: input_boolean.dehumidifier_remote_lock
mode: single
I also added an extra automation that sends a notification to my phone when the tank needs emptying.
Last thing was to shove it all in a lovelace entities card for easy use:
type: entities
entities:
- entity: switch.power
- entity: switch.night_mode
- entity: sensor.temperature
- entity: sensor.humidity
- entity: number.humidity_target
- entity: binary_sensor.defrost
- entity: sensor.dehumidifier_empty_tank
- entity: input_select.dehumidifier_fan_speed
- entity: input_select.dehumidifier_mode
title: Dehumidifier
Hope that helps anyone who needs it