Skip to content

Playback, commands for later or part of the way, brightness amounts, and 1.16.1 - #36

Merged
AboveColin merged 2 commits into
mainfrom
fix/1.16.1
Sep 25, 2026
Merged

AboveColin merged 2 commits into
mainfrom
fix/1.16.1

Conversation

@AboveColin

@AboveColin AboveColin commented Sep 25, 2026 •

Copy link
Copy Markdown
Owner

Fixes #32. Fixes #35.

Playback is not on or off

The action criteria described turn_on as "... start it ..." and turn_off as "... or stop it". So "stop the music" became HassTurnOff, which fails on a music player that has no turn_off.

The criteria now describe power only, and none_of_these names playing, pausing, stopping and skipping media. Measured on hosted Jev with a playing Chromecast Audio, a TV, a light, a switch and a script exposed, one run per sentence:

Sentence Before After
stop the music turn_off 0.98 none_of_these 0.99
Wyłącz muzykę. turn_off 0.98 none_of_these 0.93
pause the music none_of_these 0.32 none_of_these 0.99
play Metallica in the salon turn_on 0.43 none_of_these 0.99
Puść mi metallikę w salonie. none_of_these 0.47 none_of_these 0.92
next song none_of_these 0.92 none_of_these 1.00
turn off the TV turn_off 1.00 turn_off 0.98
turn on the TV turn_on 0.53 turn_on 0.60
Wyłącz telewizor turn_off 1.00 turn_off 0.95
turn off the kitchen light turn_off 0.90 turn_off 0.85
switch on the fan turn_on 0.67 turn_on 0.68
run the music voice request script turn_on 1.00 turn_on 1.00

The TV and the fan were already on, which is why those two sit near 0.6.

A failed intent goes to the fallback agent

An IntentHandleError now goes to the fallback agent with the sentence unchanged. Home Assistant raises it only when no target succeeded (ServiceIntentHandler collects each failed call and raises when success_results is empty), so nothing changed first. With no fallback agent, the reply is an error with FAILED_TO_HANDLE. Any other intent error is also an error reply now. Before, it was spoken as action_done, and a satellite reads that as a command that went through.

Commands for later or part of the way

Home Assistant's on and off intents have no timer, no condition and no position. So "turn off the lamp in 10 minutes" scored turn_off 0.97 and would have turned it off at once, and "open the blinds halfway" scored turn_on 0.80 and would have opened them fully. Two new questions refuse these, later (another time, a duration or a condition) and part (a cover part of the way), each at 0.5.

One question for both was tried first. It refused all the timed sentences, but it also scored "set the lamp to 40 percent" at 0.64 and "dim the ceiling light to 30%" at 0.82, because a brightness level reads as a partial amount. Changing the action criteria instead dropped "turn on the lamp" from 0.60 to 0.44. So they are two separate questions.

Measured on hosted Jev with 12 entities exposed, one run per sentence:

Sentence action later part Result
turn off the lamp in 10 minutes turn_off 0.97 0.98 0.04 refuses
turn on the coffee machine at 7 turn_on 0.98 0.98 0.04 refuses
turn on the lamp for 5 minutes turn_on 0.71 0.96 0.04 refuses
turn on the lamp when I get home turn_on 0.90 0.97 0.05 refuses
zet de lamp over 5 minuten uit turn_off 0.98 0.98 0.05 refuses
wyłącz lampę za 10 minut turn_off 0.92 0.98 0.05 refuses
schalte die Lampe um 22 Uhr aus turn_off 0.97 0.98 0.05 refuses
open the blinds halfway turn_on 0.80 0.03 0.98 refuses
close the blinds to 30 percent turn_off 0.76 0.03 0.97 refuses
set the lamp to 40 percent in 10 minutes set_brightness 1.00 0.98 0.10 refuses
turn off the lamp in the living room turn_off 1.00 0.03 0.04 acts
open the blinds fully turn_on 0.98 0.03 0.03 acts
set the lamp to 40 percent set_brightness 1.00 0.03 0.10 acts
dim the ceiling light to 30% set_brightness 0.95 0.03 0.10 acts
turn the lamp on at 10 percent set_brightness 0.77 0.10 0.10 acts
is the lamp on? get_state 1.00 0.03 0.03 acts
are the blinds open get_state 1.00 0.04 0.09 acts

Of 37 sentences, all 15 that should refuse refused, and 21 of the 22 that should act acted. The other one is "turn on the lamp" at 0.56 with the lamp already on, which the agent answers with "Lamp is already on". It scored 0.61 to 0.64 with and without the new questions, three runs each, so the new questions did not cause it.

The two questions cost 127 input tokens and 32 output tokens: 1,696 to 1,823 for the same sentence. Warm latency was 261 ms without them and 263 ms with them.

Brightness: "to" and "by"

A change word anywhere in the sentence used to be enough to call a number relative, and only some words counted. So 45 of 52 relative sentences in 14 languages set the amount as the level, such as "turn the lamp down 20%" giving 20, and "sube el brillo un 20%" giving 20.

find_brightness now reads the words next to the number:

  • A word for "to" in front of it (to, auf, naar, à, al, para, do, till, до, 到 and others), or the Hungarian -ra/-re suffix, makes it a level.
  • A word for "by" in front of it (by, um, met, de, del, un, o, med), the Hungarian -kal/-kel suffix, or a comparative after it, makes it an amount.
  • With neither, a change word anywhere (increase, lower, dim, erhöhe, 调亮 and the rest) makes it an amount.

An amount gives no brightness, so the sentence goes to the fallback agent.

Test set Wrong before Wrong after
52 relative sentences, 14 languages 45 0
28 level sentences, 14 languages 1 0
24 more, mostly a level with a change word, such as "turn up the lamp to 80%" 3 0

Hungarian also gets százalék and the level stems fény, halvány and világos:

Text Before After
vedd 20%-kal halványabbra 20 None
kapcsold fel 40 százalékra None 40
állítsd a fényerejét 40-re None 40

Checks

  • 27 new tests and cases fail on main and pass here.
  • ruff check and format, mypy --strict, pytest: 520 passed, 12 skipped, coverage 97%, config_flow 100%.
  • mkdocs --strict, hassfest: 0 invalid integrations.
  • On a test instance running this branch, through the Assist pipeline: "turn off the office lamp in 10 minutes" and "turn on the office lamp when I get home" refused with the reason "for another time or on a condition". "open the blinds halfway" refused with "a position part of the way". "increase the office lamp brightness by 20%" refused with no brightness. "stop the music" refused as not a house command. "turn on the office lamp", "turn off the office lamp" and "set the office lamp to 40 percent" acted.

The action criteria described turn_on as "start it" and turn_off as "stop it".
On hosted Jev, "stop the music" came back turn_off at 0.98 and "play Metallica
in the salon" turn_on at 0.43. A music player with no turn_off then failed the
intent. The criteria now name playback under none_of_these, and six playback
sentences came back none_of_these at 0.92 or more.

An IntentHandleError goes to the fallback agent. Home Assistant raises it only
when no target succeeded, so nothing changed. Any other intent error is now an
error reply, so a satellite does not hear it as a command that went through.

find_brightness reads "százalék" and a Hungarian level word, and treats
"20%-kal" and the comparatives as a relative change. "vedd 20%-kal
halványabbra" set the light to 20% before.
@AboveColin
AboveColin force-pushed the fix/1.16.1 branch 2 times, most recently from ce4358c to 0150cb2 Compare September 25, 2026 04:25
Two new questions stop a command that Home Assistant's intents cannot do
as said. "turn off the lamp in 10 minutes" scored turn_off 0.97 and would
have run now. "open the blinds halfway" scored turn_on 0.80 and would have
opened them fully. On a live instance, 15 such sentences now refuse and 22
controls act or, for a lamp already on, say so. Brightness levels
and state questions are among them. One
question for both scored "set the lamp to 40 percent" at 0.64 and refused
it, so they are two. They cost 127 input tokens.

find_brightness reads the word before and after the number. A "to" makes
it a level, a "by", a comparative or a change word with no "to" makes it
an amount. 45 of 52 relative sentences in 14 languages set the amount as
the level before, 0 now. Of 52 other sentences, most of them levels, 4 were wrong
before and 0 now.
@AboveColin AboveColin changed the title Playback goes to the fallback agent, Hungarian brightness, and 1.16.1 Playback, commands for later or part of the way, brightness amounts, and 1.16.1 Sep 25, 2026
@AboveColin
AboveColin merged commit d37c960 into main Sep 25, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant