How to create a color button state when existing entity button uses "Activate"

Hello - I am new to HA, and I am having trouble creating a colored button on my dashboard to show when I have a speaker on or off. I migrated my devices into HA from Tuya, which include lights and speakers. The lights show as toggle buttons to turn on/off, but my speakers, which I use a wifi relay switch to turn on/off do not have a toggle button to show the speaker state on/off; I can only select “Activate” to turn on/off, which doesn’t display if the speakers are on/off.


Any assistance in creating this button(s), I would greatly appreciate!

Thank you

Christopher R.

Scenes don’t have an on/off state, so they don’t display as a toggle switch.

If you want that, use something other than a scene to set your speaker states.

1 Like

Hello Tom,

I am sorry to bother you, but I am completely stuck on creating this custom button, but I’m on my last step. I have been able to create the button with the help of one of our community members. However, I cannot show the state the button is in. I would like to show the state (on/off) and the color change of the state icon. This is what I have created so far:

type: custom:button-card
entity: automation.new_automation
icon: mdi:volume-high
tap_action:
action: call-service
service: switch.toggle
service_data: null
target:
entities:
- switch.office_guest_bed_rm_speakers_switch_3
- switch.office_guest_bed_rm_speakers_switch_4
entity_id: input_boolean.office_speakers
show_state: true
state:

  • value: ‘on’
    color: lawngreen
  • value: ‘off’
    color: grey
    name: Office Speakers
    hold_action:
    action: toggle