#voice control a button
1 messages · Page 1 of 1 (latest)
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)
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.
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
Could you maybe create a code example. I am trying for hours but nothing works
Sorry, that would involve investigation, taking time i can't afford right now 😦
the on/off thing would be nice but my main wish is to be able to say:
"press [Alias]"
I totally get that :c
thank you for your time
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).
Check inbuilt HassTurnOn intent in HA code
where do I find that ^^'
You'll have to pull HA Core repo i guess
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
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.
"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