I can think of a couple of options here. The first is to create a second “dummy” sensor that uses a template to provide the state you want. For example, you could create a sensor template as follows:
- platform: template
sensors:
garage_door_status:
friendly_name: Garage door status
value_template: >
{% if is_state('binary_sensor.garagentorknx','Aus') %} Closed
{% else %} Open
{% endif %}
Then use sensor.garage_door_status as your entity.
The second option is to use custom:button-card. It’s very configurable and might seem a little intimidating at the outset. You can find information on that here: GitHub - custom-cards/button-card: Lovelace button-card for home assistant. Using this custom card gives you a ton of flexibility, but there is a somewhat steep learning curve. The payoff is that you can do about anything you want with it.
The easiest approach is probably the first suggestion - you can add a template and, as long as you’re running a recent version of HA, you can reload the templates without having to re-start HA (big help in being able to do that!).
Hope this help!
PSA: I suggest always formatting your yaml entries as described in the forum - it makes it a lot easier to read and figure out… You’ll get more help from folks, too - yaml is difficult enough to format, but it’s almost impossible to read if it’s not formatted properly (you do this by clicking the </> in the header.
Alternatively, you can create a lovelace directory in the main directory, and then put a resources.yaml file in it that has this content, and then point to it like I did above using the !include statement:
#Resources include file for ui-lovelace.yaml
- type: module
url: /local/button-card.js
Did you perchance restart HA after making the change to the config file? I think that needs to be done to reload the resources.
If none of this works, then can you post a little more of your complete lovelace section in your configuration.yaml file? We’ll get it figured out!
Okay, that seems all in order, and the fact that entity-slider-row works is encouraging.
Did you restart HA after adding button-card to the resources section?
If so, then lets take a closer look at how your used the button-card. Can you show a complete section of that? Is the error message include any additional information, or does it also show the button-card information?
Here’s a simple example of how I use it to create a title block:
- badges: []
cards:
- cards:
- type: 'custom:button-card'
color_type: label-card
color: 'rgb(44, 109, 214)'
show_name: true
show_label: true
name: Light/TV Actions
type: horizontal-stack <----- EDIT: forgot to have this in there the first time (2021/01/23)
I switched my config around so it isn’t in yaml mode. I then attempted to add a custom button card to the page. I ended up with this:
So now I’m thinking that there’s something that keeps this particular custom card from working through the UI editor… Is there any way you can (temporarily) try it in yaml mode? I don’t know what else could be wrong at this point, as you’ve done everything else correctly from what I can tell… It seems you had the same type of error:
For what it’s worth, there are benefits to using yaml mode (using the include directive is a big one for me - it lets me break the file into several more compact ones), but I totally understand if you don’t want to go that route.
Forgot to mention - the this._configElement is a part of the custom card.
I picked the horizontal-stack type, but you can use any of the appropriate types here. This is at the top of my yaml file just under the views: line and it works. Sorry about forgetting the type line!
Here’s a screen shot of the above Test Page (which isn’t interesting at all, but shows the above works now):