Trigger on new humidity value from zigbee sensor

Hello,

I want an automation to switch on/off a dehumidifier based on a zigbee humidity sensor (Tuya TS0201) and the current tariff.
I want to switch on when:

  • Humidity is over 70% AND we are in “Niedertarif”
    I want to switch off when:;
  • Humidity is under 65% OR we are in “Hochtarif” OR HA is shut down

So I need to run the automation when:

  • HA is started or stopped
  • Tariff changes
  • Humidity changes

The first two triggers work without problems. But a change of the humidity is just ignored. Any ideas?

alias: _test
description: ""
trigger:
  - platform: state
    entity_id:
      - sensor.klima_gartenkeller_luftfeuchtigkeit_2
      - input_select.stromtarif
  - event: start
    platform: homeassistant
  - platform: homeassistant
    event: shutdown
    id: ha_stop
condition: []
action:
  - choose:
      - conditions:
          - condition: and
            conditions:
              - condition: numeric_state
                entity_id: sensor.klima_gartenkeller_luftfeuchtigkeit_2
                above: 70
              - condition: state
                entity_id: input_select.stromtarif
                state: Niedertarif
        sequence:
          - type: turn_on
            device_id: 4d3e1506eb43c2460016707be71d34aa
            entity_id: 0f980bd6d748f35dbd219885e8a9c56a
            domain: switch
      - conditions:
          - condition: or
            conditions:
              - condition: numeric_state
                entity_id: sensor.klima_gartenkeller_luftfeuchtigkeit_2
                below: 65
              - condition: state
                entity_id: input_select.stromtarif
                state: Hochtarif
              - condition: trigger
                id:
                  - ha_stop
        sequence:
          - type: turn_off
            device_id: 4d3e1506eb43c2460016707be71d34aa
            entity_id: 0f980bd6d748f35dbd219885e8a9c56a
            domain: switch
mode: single

Any ideas?

Hi Eduard Iten
,

This may explain the problem. Please ask questions if not.

Automations #1: trigger only fires when it changes from not true to true.

It would be easier to set up a hygrostat and make the automation trigger on the tarif changes to turn on/off the hygrostat.

Hello @Sir_Goodenough

thanks for your reply. The problem was as described, the automation did not trigger when a new humidity value was received. Now, it works, without change, after I rebooted the machine running home assistant. So the problem solved itself.

Regards, Edi

Hello @Hellis81

Thanks for your reply, I wasn’t aware that there is a hygrostat helper! I will play around with it. Do you know, if the dehumidifyer is turned on and you turn of the hygrostat, will the device also turn of?

Regards, Edi

That is what it should do.

I tried it, works like a charm. Thanks!