Playback, commands for later or part of the way, brightness amounts, and 1.16.1 - #36
Merged
Merged
Conversation
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
force-pushed
the
fix/1.16.1
branch
2 times, most recently
from
September 25, 2026 04:25
ce4358c to
0150cb2
Compare
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
force-pushed
the
fix/1.16.1
branch
from
September 25, 2026 04:25
0150cb2 to
b925a23
Compare
This was referenced Sep 25, 2026
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #32. Fixes #35.
Playback is not on or off
The action criteria described
turn_onas "... start it ..." andturn_offas "... or stop it". So "stop the music" becameHassTurnOff, which fails on a music player that has noturn_off.The criteria now describe power only, and
none_of_thesenames 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: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
IntentHandleErrornow goes to the fallback agent with the sentence unchanged. Home Assistant raises it only when no target succeeded (ServiceIntentHandlercollects each failed call and raises whensuccess_resultsis empty), so nothing changed first. With no fallback agent, the reply is an error withFAILED_TO_HANDLE. Any other intent error is also an error reply now. Before, it was spoken asaction_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) andpart(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:
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_brightnessnow reads the words next to the number:to,auf,naar,à,al,para,do,till,до,到and others), or the Hungarian-ra/-resuffix, makes it a level.by,um,met,de,del,un,o,med), the Hungarian-kal/-kelsuffix, or a comparative after it, makes it an amount.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.
Hungarian also gets
százalékand the level stemsfény,halványandvilágos:Checks
mainand pass here.--strict, pytest: 520 passed, 12 skipped, coverage 97%, config_flow 100%.--strict, hassfest: 0 invalid integrations.