Closed fermulator closed 2 years ago
Yes, this could be done.
Api sends all entity_id in attributes: {"attributes": {"entity_id": ["light.kitchen_light", "light.outdoor_light"], "friendly_name": "Kitchen", "order": 0}, "context": {"id": "c0711b8a6081431a8600a22a4109e834", "parent_id": null, "user_id": null}, "entity_id": "group.kitchen", "last_changed": "2020-04-23T21:49:10.603502+00:00", "last_updated": "2020-04-23T21:49:10.603502+00:00", "state": "off"}
With that when we detect a group
inside entity id we can loop trough all corresponding ids. This could be done for turn on/off and maybe for set/adjust intensity.
It's question what action could by done with intent toggle. If do action based on first entity or count states of all entities and do action based on percentage.
Fast workaround is to set all:true
In HA group settings. Group will be only on when all entities are on.
Fast workaround is to set
all:true
In HA group settings. Group will be only on when all entities are on.
downside of this is that if one is using the web UI, then it is more difficult to turn OFF all the the lights in the group hehe
It's question what action could by done with intent toggle. If do action based on first entity or count states of all entities and do action based on percentage.
I was wondering about how to logically handle toggle as well.
On one side, I thought maybe toggle
would actually be a workaround, like if I said
"toggle on kitchen lights"
But of course the pure answer is that
"toggle kitchen lights" , should actually toggle (INVERT) all of the lights within the group.
This could be done for turn on/off and maybe for set/adjust intensity.
Note for set/adjust intensity/brightness; Intuitively, I could suggest that it would ONLY affect the lights in the group that are currently ON.
However I can see the other side of the coin that it should do it for ALL lights ... but some scenarios would not desire that scenario.
@fermulator Test this turn_on_all-group
@fermulator Test this turn_on_all-group
@Tony763 i pulled down your branch on top of the ha skill
/opt/mycroft/skills/homeassistant.mycroftai
mycroftai@mycroftai /opt/mycroft/skills/homeassistant.mycroftai $ git status
HEAD detached at tony673/turn_on_all-group
. restarted mycroft; (not sure how to verify it is actually loading your version...)
but .. after doing so, nothing works at all, so ..
turn on the kitchen counter light skills.log, other
>> I don't understand. voice.log
turn on the kitchen sink light
>> I don't understand, but I'm learning new things everyday.
turn on kitchen light --- 133.48
>> You might have to say that a different way.
Seems just like TYPO: HEAD detached at tony673/turn_on_all-group
Change a order of numbers :)
Seems just like TYPO:
HEAD detached at tony673/turn_on_all-group
Change a order of numbers :)
gawd; how'd that even work? (it wouldn't have been a valid branch fun)
managed to get it working?
@Tony763 sorry no, after the oopsie in the git branch switch, it wiped the config (didn't know the config was stored there! figured skill configs would be in user home...) - need some time delay before i'll try again cause I have to start over :(
@Tony763 - got my setup re-installed on picroft - ready to retest; is that branch you have there still usable? (should we rebase it first?)
Yes, still works. I do not want to rebase it yet as i still have other open issues that i have fixed by this branch but need to test them
@Tony763 is this still valid. I know we have merged a bunch of your stuff since the last comment in this ticket
Closing this due to being stale
Consider the following light group
or
Let's use the kitchen for this example.
"baseline test" -- all lights are off
works!
"subset of lights in a room are on" -- and we want ALL lights in the room on
, doesn't work:
This is because the "state" of the group is on if any one sub-entity is on.
Any suggestions for how to address this scenario?
PS:
, works: