Button to call multiple services

So I have a use case where I want to press a button on my front end to do the two following steps:

  1. Turn a switch on (this is a snapshot for my Arlo Camera as it doesn’t support streaming)
  2. Popup a card for my Alarm control panel and also the latest snapshot from the camera

The issues is that I don’t know how to get a button to call two services?

Config for my Alarm pop up:

tap_action:
  action: call-service
  service: browser_mod.popup
  service_data:
    card:
      entity: alarm_control_panel.aarlo
      states:
        - arm_home
        - arm_away
      type: alarm-panel
    deviceID: this
    title: Alarm Control

Config for my Switch to create a snapshot:

tap_action:
  action: call-service
  service: switch.turn_on
  service_data:
    entity_id: switch.aarlo_snapshot_front_door

How can I combine them in the button config?

1 Like

Two words:

Scripts, EZ

To add more info, you can have your tap_action call a script.
The script editor will easily allow you to add N+1 actions in there.

1 Like

I avoided scripts/automations as I didn’t believe that the Pop Up custom integration would work, and I was right.

Ran a script as you suggested, but the card for the alarm panel does not pop up on my screen, therefore this solution doesn’t work. (But the switch did work).

Wondering if there are any alternatives? Is there a way to get the button to call more than one service inside lovelace?

Apologies, I didn’t know of that limitation

No apologies necessary! My own dumb fault for trying to get a complex situation with an unofficial integration hahaha.

Hopefully someone out there knows! :slight_smile:

I want to do the same thing. Have you found any solution to this problem?

1 Like

Sorry no, it’s not possible. :frowning:

1 Like

I have been looking at a similar challenge. I want to use “input_” values to maintain sort of a “state machine” to allow me to create an TV remote that shows and hides different elements based what source has been selected. I initially thought I would need a script for each button on the remote and with three different TVs that I want to control you can see the script count would get real large real fast.

I have bumbled my way into a little better solution using script variables. This allows me to have less scripts and then set the variables in the service call from the UI. I essentially can have a single script work across all 3 TV remotes and multiple buttons per remote. A little tedious to setup initially but as long as I maintain a consistent “naming convention” for entities it results in a much more manageable solution. Below is an example script for toggling the power state of a TV (uses IR remote so there is no way easy/clean way to track power on or off, so I use an input_boolean to track it then adjust the look of the remote using conditional cards.

toggle_tv:
  alias: toggle_tv
  description: template for turning on tv via remote power_toggle
  fields:
    entity_name:
      description: remote entity to work on
    initial_source:
      description: source name to use on power on
  sequence:
  - service: remote.send_command
    data:
      entity_id: remote.{{ entity_name }}
      command: power_toggle
  - delay: 4
  - service: remote.send_command
    data:
      entity_id: remote.{{ entity_name }}
      command: "{{ initial_source }}"
  - service: input_boolean.toggle
    data:
      entity_id: input_boolean.{{ entity_name }}
  mode: queued
  icon: mdi:television
  max: 10
1 Like