question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

tap-action for lock doesn't work after update

See original GitHub issue

Checklist

  • I updated the card to the latest version available
  • I cleared the cache of my browser

Describe the bug Tap-action doesn’t work for lock

Version of the card Version: 3.2.2 HA: 0.107.0

To Reproduce This is the configuration I used:

cards:
  - cards:
      - color_type: blank-card
        type: 'custom:button-card'
      - entity: lock.poly_control_danalock_v3_btze_locked
        name: Hoveddør
        show_entity_picture: true
        state:
          - entity_picture: /local/images/lock-locked.png
            tap_action:
              action: call-service
              service: lock.unlock
              service_data:
                entity_id: lock.poly_control_danalock_v3_btze_locked
            value: locked
          - entity_picture: /local/images/lock-unlocked.png
            tap_action:
              action: call-service
              service: lock.lock
              service_data:
                entity_id: lock.poly_control_danalock_v3_btze_locked
            value: unlocked
        style: |
          ha-card{background:transparent;box-shadow: none;}
        type: 'custom:button-card'
      - color_type: blank-card
        type: 'custom:button-card'
    type: horizontal-stack
  - camera_view: live
    entity: camera.front_door
    show_name: false
    show_state: false
    type: picture-entity
  - camera_view: live
    entity: camera.front
    show_name: false
    show_state: false
    type: picture-entity
type: vertical-stack

Screenshots If applicable, add screenshots to help explain your problem.

Expected behavior I would expect the tap action for the lock to lock/unlock the door.

Desktop (please complete the following information):

  • Firefoxn 74.0
  • Chrome 80.0.3987.132

Smartphone (please complete the following information):

  • Device: Sony Xperia XZ2
  • OS: Android 10
  • Browser Android HA App

Additional context I have tried creating the card with only a vertical stack, and also with just the button itself, no joy on either of them.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:8

github_iconTop GitHub Comments

1reaction
RomRidercommented, Mar 19, 2020

It was never an option to define the tap action as part of the state array, it’s not related to an update.

This should work:

cards:
  - cards:
      - color_type: blank-card
        type: 'custom:button-card'
      - entity: lock.poly_control_danalock_v3_btze_locked
        name: Hoveddør
        show_entity_picture: true
        tap_action:
          action: call-service
          service: '[[[ return entity.state === "locked" ? "lock.unlock" : "lock.lock" ]]]'
          service_data:
            entity_id: entity
        state:
          - entity_picture: /local/images/lock-locked.png
            value: locked
          - entity_picture: /local/images/lock-unlocked.png
            value: unlocked
        style: |
          ha-card{background:transparent;box-shadow: none;}
        type: 'custom:button-card'
      - color_type: blank-card
        type: 'custom:button-card'
    type: horizontal-stack
  - camera_view: live
    entity: camera.front_door
    show_name: false
    show_state: false
    type: picture-entity
  - camera_view: live
    entity: camera.front
    show_name: false
    show_state: false
    type: picture-entity
type: vertical-stack
0reactions
DickSwartcommented, Apr 16, 2020

Just an FYI for someone that might have an MQTT LOCK - I had the same issue and thought it was the button card but it was actually the MQTT lock component of home assistant that changed, there is a new option for state_unlocked and state_locked which is different than the payload value.

As soon as I fixed that and made sure the state home assistant is expecting, toggle as the action is working.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Double tap off only working on lockscreen, not on home button
My assumption is double tap to lock your device is not working anymore after oxygenOS12 update but double tap to wake up is...
Read more >
iPhone X auto lock failure because of the car's bluetooth
Before it connected to my car's bluetooth, it works perfectly. This issue happens constantly, so I assume it is an IOS bug. I...
Read more >
How do I change the 3-finger-tap action on my touchpad from ...
Hello, I would like to be able to tap with three fingers to emulate a middle mouse button click (e.g. to open links...
Read more >
Bazecor 1.0 and SuperKeys (Tap Dance) are ready for testing!
Please report what's not working properly and we will fix it asap :) Hey ... After downloading Bazecor, you need to update the...
Read more >
New Good Lock module - RegiStar - Samsung Members
I do like the Back-Tap action, but the only problem is a running in background notification in the notification panel, I tried to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found