I have a group with ping binary sensors and have an automations that checks if one is down/off.
In the automation I check every sensor manually.
If there and easier way to do this when all the sensors are in the same group and are the same type?
The lack of responses suggest it’s not possible
Doesn’t the group status change if all members are on compared to when just one is off?
No is stays “on” if one of the sensors is “off” and the others are “on”. Kinda like a switch group.
I thought you could use a loop and a template sensor but I am unsure how to limit the loop to entities in a group. (like in the example in the development page the loop searches all sensors)
I use nmap tracker to check if they are all connected. If any of these has not been seen for 10min I use the alert component to get a notification
“Hej” Jeppe
Did you find anything on this, I have the exact same wish, to only check through a group of sensors.
@fribse
Yes and no.
Not as an automation, but something similar using a Lovelace monster card.
This code shows a card with possible errors with states unknown, unavailable or initializing (excluding some sensors and groups).
It can be adapted to suit your needs.
card:
show_header_toggle: false
title: Mulige fejl
type: entities
filter:
exclude:
- entity_id: group.*
- entity_id: climate.*
- entity_id: sensor.octoprint*
- entity_id: binary_sensor.postkasse*
- entity_id: sensor.*remote
- entity_id: sensor.daylight
include:
- state: unknown
- state: unavailable
- state: initializing
show_empty: false
type: 'custom:monster-card'
Ive used a friends code for a good solution to this. I use a custom card fold entity with a template sensor that shows either online or problem.
Here is the code for the lights sensor thing. You can then use a automation or alert that triggers on the template sensor, ive have not done that part yet.
sensor:
- platform: template
sensors:
lights_check:
value_template: >-
{{ is_state('light.bathroom_ceiling_2', 'unavailable')
or is_state('light.bathroom_ceiling_3', 'unavailable')
or is_state('light.bedroom_ceiling_2', 'unavailable')
or is_state('light.hall_bordslampa', 'unavailable')
or is_state('light.hallway_ceiling_2', 'unavailable')
or is_state('light.kitchen_spotlights', 'unavailable')
or is_state('light.kok_spotlight_1', 'unavailable')
or is_state('light.kok_spotlight_2', 'unavailable')
or is_state('light.kok_spotlight_3', 'unavailable')
or is_state('light.led_strip', 'unavailable')
or is_state('light.sangbordslampa_hoger', 'unavailable')
or is_state('light.sangbordslampa_vanster', 'unavailable')
or is_state('light.sovrum_fonster', 'unavailable')}}
lights_status:
value_template: '{% if states.sensor.lights_check %}
{% if states.sensor.lights_check.state == "True" %}
Problems
{% else %}
Online
{% endif %}
{% else %}
n/a
{% endif %}'
friendly_name: 'lights'
I went with this one by @petro which is really nice
So by tweaking it a tinsy bit, to check for off instead of on, and changing the words, it works nicely as far as I can see.