Entity Button Tap_Action inconsistencies (possible bug?)

I am seeing inconsistencies with the use of tap_actions. In some cases it will not work formatted as “tap_action” but works when formatted as “tap action” Has anyone else seen this behavior? I am running 0.102.3. Below is the code in question. Everything is working.

  - badges: []
    cards:
    - type: vertical-stack
      cards:
      - type: horizontal-stack
        cards:
        - type: entity-button
          entity: scene.movie_time_on
          name: Move Time On
          icon: 'mdi:television'
          icon_height: 45px
          tap_action:
            action: call-service
            service: scene.turn_on
            service_data:
              entity_id: scene.movie_time_on
        - type: entity-button
          entity: scene.movie_time_on
          name: Move Time Off
          icon: 'mdi:television'
          icon_height: 45px
          tap_action:
            action: call-service
            service: scene.turn_on
            service_data:
              entity_id: scene.movie_time_off
      - type: horizontal-stack
        cards:
        - type: entity-button
          entity: light.tv
          name: LIFX TV Backlight
          icon_height: 60px
          tap action:
            action: call-service
            service:
              entity_id: light.tv
    icon: 'mdi:television'
    path: scenes
    title: Scenes

I have additional entity buttons setup with “tap action” which are working. The following error is posted in the log when the button doesn’t work:

2019-12-09 21:03:28 ERROR (MainThread) [frontend.js.latest.201911196] http://10.X.X.X:8123/frontend_latest/chunk.d5961ced1d8380ae21ba.js:1741:4646 Uncaught TypeError: c.service.split is not a function or its return value is not iterable

The one without the underscore doesn’t actually have a service, so I don’t think that’s working at all. Probably just falling back on default behaviour.

So what would be the correct way of setting up the entity button to toggle the light off and on? It works as is but don’t want issues in the future if the code is incorrect…

tap_action:
  action: call-service
  service: light.toggle
  service_data:
    entity_id: light.tv

However you can ommit all of that code completely as that is already the default, which is why you thought it was working without the underscore.

Way to obvious :blush: Can’t believe I missed that, and my attempt to over engineer! I am still figuring out how everything interacts.

Thanks for you help!.

1 Like