2022.9: Home Assistant Birthday Release!

            tap_action:
              action: call-service
              service: input_select.select_option
              service_data:
                option: Home
              target:
                entity_id: input_select.modes

well thatā€™s the problem, youā€™re mixing up syntax. Target isnā€™t valid in the frontend (dashboards).

            tap_action:
              action: call-service
              service: input_select.select_option
              service_data:
                option: Home
                entity_id: input_select.modes
1 Like

is that a new thing? because it worked for me up until now

Nope, itā€™s always been this way.

weird. thanks anyway i really appreciate it.

Because the browser didnā€™t change, the version is the same as before the HA update. This only started after the update. I regressed to August the it doesnā€™t happen. Reinstalled September update and problem came back. So obviously itā€™s HA not the browser.

Bluetooth intragration crashes after some time (<1h) Ā· Issue #78036 Ā· home-assistant/core Ā· GitHub is broken for me too.

Please be more careful when programming.

Please tell me someone who knows it for certain.

Currently people move their integrations from yaml to UI.
Is is obligatory? No.
Is it possible to maintain settings in UI & yaml in parallel? Probably yes; harder but still possible; and probably there is a way to ā€œyaml settings - change in yaml only, UI settings - change in UI onlyā€.

Similar questions are asked here many times.
And a situation becomes worse.

Check here: Actions - Home Assistant

Used "data" instead of "service_data":

Outdated docs?
Earlier I used ā€œdataā€ in ā€œtap_actionā€ - and it worked.

Btw, here all 3 different "tap_action" seem to give same result (i.e. toggling an "input_boolean"):

type: entities
entities:
  - input_boolean.test_boolean

  - entity: sun.sun
    name: using data
    tap_action:
      action: call-service
      service: input_boolean.toggle
      data:
        entity_id: input_boolean.test_boolean

  - entity: sun.sun
    name: using service_data
    tap_action:
      action: call-service
      service: input_boolean.toggle
      service_data:
        entity_id: input_boolean.test_boolean

  - entity: sun.sun
    name: using target
    tap_action:
      action: call-service
      service: input_boolean.toggle
      target:
        entity_id: input_boolean.test_boolean

For instance, these both codes work for a template switch:

        turn_on:
          - service: input_boolean.turn_on
            entity_id: input_boolean.test_boolean
...
        turn_off:
          - service: input_boolean.turn_off
            target:
              entity_id: input_boolean.test_boolean

But for picture-elements card you are obliged to use "service_data" instead of ā€œtargetā€:

          - type: service-button
            title: Button
            style:
              top: 6%
              left: 20%
            service: homeassistant.update_entity
            service_data:
              entity_id: sun.sun

So, 100500 different variants of calling a service.
There should be ONE way to define data when calling services - and it must be used in docs for examples (all of us may propose corrections in docs, btw).

Btw, got plenty of ā€œrepair requiredā€ after update 2022.9.4 ā†’ 2022.9.5.
These calls were considered as ā€œwrong serviceā€:

                        - service: input_boolean.turn_off
                          target:
                            entity_id: input_boolean.xxxxxx
                          data: {}

Will see, may be will register an issue for this.

Here background, esp. not everything is possible in each case. I agree, that it would be great to have always only one multi-optional way, but here I see the problems of breaking changes for 99,9% of the users as well in removing the ā€œoldā€ ways.

What? No. You completely miss-interpreted what I said.

Target isnā€™t valid in the frontend, i.e. under tap_action.

Itā€™s valid in automation actions, template actions, blueprint actions, and script sequences.

So this is perfectly valid. Just not in the frontend.

1 Like

service_data was just changed to data recently in tap_actions. Before it required the verbiage service_data. Now, service_data and data both work in tap_actions. The docs no longer cover service_data because thereā€™s no reason to at this point. But your old tap_actions will still work if they have service_data and your new tap actions that just use data will also still work.

Yes, see previous post.

1 Like

Yep, and that background doesnā€™t cover tap_actions at all. They have a different history, but similar. Maybe someday the yaml in tap_actions will match the yaml for calling a service in the backend. :man_shrugging:

This post was not really addressed to you. It was basically about ā€œwhy this code is considered as wring serviceā€.

This difference makes a syntax confusing.

This would be good!

Check this code - ā€œtargetā€ seems to work:

type: entities
entities:
  - input_boolean.test_boolean
  - type: button
    name: tap to toggle boolean
    tap_action:
      action: call-service
      service: input_boolean.toggle
      target:
        entity_id: input_boolean.test_boolean
  - entity: sun.sun
    name: tap to toggle boolean
    tap_action:
      action: call-service
      service: input_boolean.toggle
      target:
        entity_id: input_boolean.test_boolean

image

Interesting, that makes it mean that there is a bug. But based on the documents, itā€™s unclear what the expected behavior is. So we donā€™t know where to file the issue. Iā€™d just put it under core and let the devs figure it out. Either tap_action ā†’ target should work everywhere and the documents should include target, or target should not work anywhere and the docs donā€™t need to be updated.

And in custom cards still the ā€œtargetā€ is not used:

  - type: custom:multiple-entity-row
    entity: sun.sun
    name: tap to toggle boolean
    entities:
      - icon: mdi:restore
        tap_action:
          action: call-service
          service: input_boolean.toggle
          target:
            entity_id: input_boolean.test_boolean
    show_state: false

image
Shows an error:
image

Could you post an issueā€™s link here then?
Or I may try to create the issue myself, if you like.

Well, thatā€™s custom:multiple-entity-row not implementing tap action correctly. Iā€™m pretty sure custom cards ā€˜replicateā€™ tap_action and donā€™t use coreā€™s tap_action. Thatā€™s what custom:button-card does and many others.

Right, bad example.
This card has own rules: GitHub - benct/lovelace-multiple-entity-row: Show multiple entity states and attributes on entity rows in Home Assistant's Lovelace UI