Toggle an HA Group #200
Unanswered
philosowaffle
asked this question in
Q&A
Replies: 1 comment 5 replies
-
I’m not sure I would call it a limitation as it is toggling the state of each entity in the group. If I understand you correctly you would like both lights to turn on if they are both off and both to turn off if either or both are on. To do that I use a script. |
Beta Was this translation helpful? Give feedback.
5 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello! Have a question about toggling a group of entities, sorry if this has been asked before. I did some searches through the discussions but did not find anything that seemed the same. So lets say I have the following setup in HA:
In HA lovelace, I can create a card like below. It references the
group.myGroup
entity and calls theToggle
action on tap. If any single light in the group is ON, then toggling the Group will turn them all OFF. And if all of the lights are OFF, then toggling the Group will turn them all ON. This works by default in HA, no custom scripts needed. This is the behavior I am trying to mimic in floorplan.Now in my SVG I have an element
group.myGroup
and in my yaml I define the following:When both
lightA
andlightB
have a matching state, this works exactly as expected, both entities are toggled either on or off on tap.The problem arises when
lightA=on
andlightB=off
. When thehomeassistant.toggle
service is called, it toggles each entity in the group individually, instead of toggling the group as a whole. So the end result islightA=off
andlightB=on
.I did some testing on HA in the Developer Tools, if you call the
homeassistant.toggle
for agroup
entity it also yields this weird behavior of toggling each entity in the group instead of the group as a whole. So I'm not sure how the lovelace is working, its clearly doing more than just using the underlying HA toggle service.So, my question. Given this limitation in the
homeassistant.toggle
service, is there a way I can use functions or something in my floorplan yaml to achieve the same behavior as toggling a group from lovelace?Beta Was this translation helpful? Give feedback.
All reactions