How to monitor/track unavailable devices

I did exactly that - very simple change to the code to include rather than exclude. Works great.

Very good!
But it should be possible to add domains in the exclusion group, for example medai_player* (wilcard ?)

1 Like

could you share how you did this? I want to do this, but I cant seem to be able to add groups in the yaml configuration (only for binairy sensors, lights etc.)

I ended up using package, i think itā€™s THIS ONE. Works great, althoug now i see that i have outdated version (author did quite some changes from back then). But it works perfect. I ended up using original version - all unavailable entities are shown except ignored ones. Using it reversed is - well, a bit ā€œdangerousā€ since itā€™s very easy to forget to add new sensos/device and you donā€™t have a control over it.

Nice guide, and Iā€™m glad you found the template useful. But the very least you could have done was attributed and linked back to the original source. @Protoncek has done that for you here, perhaps you should consider doing the same on your blog.

@jazzyisj im using the GIT code and it works great, but what I am now finding is i really dont care about the entity as much as I care about the device. At the end of the day, in most cases, fixing the device fixes several of its entities. How do i get the parent device from the entity?

1 Like

1 Like

Hi,
Anyone tried to use the code which have as example on documentation?

Didnā€™t work?

  • has_value('sensor.my_sensor') will test if the given entity is not unknown or unavailable. Can be used as a filter or a test.

I had a similar issue with an unavailable device upsetting my values. The following code in configuration.yaml worked for me;

template:
  - sensor:
    - name: "Total Solar Power"
      unique_id: total_sol_power
      unit_of_measurement: "W"
      device_class: power
      state_class: measurement
      state: >
        {% if is_state('sun.sun', 'below_horizon') %}
          {{ 0 }}
        {% elif is_state('sensor.pv4_power', 'unavailable') %}
          {{ states('sensor.pv1_power') | float | round(3) + states('sensor.pv2_power') | float + states('sensor.pv3_power') | float }}
        {% else %}
          {{ states('sensor.pv1_power') | float | round(3) + states('sensor.pv2_power') | float + states('sensor.pv3_power') | float + states('sensor.pv4_power') | float }}
        {% endif %}