Trying to create Mute Button Toggle automation for Broadlink

Hi All,

I have been trying to follow online example to learn how to create an automation.
First automation that I am trying on my own is a MUTE Toggle button for my TV.

I am trying to use Broadlink Service to trigger the MUTE code (of which was tested in services and works just fine from there)

Here is my Automation:

  - alias: Toshiba Mute Toggle
    trigger:
      - platform: state
        entity_id: input_boolean.mute_tushiba
    action:
      - service: broadlink.send
        data:
          host: 192.168.1.22
          packet: "JgDAAAABKZIUERQRFBEUERQSExIUNRQRFDYUNRQ2FDUUNhQ1FBITNhQRFBEUERQSFDUUERQRFBIUNRQ2EzYUNhMSFDUUNhQ1FAAFHAABKEkUAAxQAAEoSRQADE8AASlIFAAMUAABKUgUAAxQAAEpSBQADFAAASlIFAAMUAABKEkUAAxQAAEoSRQADE8AASlIFAAMUAABKUgUAAxQAAEoSRQADFAAAShJFAAMTwABKUkUAAxQAAEoSRQADE8AASlIFAANBQAAAAAAAAAA"  

When I click on the toggle switch after adding it - Nothing works.
The problem is that I am not sure what I need to do? Since I have setup entity_id: input_boolean.mute_tushiba I could not find the entity to be added I could only found automation.toshiba_mute_toggle Not the input Boolean but an Automation.

I have added the automation.toshiba_mute_toggle where I needed to add an Entity - Here I am not sure I did correctly at all. Since I wanted to add the toggle button right after the Up and Down of the Volume.

I could not make it to work at all. Nothing came out from the RMPro while I was clicking the toggle - that I am sure I am not doing it right.

Please assist me on understanding what went wrong? and How I should be doing it??

The problem got complicated when I tried to use the Automation panel under configuration. I have been asked to add trigger entity and I did not have any entity to add since I was trying to add the entity on the fly - and I got error NOT RECOGNIZED.

So I am not really sure if that was the correct way of doing it.
Please assist me on making the toggle button work with my Broadlink RM Pro.

Thank You!

Well if you dont have the correct entity id for the input_boolean it is never going to trigger

Have you restarted since creating the input_boolean?

Did the configuration check pass before restarting?

If not what was the error?

Have you looked in the developer tools states menu for the input_boolean?

What does your input_boolean config look like (paste it here)?

Thanks,
How do I create the entity_id? does it need to be a switch only?
Here is what I have added:
Trigger0

      - entities:
          - entity: switch.study_fan
          - entity: switch.study_tv
          - entity: switch.tv
          - entity: switch.saloon_tv
          - entity: switch.volume
          - entity: automation.toshiba_mute_toggle
        title: Switch
        type: entities

Trigger
I am able to trigger the service after I click on it and click trigger.
That is not how I wanted it to be done
I would like to be able to slide the button from one state to another and MUTE the tv by doing so.

Yes I have searched for the input boolean and could not find any… Just the automation was there. so i have used it.

This is the only one I have configured:

input_boolean:
  zigbee_permit_join:
    name: Allow devices to join
    initial: off
    icon: mdi:cellphone-wireless

that is all I have.
Do I need to add something? Change something?

Thanks

How do I create the entity_id?

You have to create another input boolean for triggering the mute automation you created.

Taking the one listed in your automation, add this:

input_boolean:
  zigbee_permit_join:
    name: Allow devices to join
    initial: off
    icon: mdi:cellphone-wireless
  input_boolean.mute_tushiba:
    name: Mute Toshiba
    initial: off
    icon: mdi:volume-off

You have been triggering the automation. Leave that switched on (automation enabled).

Then add this entity to an entities card in the front end:

input_boolean.mute_tushiba

Click that switch to mute the audio.

Having said all of that, a better way would be to forget the input_boolean and automation and use a script and an entity button card instead.

script:
  mute_toshiba:
    sequence:
    - service: broadlink.send
        data:
          host: 192.168.1.22
          packet: "JgDAAAABKZIUERQRFBEUERQSExIUNRQRFDYUNRQ2FDUUNhQ1FBITNhQRFBEUERQSFDUUERQRFBIUNRQ2EzYUNhMSFDUUNhQ1FAAFHAABKEkUAAxQAAEoSRQADE8AASlIFAAMUAABKUgUAAxQAAEpSBQADFAAASlIFAAMUAABKEkUAAxQAAEoSRQADE8AASlIFAAMUAABKUgUAAxQAAEoSRQADFAAAShJFAAMTwABKUkUAAxQAAEoSRQADE8AASlIFAANBQAAAAAAAAAA"  

Lovelace card (cut and paste this into a manual card):

type: entity-button
name: Mute Toshiba
icon: mdi:volume-off
tap_action:
  action: call-service
  service: script.mute_toshiba
entity: script.mute_toshiba

Thanks, But did you mean with input_bolean or without? I have tried this method and I used it without the input_boolean just used mute_tushiba and not input_boolean.mute_tushiba

 input_boolean.mute_tushiba: or mute_tushiba: ?

When I did that I did not even had the trigger button so nothing happened with this method.
The one I made using the code I have posted at the beginning - gave me the ability to trigger the script and I was able to use the trigger to mute and unmute


I have also tried the second method you suggested, And I was able to trigger the mute BUT it needed to be on a separate button - not within the TV Control Panel at all.

Is there a way that I will be able to transform the button to a functional sliding switch?

Thank you so much for your help I have progressed so much.
Thanks

No the second method does not use an input boolean, as I said:

a better way would be to forget the input_boolean and automation and use a script and an entity button card instead.

For the first method:
The circled entity on the right is an automation. Turn it on (enable the automation) and remove it from the card and put the input boolean there instead.

For the second method (after deleting the automation and input boolean) just put the script in the card instead of creating the button card.

OK, I am now getting the idea.
Just I am not sure I do I enable an automation?
I have already created the entity for the input_bolean as you instructed me.
the missing peace in my puzzle right now is - How do I enable an automation?

Thank you so much!

See the circled switch in the right hand image you posted?

That is the switch to enable/disable the automation. Not to trigger it.

1 Like

Yes! I see it now - Can I made an automation enabled by default and I will not need to click to enable it?
Thanks

Yes indeed you can.

 - alias: Toshiba Mute Toggle
   initial_state: true ### <------ add this ###
    trigger:
      - platform: state
        entity_id: input_boolean.mute_tushiba
    action:
... etc
1 Like

:clap::clap::clap::clap::clap::clap::clap::clap::clap::clap::clap::clap::clap:
Thanks!!! You made it to work!!
image
Thank you so much I have learned a lot!

1 Like