Quantcast
Channel: Configuration - Home Assistant Community
Viewing all articles
Browse latest Browse all 95919

Type: 'custom:button-card' and changing color when it's a script?

$
0
0

@jriker1 wrote:

So I have a lovelace entry like the below:

      - card:
          color: var(--secondary-text-color)
          color_type: icon
          icon: 'mdi:exit-to-app'
          name: TV
          show_icon: false
          size: 25%
          styles:
            card:
              - border-radius: 30px
              - height: 53px
            label:
              - color: gray
              - font-size: 9px
              - justify-self: start
              - padding: 0px 5px
            name:
              - font-weight: bold
              - font-size: 15px
              - padding: 0px 0px
          tap_action:
            action: call-service
            service: script.turn_on
            service_data:
              entity_id: script.power_toggle_panasonic_tv
          type: 'custom:button-card'

If I wanted the button and text to change colors when the TV is on, how would I do that being this is just a script execution and not a state change in the card? Is it just something that I can just say click and flip the color and isn’t smart or is there a way to tie this to a sensor that may contain the state? So say I have a sensor sensor.panasonic_tv and that contains the state on or off, or since my TV is dumb, tie it to the Harmony Activity input_select when input_select.harmonytvsource is set to “Watch TV”. How would I incorporate that to show it’s “on” visually?

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 95919

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>