group.sensor_power_entities
is holding a series of sensors with the current power.
I also created a sensor to calculate the total power consumed by all these entities together.
sensor:
- platform: template
sensors:
power_getotaliseerd:
friendly_name: Power Plugs en Modules Total
unit_of_measurement: W
device_class: power
icon_template: mdi:plus-box-outline
value_template: >
{{expand('group.sensor_power_entities')|map(attribute='state')|map('float')|sum|round(0)}}
Now, instead of āonbekendā I would like to display the value of sensor.power_getotaliseerd
This makes sense, before unfolding I already see the total power.
But I canāt find a way how to show this because head is being used to populate the entities list after unfolding in this case, and not to define what to show on this particular line.
Iām also wondering about using templating within this card. Iām trying to make a fold-entity-row thatās only open if an entity is āonā ā is that possible? So far itās not giving me errors, but itās also opening the row regardless of the entityās state:
When the chevron is not hidden it can be used to fold/unfold items:
When the chevron is hidden it cannot be used:
But there is a problem: if the items are unfolded and the chevron is hidden - then the items continue to be unfolded (which is wrong):
Ideally when setting the ālocking conditionā to āonā we should unfold the items too. But I do not know any method to achieve this.
Surely we may use a config-template-card to set an āopenā option dependingly on the same condition as described above. But then we have to list all entities in the āentitiesā option of the config-template-card (which may be cumbersome).
Here is an example:
Both sun entities are included in the fold. One is included via the auto-entities and one is just a plain old entity add. I seem to be getting padding on the left for any auto-entities.
I would expect with this example, both suns to be lined up since they are both part of the same fold with the same padding defined. Is this a bug? or operator error?
EDIT: Actually I see WHY. auto-entities is a card, not a row so its in the wrong place.
Thanks but yes I tried that as well. The issue here is I am trying to combine a nested fold and then single entities. In the example the two suns really would be different entities.
This is the structure:
-> Fold 1 (correct padding)
--> Fold 2 (correct padding)
\auto-entities\ (incorrect padding-left since this is a card and not a row)
--> entity1 (correct padding)
--> entity2 (correct padding)
--> entity3 (correct padding)
No matter how i attempt to structure the above, the left padding spacing is off for the Fold 2 since its a card and not a row. The card doesnāt honor the padding:0 and if auto-entities isnāt wrapped within a fold, it isnāt padded naturally.
THis is better picture of what is happening. The motion sensors are indented as if they are under the fold but they are not. The are a seperate set of entities (unfortunately contained in a dynamic card because of auto-entities. The spacing to the left of those motion entities is what should be pushed left to the same level as the ātimersā fold.
Youāre missing the outer fold. If a card (auto-entities here) is contained in the fold itāll push left as you can see in my code. I have it fixed now though with card-mod.
Because the top-level fold-entity-row in your card is containing auto-entities - but you were advised to change it.
Of course, if fold-entity-row contains āentities cardā you will have horizontal paddings, then card-mod is the only way.
Actually, in your position, with so many rows & many folded lists, I would choose a āfold-entity-row contains an auto-entiiesā schema with card-mod (+scrollbars) too.
It is possible, but with a help of vertical stack w/o margins.
Just place auto-generated 2-levels lists in a stack.
Here is an example of a list of groups:
vertical-stack will give the same issue. The vertical stack canāt be placed under the fold-entity-row without something like custom:hui-element (if this is done, you have the same issue). If the vertical stack is placed at the top most level, you still need to nest the fold/auto-entities just the way I have them.
The end result should look like I have it now in the screenshot above. Do you have an example using vertical stack that produces that result?