home-assistant / home-assistant.io

:blue_book: Home Assistant User documentation
https://www.home-assistant.io
Other
4.74k stars 7.17k forks source link

Custom sentences interpreting sentence variables as incorrect data type #29559

Open kuchrk24 opened 10 months ago

kuchrk24 commented 10 months ago

Feedback

I'm not sure this is the right place for this as I'm sure it would work just fine if I were typing the commands out to Assist, but trying to get it to work with a custom voice assistant as detailed in the year of the voice blogs is proving difficult.

Feedback: Update documentation examples with how to force recognized text to a particular data type for use with custom HA voice assistant. The example shows how to build an intent with a media player and setting the volume to a particular percent with the part of the sentence {volume} [percent].

However, when I try to replicate this with a custom fan speed intent, the assistant continues to capture {speed} [percent] as the literal string of "50%". (Or in my previous attempt of setting the fan to a value of 0-10 and multiplying by 10 for the percent, would capture me saying the number 5 and pass through the string "five", which again I can't do math on)

URL

https://www.home-assistant.io/voice_control/custom_sentences/

Version

2023.10.5

Additional information

In the attached image you can see that the voice recognition is interpreting 3 as "three" (sometimes it does recognize it as "3"). With my intent expecting a range of 0 -10, this obviously doesn't work. image

ccooke commented 9 months ago

Just hit this when trying to automate setting an oven - for larger numbers, the parser always outputs numerics but for smaller ones it sometimes gives words, which I can't find a good way to parse.