Hi all,
I’m currently trying to make picture-elements card that reflects the state of devices on my network, so I can basically get a network overview at a glance. I’ve got icons reflecting the ping state of devices that currently change from the normal green to red should the ping fail. What I’d really like to do is add a third colour state that is orange if the state has changed in the last 24hrs, as when there’s an intermittent issue it’s fairly unlikely that I’ll spot it unless I happen to look at the overview at exactly the correct time.
Would anyone have any cunning ideas how I can do this as all I can think of at the moment is another set of sensors for each ping point that track the state somehow, but I think that’s likely to become a beast to implement. Cheers, Matt
Don’t think you’ll be able to achieve this with the default picture elements, so you either need to create more template entities, or start looking into custom cards.
I’d probably create a second problem class entity which turns on when the endpoint is disconnected, with a delay_off set to 24 hours. But maybe messing with custom templates would be more succinct.
Assume you are monitoring some binary_sensor which is normally ON. Set up a history_stats sensor: if the monitored binary_sensor = OFF starting from 00:00 - then the sensor is increased by 1. I.e. this sensor will give a number of ON->OFF transitions within some defined period (here - a day).
This gives me the three colour icon for a single ping sensor (Red - Ping Failed; Orange - Ping healthy but has failed in the last 24hrs; Green - Ping healthy and has been for 24hrs). That’s all great but is there any way I can avoid having to duplicate the card_mod section for each of my sensors?