Problems with automation, multi condition?

good morning

I created two automations:

  1. Start the bathroom fan for 5 minutes every hour if the humidity is between 60 and 75
  2. Start the bathroom fan for 15 minutes if the humidity is higher than 75

But the first starts every hour for 5 minutes even with humidity higher than 75 and the second never starts.

The automations were created through UI, Home Assistant 0.103.0

Here below the automation code:

- id: '1576342942693'
  alias: bathroom fan humidity > 75%
  trigger:
  - minutes: /15
    platform: time_pattern
  condition:
  - after: 08:00:00
    before: 00:00:00
    condition: time
  - above: '75'
    condition: numeric_state
    entity_id: sensor.heating_humidity
  action:
  - alias: ''
    data: {}
    entity_id: switch.sonoff_10008d0386
    service: switch.turn_on
  - data:
      message: 'UmiditĂ : {{states(''sensor.sonoff_10008d0386_humidity'')}}% - Temp:
        {{states(''sensor.sonoff_10008d0386_temperature'')}}°C'
      title: ACCESO Aspiratore bagno umiditĂ  > 75%
    service: notify.telegram
  - delay: 00:15:00
  - entity_id: switch.sonoff_10008d0386
    service: switch.turn_off
  - data:
      message: 'UmiditĂ : {{states(''sensor.sonoff_10008d0386_humidity'')}}% - Temp:
        {{states(''sensor.sonoff_10008d0386_temperature'')}}°C'
      title: SPENTO Aspiratore bagno umiditĂ  > 75%
    service: notify.telegram
- id: '1576341942693'
  alias: bathroom fan humidity > 60% < 75%
  description: ''
  trigger:
  - minutes: /60
    platform: time_pattern
  condition:
  - after: 08:00:00
    before: '23:00:00'
    condition: time
  - above: '60'
    below: '75'
    condition: numeric_state
    entity_id: sensor.heating_humidity
  action:
  - alias: ''
    data: {}
    entity_id: switch.sonoff_10008d0386
    service: switch.turn_on
  - data:
      message: 'UmiditĂ : {{states(''sensor.sonoff_10008d0386_humidity'')}}% - Temp:
        {{states(''sensor.sonoff_10008d0386_temperature'')}}°C'
      title: ACCESO Aspiratore bagno umiditĂ 
    service: notify.telegram
  - delay: 00:05:00
  - entity_id: switch.sonoff_10008d0386
    service: switch.turn_off
  - data:
      message: 'UmiditĂ : {{states(''sensor.sonoff_10008d0386_humidity'')}}% - Temp:
        {{states(''sensor.sonoff_10008d0386_temperature'')}}°C'
      title: SPENTO Aspiratore bagno umiditĂ 
    service: notify.telegram

I think one problem is this:

condition:
  - after: 08:00:00
    before: 00:00:00
    condition: time

Change
before: 00:00:00
to
before: 23.59:59

Otherwise your automation will never trigger, because e.g. 15:00:00 is not before 00:00:00.

Another thing I don’t understand is, why are you using “sensor.heating_humdity” as a condition, but use the “sensor.sonoff_10008d0386_humidity” in your message. Shouldn’t you also use the “sensor.sono…” in your conditon or why are you using “sensor.heating_humidity” there?

ok I’m an idiot :slight_smile:
I got the wrong sensor!

Thanks!

No worries, I made way more stupid mistakes in the beginning :shushing_face:

1 Like

I see no statute of limitations on mistakes.
As I’ve grown more experienced I just make them in other areas :roll_eyes:

1 Like