#voice control a button

1 messages · Page 1 of 1 (latest)

exotic raptor
#

There are default sentences for switches (turn on/off [Switch name])
How do you press a button with out creating an automation for every single one
Something like (press [Button name])

rigid herald
#

You can make wildcard

#

I'd use custom_sentence and inent_script.

exotic raptor
#

currently I am doing it like this:

intents:
Button:
data:
- sentences:
- (drück|drücke) {button}

button:
values:
- in: "(Bluetooth Audio|Audio|Bluetooth)"
out: "button.bluetooth_audio_transceiver_on_off"

intent_script:
Button:
action:
action: button.press
data: {}
target:
entity_id: "{{ button }}"

but I would love to use the alias defined for use with assist

#

sorry for my bad english

#

Also I would love to use the same sentence as the switches
(turn on/off button) -> both just press the button
But that interferes with the switches
It should just use whatever fits the entity (either button.press or switch.turn_on/off)

rigid herald
#

I believe you can use alias for geting entity.

#

For turn on/off you'd have to extend HassTurnOn and HassTurnOff inbuilt sentences. But it involves changing HA code.
Also you could, of course, write your own sentence for "turn on/off", but that would completely override inbuilt one.

#

HA won't do it - because no one says "turn on button". Buttons are pressed, they're stateless.

exotic raptor
#

Yeah but I have a lot of buttons which turn on/off devices. Like the on/off button on a tv remote

I don't want to say "press tv on/off button"
"turn the tv on/off" would feel way more natural
although it wouldn't really turn the tv on/off.. its more like a toggle

exotic raptor
rigid herald
#

Sorry, that would involve investigation, taking time i can't afford right now 😦

exotic raptor
#

the on/off thing would be nice but my main wish is to be able to say:
"press [Alias]"

exotic raptor
#

thank you for your time

rigid herald
#

Check inbuilt HassTurnOn intent in HA code and see how it's taking entity IDs - because it works with aliases. (There was a bug, but i fixed it with my PR couple months ago, so aliases work even if they're the same but in different areas).

exotic raptor
rigid herald
#

You'll have to pull HA Core repo i guess

rigid herald
exotic raptor
#

Thank you so much, I'll take a look but sadly I suspect that this is too difficult for me ^^'
I have no Idea what I am doing

exotic raptor
#

I cannot be the only one who wants a general button intent, right?

rigid herald
# exotic raptor I cannot be the only one who wants a general button intent, right?

Assist intents are still on early stages of development, and actually I don't think they will be too sophisticated in the end - there's a lot of clashes in human speech to be easily parsed with simple scripts.
The future of such communication is parsing with LLM - but for now they're pretty restricted too...
I just write scripts for every use case I have for now.

exotic raptor
#

"I just write scripts for every use case I have for now"
Well, that's basically what I did. But I kept writing the same script again and again so I tried to simplify it by generalizing it
... But I failed ^^'

I just wanted to be able to say "turn on/off alias" and it either uses button.press or switch.turn_on/off depending on the entity linked to the alias