Itho Eco fan automation with Humidity sensor

i would like to automate my bathroom fan Itho-Eco-fan in combination with an Aqara huminity sensor. I’ve already built this description:

But now I would like to have it automatically controlled.
I wrote this automation but it doesn’t work:

#badkamer ventilatie
- id: fan.mechanical_ventilation
  alias: 'Badkamer ventilatie'
  trigger:
    platform: numeric_state
    entity_id: sensor.lumi_lumi_weather_humidity
    above: 65%
  action:
  - service: switch.turn_on
    data:
      entity_id: fan.set_speed
      option: high

Who can help me? I have already looked for a bleuprint but couldn’t find one.

Thanks
Bastiaan

Hi @Bastiaan1977
The state of the humidity is NOT 65% but 65 only, check in the DEVELOPER-STATES section for this sensor.

Hi @GH2user, in developer states I can see “unit_of_measurement” :%
So I thought that I have to wright 65%
Now I have changed it to 65 (without %) but no luck.

the code you are showing is not the whole part I guess?
The examples shown here https://www.home-assistant.io/docs/automation/trigger/ AND https://www.home-assistant.io/integrations/fan/ have a different format.

automation:
  trigger:
    platform: numeric_state
    entity_id: sensor.lumi_lumi_weather_humidity
    above: 65
  action:
    - service: fan.set_speed
      target:
        entity_id: fan.????
      data:
        speed: high

Is the humidity under 65?
you can also check if the service call works using the DEVELOPER=SERVICES

FYI: the fan will get a major update in the next release of HA 2021.3 and high/low will be discarded in favor of numeric values.

Hi @GH2user, thanks for the support.
I got it done. with the two codes below, the fan works perfectly in combination with the aqara humidity sensor

- id: fan.mechanical_ventilation
  alias: Badkamer ventilatie aan
  trigger:
  - platform: numeric_state
    entity_id: sensor.lumi_lumi_weather_humidity
    above: '65'
  action:
  - service: switch.turn_on
    data:
      entity_id: switch.stand_3
  mode: single
- id: '1614778077800'
  alias: Badkamer ventilatie uit
  description: ''
  trigger:
  - platform: numeric_state
    entity_id: sensor.lumi_lumi_weather_humidity
    below: '50'
  condition: []
  action:
  - service: switch.turn_on
    data:
      entity_id: switch.stand_1
  mode: single

Thanks again

Gr.
Bastiaan