Triggering automation when it should not

It sounds as stupid as it is, I know, but I cant get this through. Please help me!

I want to have my alarm armed in perimeter mode while my roomba is active, so I figured, why not create a button that instead of arming away, it will arm_perimeter?

There it goes, I created an input_boolean and added the button in the UI. For my surprise when I press the entity button, it doesnt show if it active or not and I then learned that booleans dont show state in the UI. So I created a template binary sensor for that. POOF there it is! It now works like a charm.

Why am I telling you this? Because the binary and the boolean are the only things I created regarding my vacuum and I havent still added it into ANY automation!
Yet, when I press the button in the UI just for testing the state change, it triggers an automation! Yes… Turning on the roomba button, triggers an irrelevant automation.

I cannot find out what is going on…

When I am pressing the button, the logs show this:

Not passing an entity ID to a service to target all entities is deprecated. Update your call to input_boolean.toggle to be instead: entity_id: all

I thought I should post the automation that is being triggered, just in case you guys can see something I dont:

- alias: '[SECURITY] Movement on stairs'
  trigger:
  - platform: state
    entity_id: binary_sensor.stairsmotionsensor
    to: 'on'
  action:
  - service: notify.tts_lenovo
    data:
      data:
        method: alarm
      message: chime
  - service: camera.snapshot
    data:
      entity_id: camera.stairs
      filename: /home/homeassistant/.homeassistant/www/images/snapshot.jpg
  - condition: state
    entity_id: group.presence_tracker
    state: not_home
  - delay: 00:00:01
  - service: notify.telegram_argy
    data:
      title: 'Stairs Photo'
      message: 'Stairs Photo'
      data:
        photo:
          file: /home/homeassistant/.homeassistant/www/images/snapshot.jpg
          caption: 'Stairs Photo'
  - service: notify.telegram_fotini
    data:
      message: 'Stairs Photo'
      data:
        photo:
          file: /home/homeassistant/.homeassistant/www/images/snapshot.jpg
          caption: 'Stairs Photo'
  - delay: 00:00:03
  - service: camera.snapshot
    data:
      entity_id: camera.stairs
      filename: /home/homeassistant/.homeassistant/www/images/snapshot2.jpg
  - delay: 00:00:01
  - service: notify.telegram_argy
    data:
      title: 'Stairs Photo 2'
      message: 'Τράβηξα και 2η φωτογραφία για να είσαι σίγουρος.'
      data:
        photo:
          file: /home/homeassistant/.homeassistant/www/images/snapshot2.jpg
          caption: 'Stairs Photo'
  - service: notify.telegram_fotini
    data:
      message: 'Stairs Photo'
      data:
        photo:
          file: /home/homeassistant/.homeassistant/www/images/snapshot2.jpg
          caption: 'Stairs Photo'

And here are the boolean and the binary sensor:
binary_sensor.yaml

- platform: template
  sensors:
    roombamotion:
      value_template: "{{ is_state('input_boolean.roombacycle', 'on') }}"

input_boolean.yaml

roombacycle:
  initial: off

What do you mean by this?
If you add an input boolean to the front end it should most definitely change state when you switch it (as seen in the developer tools states menu).

Make sure you have the correct entity id.

Screenshot_2019-08-26%20Home%20Assistant

Screenshot_2019-08-26%20Home%20Assistant(1)

Thanks for your answer.
I mean this:

                  type: entity-button
                  entity: input_boolean.roombacycle
                  icon: mdi:robot-vacuum
                  show_name: false
                  tap_action:
                    action: call-service
                    service: input_boolean.toggle
                    entity_id: input_boolean.roombacycle

Using the boolean as the entity, the state changes, but the button doesnt change color.
3

I have to use this in order to work.

                  type: entity-button
                  entity: binary_sensor.roombamotion
                  icon: mdi:robot-vacuum
                  show_name: false
                  tap_action:
                    action: call-service
                    service: input_boolean.toggle
                    entity_id: input_boolean.roombacycle

3

What I mean is that the state is changing, but the interface doesnt show it (by changing the color of the icon)

Ok, I see your problem. This is not correct.

                  tap_action:
                    action: call-service
                    service: input_boolean.toggle
                    entity_id: input_boolean.roombacycle

Should be:

                  tap_action:
                    action: call-service
                    service: input_boolean.toggle
                    service_data:
                      entity_id: input_boolean.roombacycle

Because the entity id was not correctly specified as service data it was toggling all the input booleans (triggering your other automations).

There’s an example here: https://www.home-assistant.io/lovelace/entity-button/#examples

1 Like

1 Like