Skip to content

Conversation

@hecktech27
Copy link
Contributor

@hecktech27 hecktech27 commented Jul 29, 2025

oh well - this one escalated a little bit... to be honest i just wanted to optimize some sentences in HassLightSet but one optimization led to the next and here we are...
While I really tried to make sure not to lose any previously working sentences please really take your time to review this - since it ended up to be a complete rework of the file!

What´s in this PR:

  • optimizations of expansion rules in the "light"-context

  • a new expansion rule for <hier> which I´d like to apply to other files in the future for a consistent user experience

  • I introduced <floor> to every place needed in HassLightSet so you can now set lights by floor

  • I applied {brightness_level:brightness} to all variations of brightness controls so you can now control lights by "xy auf maximale Helligkeit" - context-aware so either name, satellite area, area or floor as a target

  • I introduced "hell" as a comand( also context-aware) so you can now quickly turn on lights by a command "Schlafzimmer hell" and all lights in Schlafzimmer will be on 100% regardless of the previously configured brightness

  • I tried to create a user-experience as consistent as possible so all sentences working for an area should be working for a floor as well as for the satellite´s area

  • I removed previously possible but not working slot combinations so hopefully no more "Es ist ein Fehler aufgetreten".

  • I >>removed<< <alle_lichter> from all sentences where a slot-area is used since this allowed for sentences like

Alle Lichter auf 10 Prozent.

I decided to remove this option to be consistent with LightTurnOn/LightTurnOff where <alle_lichter> turns off all lights everywhere(which is the reason for the only deleted test sentences). As far as I know there is no possibility to change all lights brightness/colors(please correct me if wrong!).
While i removed <alle_lichter> from "satellite-area / slot: area"-sentences there is still <lichter> since this does not imply that all lights everywhere are changed. So "Lichter auf 10% dimmen" still works.
Happy to discuss this decision! 😊

to make sure i do not lose any previously working sentences i made extensive use of test-sentences for this file.

And the cherry on top:
all the added functionality led to a drop in overall sentence count by another 5 million 😇

@hecktech27
Copy link
Contributor Author

I decided to remove this option to be consistent with LightTurnOn/LightTurnOff where <alle_lichter> turns off all lights everywhere(which is the reason for the only deleted test sentences). As far as I know there is no possibility to change all lights brightness/colors(please correct me if wrong!).
While i removed <alle_lichter> from "satellite-area / slot: area"-sentences there is still <lichter> since this does not imply that all lights everywhere are changed. So "Lichter auf 10% dimmen" still works.
Happy to discuss this decision! 😊

I "discussed" this with myself again and i think maybe support for <alle_lichter> in combination with a non-optional <hier> would be best, since this would allow sentences like

Alle Lichter in diesem Raum auf 10%

to be recognized and the result would be exactly as expected as well as consistent with HassTurnOn/Off behavior.
An optional hier would allow

Alle Lichter auf 10 Prozent

and(when a slot context area is applied) result in the same as above whereas the same with ...ausschalten results in all lights everywhere turned off.

Copy link
Contributor

@andreasbrett andreasbrett left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll leave this one for @mib1185 and @easterapps. My motivation for reviewing this monster of a PR is very low. I never change a light via Assist directly and only ever use scenes.

out: 1
brightness_level_max:
values:
- in: hell[ste]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why only these 2 options and not the full set from <brightness_level>?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

my intention for this one was to use it in a context like

Wohnzimmer hell

and since brightness_level would then allow

Wohnzimmer volle
Wohnzimmer höchste
Wohnzimmer größte
...

i decided to use a smaller set of words for this special purpose...
But maybe i already have a better idea - i will add "Stufe" to the list from 'brightness_level' where needed. This will allow us to use all variations from brightness_level but without the unnecessary permutations.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#3314
the new version got a little longer but covers all useful variations from {brightness_level} in the intended context.

Copy link
Contributor

@mib1185 mib1185 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @hecktech27
Many thanks for all your contributions in the last few weeks, that's awesome ❤️
Can we split this PR into smaller, independent chunks? This would make it much better reviewable.

Copy link
Contributor

@mib1185 mib1185 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Accidentally clicked on comment instead of request change 🙈

@hecktech27
Copy link
Contributor Author

I will have a Look at it tomorrow if i have any good ideas on how to split this up - currently only on my mobile... I might need some input from you on what would work for you @mib1185

@hecktech27
Copy link
Contributor Author

I decided to remove this option to be consistent with LightTurnOn/LightTurnOff where <alle_lichter> turns off all lights everywhere(which is the reason for the only deleted test sentences). As far as I know there is no possibility to change all lights brightness/colors(please correct me if wrong!).

While i removed <alle_lichter> from "satellite-area / slot: area"-sentences there is still <lichter> since this does not imply that all lights everywhere are changed. So "Lichter auf 10% dimmen" still works.

Happy to discuss this decision! 😊

I "discussed" this with myself again and i think maybe support for <alle_lichter> in combination with a non-optional <hier> would be best, since this would allow sentences like

Alle Lichter in diesem Raum auf 10%

to be recognized and the result would be exactly as expected as well as consistent with HassTurnOn/Off behavior.

An optional hier would allow

Alle Lichter auf 10 Prozent

and(when a slot context area is applied) result in the same as above whereas the same with ...ausschalten results in all lights everywhere turned off.

@mib1185 I would really appreciate your opinion on this one so when I split this PR maybe we can skip one iteration of corrections

Thanks and sorry for creating such a big PR - as i wrote above it was not planend for it to become that big but one thing led to the next.... I absolutely see why this is difficult to review!

@hecktech27
Copy link
Contributor Author

hecktech27 commented Aug 4, 2025

@mib1185 (@andreasbrett)
i created #3314 as a PR and #3315 / #3316 as a draft.
would it work for you to iterate through the changes of this PR like i started in the other two PRs?

@hecktech27 hecktech27 marked this pull request as draft August 16, 2025 16:17
hecktech27 added a commit to hecktech27/intents that referenced this pull request Aug 18, 2025
hecktech27 added a commit to hecktech27/intents that referenced this pull request Aug 18, 2025
andreasbrett pushed a commit that referenced this pull request Aug 18, 2025
…s by satellite area (#3373)

* import reference from #3294

* add <hier>

* fix spaces

* add tests

* remove comments
andreasbrett pushed a commit that referenced this pull request Aug 18, 2025
…ightness controls (#3372)

* import reference from #3294

* add <hier>

* remove sentences covered by others

* revert deletion

* remove comments

* remove sentences again - covered by others

* bracket-fix & add tests
hecktech27 added a commit to hecktech27/intents that referenced this pull request Aug 19, 2025
andreasbrett pushed a commit that referenced this pull request Aug 19, 2025
…3378)

* import reference from #3294

* additions to color by area / floor

* remove comments

* more tests
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants