I have a card with a single input.boolean entity to toggle a Mute command to my AV amplifier.
When I click the switch, it slides from left to right and the slide becomes blue. The amplifier is muted.
So far, so good.
In addition, I have a volume control card. If I adjust the volume, the amp automatically un-mutes. This feature has nothing to do with HA. All amps behaves the same way.That’s ok. But HA doesn’t know this, so the Mute card continue to show as if still muted.
What I’d like to know, is how I can control the visual appearance of the switch on a card without actually triggering the action associated with it?
The objective is to visually indicate Mute=off everytime volume is adjusted.
Turn off the automation that the input_boolean triggers. Change the input_boolean. Turn the automation back on.
Oh - and how do I turn off/on the automation?
Call the home assistant turn off service or manually switch the button in the front end.
What is wrong in this action then:
Not sure, I dont use the automation editor. It looks right though.
This is how you would do it in yaml:
- service: homeassistant.turn_off
entity_id: automation.oywin_harmony_mute
It didn’t work, so I tried this instead:
alias: Automation Test
trigger:
- entity_id: input_boolean.oywin_automation_test
platform: state
to: 'on'
condition: []
action:
- data:
entity_id: automation.oywin_harmony_mute
service: automation.turn_off
But that doesn’t work either, but there’s no error messages in the log.
My corresponding entry in the configuration.yaml file, is:
input_boolean:
oywin_automation_test:
name: Automation Test
initial: false
Are you sure this is correct:
automation.oywin_harmony_mute
Check the name in the developer tools states menu (the <>
button in the lower left hand menu).
Aha - I think you made a good point there (I’m beginning to learn). There is no such name in the states menu, so I changed it to:
automation.harmony_mute
The states name is:
But still it fails!
[Edit] Remarkebly! I went for a hike, came back 2 hours later - and now it works?!? (Beats me)
I’d be using the volume state to turn off the input Boolean when the volume state changes - or am I not understanding something?
@DavidFW1960, thanks for stopping by
I’m not sure I understand what you mean, but I’m sure it’s valuable!
My objective is best illustrated with this first rudimentary card (Step #1 into a full blown AV control centre):
- The sound has been muted (at will).
- When pressing the Up or Down switch, I want mute switch to visually turn off without running the automation (since mute is a toggle).
My next step is to try to figure out how I can read the mute status from the Harmony Hub in order to make the switch reflect the actual status and not just what it’s assumed to be. This way, when someone press the mute button on the Harmony Remote (the physical device), the mute switch in the HA GUI will detect that and change accordingly. Any Ideas on how to do that, would be much appreciated.
So when you hit the volume up or down, that will change the state of that entity. So in your automation you could turn off the mute button but then as a condition, only run the associated action (which would happen if you switched it off) to not do anything if the up or down state last_changed was say in the last 10 seconds…
[quote=“DavidFW1960, post:12, topic:96363, full:true”]
So when you hit the volume up or down, that will change the state of that entity.
[/quote] Not change, but turn off.
[quote …not do anything if the up or down state last_changed was say in the last 10 seconds…[/quote] There’s no need for that. anytime the up/down is pushed, the mut is set to off whether it was off already or not.
Yes but it’s not turning it off in Home Assistant… In Home Assistant the state (ON or Off) doesn’t change. Isn’t that the problem? So if you monitor the state of the volume up/down push, you can use that state change to change the visible state of your input_boolean… but if that has changed the state, then any automation you have firing when the input_boolean turns off needs to be disabled or ignored…
For example… you probably have an automation that is triggered when the switch turns off (mute is on or off) - it either mutes the amp or unmutes it…
Now say it’s On (the input_boolean) and the amp is muted… and you change the volume… well then you know the amp is on but you don’t want to just toggle the input_boolean because that will fire the automation… so you could have a condition that says the volume was changed in the last 10 seconds so just toggle the switch but don’t fire the automation…
@DavidFW1960 - I think I understand your point, but not exactly why/how it would improve what I already have going. Your suggestion may be more “elegant” and perhaps “cleaner” and more logical from a programmers perspective. But the functional end result would be the same.
Since what I have so far - is just a stepping stone onwards, I’d like to focus on moving ahead rather than refining something that eventually will be replaced all together.
I found this the demo/example section of the HA Docs, but so far I have no idea how to implement it: