What do I have?
I have HA setup, and the normal HA Integration for Sonarr. ( I do not use the HACS addons. ).
The sensors work, and when I look at sensor: sensor.sonarr_shows_2 I do see all my shows listed in the Attributes list.
I try to focus on: sensor.sonarr_queue_2. This sensor only has attributes when a download occures, and the look like:
-
Example:
Trafficked with Mariana van Zeller S02E08 - 8.2%
The problem I have with this is that the Attribute Name will always be different…
What do I want to achieve:
I want to have a conditional tile that shows only of there is a download, and is should show the name and percentage download.
Not too much info to work ‘dynamic’ can mean anything to me … but maybe this is possible with a template and as the standard card do not accept templates you can use hacs “card templater”
I would first try to make sure you can ‘template’ this requirement before even trying with the card.
What i mean by dynamic is that the list can contain anything.
So currently the sensor sensor.sonarr_queue_2 is empty, because there is no download. When some TV Show is downloading an episode the sensor entity: sensor.sonarr_queue_2 shows a 1, because 1 episode is downloaden. The Attribute name can be anything… Like:
Trafficked with Mariana van Zeller S02E08 - 8.2%
or
The Blacklist S01E09 - 10%
or
Vikings S03E05 - 15%
With this code it got it working to catch 1 specific TV Show (Trafficked with Mariana van Zeller) / Episode (S02E08):
The Dynamic part is that the Attribute Name is an ever changing variable. Would it be possible to search for a wildcard, or ANY, in the attribute name?
Paste the content of your sensor with at least one attribute please, not sure if I can help but need tech data , screenshot is also fine (devtools > states)
Hey, do you know maybe how to create a custom sensor that has variable attributes?
what i have: several devices that have the name *valve_position
what I want to get: one sensor which will show the sum as state, and in the attributes will show the name of each device and its state
as mentioned, never done this before but I guess it won’t work with a template.
First of all, if the template would kick back the attribute and if (!) this would be accepted, then the template needs to reload to apply that new value (this is at least what I understand)… when reloading / restarting, I am not sure (doubt) if the template waits for the temlated part getting the attib name…all my thoughts, not 100% sure