#Different states based on TV muted/not-muted

1 messages · Page 1 of 1 (latest)

craggy cliff
#

using universal remote card, I currently have this which does toggle the mute, but the icon does not change:

  - type: button
    name: volume_mute
    tap_action:
      action: perform-action
      perform_action: remote.send_command
      target: {}
      data:
        num_repeats: 1
        delay_secs: 0.4
        hold_secs: 0
        command: Mute
    icon: |
      {% if value %}
        mdi:volume-off
      {% else %}
        mdi:volume-high
      {% endif %}
    entity_id: remote.tv_bravia

Any idea how would i go around getting this working?

ornate vault
#

Does the card support templates there?

craggy cliff
#

yeah it does

#

i mean ... I would think so, it seems to react to what i write there

#

I think I'm getting something around handling values wrong

#

I have no idea how to take a peek at the values that are returned ... would have been nice if i could log them or something (i have the logs opened in the VSCode server)

craggy cliff
#

Actaully I know that it does support templating (just remembered) ... I have a small template for on/off button to change the icon

#

I don't necessarily want a direct answer from yall, showing me the path / where to look would also be nice

spiral cape
#

So what icon does it show? volume-off?

#

If value is the state, that is a string, and I think that would be always truthy?

ornate vault
#

That card uses some weirdo template language

#

But yes, I suspect that you're right

craggy cliff
ornate vault
#

Then it's almost certainly that value is always thruthy

leaden leaf
#

Does the remote entity have an is_muted attribute (or something like that)? Instead of value, maybe you need something like state_attr(config.entity, "is_muted").

ornate vault
#

It's just the state of that entity, right? So always a string

craggy cliff
leaden leaf
#

Developer Tools > States

craggy cliff
#

I have seen some logs that made me give it a chance that exists, but not sure

craggy cliff
leaden leaf
#

My only remote entity has a 0 for supported features (so no extra attributes or volume, play/pause, etc.)

spiral cape
#

There's no developer tools for made up template engines of custom cards

leaden leaf
spiral cape
#

Just have to read the documentation and following it.

#

Oh he keeps asking for a debugger for this template (there isn't)

ornate vault
#

I've never heard of that Jinja-like engine before