I’ve managed to figure out solutions to most of my home assistant problems along the way, and it’s been a great ride. Right now I’m stuck on something that I can’t figure out a way around, and I’m not even sure which documents I can read to resolve the issue and my confusion.
Both auto entities and custom bar card have the ability to have tap actions. However, both github pages have different syntax/formatting for their tap actions. I know I have used other custom cards with tap actions syntax that is different than I’ve used else where in subtle ways. But those previous cards still worked just fine
The problem this time is auto entities and custom bar card tap action seem to conflict in my use case and I’m sure if I understood the syntax and rules better I could solve the problem.
What I want to do: I have an input box that, when you submit a string, uses a python script (called by a shell command through a HA script so I can use full python) to create a new sensor through http with the sensors name being based on the input string. Right now my example use case is tracking a food item in the fridge. I have functional pieces that increment the state of the sensors to track hours/days since created.
I want auto entities to display all of these sensors, which it does perfectly. I like bar card to track days elapsed so I can use severity and colors. I’m not married to bar card, but I’d like something I can do with changing colors for quickly triaging lists.
This is all working wonderfully when adding a sensor. What I then wanted to do was remove a sensor when I tapped it. I had a script that would take the sensor name and use a shell command to call my python script to do the sensor removal.
The problem then hit me. When using auto entities options method to do a tap action using this.entity_id it provides me, tapping the sensors does nothing (and no error logs). When I use custom bar cards tap action syntax, clicking a sensor runs my script, but I have no way of sending the entity id value as a parameter to the script (that I know of).
Ultimately I feel what I’m trying to do is possible, at the very least by cracking open one or both of those custom add-ons and figuring out what to change. I was hoping it wouldn’t come to that and there is something I’m missing, but I’m not sure where to start looking because I’m not sure where to begin. I’m putting together two different custom entities and am not sure how to debug their interaction at the right level.
Thanks for any help. I’m not wedded to my solution either so have at it. I just want to display entities created on the fly, track status, color entities by status levels, and delete them when tapped.