Closed Pulpyyyy closed 1 year ago
Hmmm... You are using the group
platform for this. By design, native motor groups are a standalone entity (single remote channel) in the somfy world. I'll have to do some reading to see what the group platform gives us. I certainly do not want it reflecting commands or manipulating the state of the grouped entities.
I do agree. Managing the state of a group is useless. HA does calculate a mean or something, and it's inaccurate. But having the ids allow me to retreive individual states. For example :
{%- macro allstates(group) %}
{% set all = expand(group|lower) -%}
{% set positions = all | map(attribute='attributes.current_position')|list-%}
{% set moving = all | selectattr('state', 'in', ['opening','closing'])|list|count -%}
{% set open = positions | reject("!=",100) |list |count -%}
{% set closed = positions | reject("!=",0) |list |count -%}
{% set other = positions|list|count - open - closed - moving -%}
Fermés={{ closed }} Partiels={{ other }} Ouverts={{ open }} {% if moving >0 -%}Actifs={{ moving }}{% endif %}
{%- endmacro %}
Used in a card
Would a state variable with all of the group members fill the bill?
A state ? An entity attribute will be consistant with the default HA mechanism in HA may be better
As it turns out those are extra_state_attributes. Like everything in HA it involved digging into the CoverGroup to get a full picture of it. There really is no standard but I chose to set the extra attributes as entity_id for an array of string ids mapped to the entity_id.
I will post v2.0.2 with the changes shortly.
EDIT: v2.0.2 posted
I have to dig a bit with the ha expand function as it does not manage entity_id the same way with both 'group' The HA group seems recursive, not the rts one
Ok so I too have a shovel and did some digging. There is some voodoo that is going on with expand where it doesn't quite perform from the list of ids. Anyhow if you update to v2.0.3 it will act like a CoverGroup. Unfortunately, it also has some weird position rules although I managed to get it to not disable buttons with the state.
BTW your template should look like this for defined groups from the backend.
{% set group = 'cover.volets_salon' -%}
{% set rts = expand(state_attr(group|lower, 'entity_id')) -%}
{{ rts }}
Perfect ! Thanks for the well
If you have sun sensors on any of the shades in your group the system also includes a sun sensor now as of v2.1.0. I really don't like the CoverGroup so at some point I have plans to offload all of this onto the ESP if I can, but for now it will allow you to select a position however awful it is.
I am going to close this. Let me know if you have any other issues.
Hello,
ESPSomfy-RTS group mechanism is working fine and you did a good job. I'm just missing a feature : As you can see
cover.volets_salon
does have an extraentity_id
attribute with the cover's ID list when defined as cover group in HA yaml config.ID list is already available in ESPSomfy-RTS UI
May this be added as a new feature ?
Many thanks