Input_boolean condition

I am trying to use an input_boolean as a condition for an automation, it completes whether input_boolean.night_mode is on or off.

from my configuration.yaml

input_boolean:
  night_mode:
    name: Night Mode
    initial: off
    icon: mdi:weather-night

and the automation:

- alias: 'Dryer Finished'
  trigger:
    platform: state
    entity_id: sensor.dryer_on
    from: 'True'
    to: 'False'
  condition:
    - condition: state
      entity_id: input_boolean.night_mode
      state: 'off'
  action:
    - service: tts.google_say
      entity_id: media_player.everything
      data:
        message: 'The dryer is finished'

Any ideas on what I am doing wrong here? Thanks

is your media_player called everything?
I might be wrong but that wont make it play on all media_player’s but will try to play it on media_player called everything.

Curiosity, what sensor are you using?

Yes, it’s a group called everything. The announcement plays just fine, the problem is it plays even when night_mode is equal to on. I don’t want the announcement when I am trying to sleep. I am using the tp-link hs110 and it works great.

To expand on that here is my configuration, the hs110 is named dryer.

dryer_current:
    value_template: '{{ states.switch.dryer.attributes["current"] | replace(" A", "") | float }}'
    unit_of_measurement: 'A'
  dryer_power:
    value_template: '{{ states.switch.dryer.attributes["current_consumption"] | replace(" W", "") | float }}'
    unit_of_measurement: 'W'
  dryer_on:
    value_template: "{{ states('sensor.dryer_current') | int > 4.0 }}"

Are you triggering this from the card in the interface? If so the condition is ignored.

If not, then your input boolean is either:

  • on
  • called something else (like night_mode_2), check state in dev panel.
2 Likes

I’m triggering it from the card, that explains it, thanks!

1 Like

No worries.

On a side note, thanks for the mini review of the hs110, I was thinking of getting one for the same reason as you (I already have a hs100 for basic on/off) but wasn’t sure if the power monitoring was actually any good. Now I know I’ll add it to my list-of-things-to-get-when-my-account-has-recovered-from-xmas :+1:

I think it works very well and they are extremely easy to setup, I am ordering a second one for the washer. I have an aoetec zwave switch with energy monitoring but I haven’t had any luck getting it to update hass in a reasonable amount of time and I just became frustrated. I might try to sell it or just use it as a normal switch.

1 Like

WHAT… you can group media players… mind blown