Spook -Your homie

That doesn’t sound like a general case, but more like an automation you could create? :man_shrugging:

An unavailable sensor is still an existing sensor…?

Yes but I’m able to create an automation but that doesn’t prevent spook from issuing the warning

Hi @frenck I have just updated to the latest version of HA 2024.7.0. There was a repair issue with platform system monitor and I accidentally clicked ignore.

Is there a way to bring it back so i can look and try and fix it?

Ignored Repairs can be viewed in Settings > Systems > Repairs by clicking the 3-dot expansion menu at the top right and checking “Show Ignored Repairs”

1 Like

@Didgeridrew Thanks!!! :pray:t5:

A couple of questions…

If I click to ignore a repair that is showing entities missing in the overview for two specific entities will that ignore all repairs caused by missing entities even if they aren’t those previous specific entities?

ex.

I have two missing entities from an integration that I don’t always use and use it for testing purposes only. So the vast majority of the time those entities are missing. But I still might need to use them later and when I do I want them to show up in a normally hidden view in the dashboard. When I want to use those entities I re-add the integration and I unhide the view.

Let’s say those entities are sensor.test_1 and sensor.test_2.

If I click on the ignore repair for those missing entities will the repair come back on for other entities that weren’t included in the original repair for those entities?

Or will it ignore all repairs for other later missing entities in the overview as well?

Or if that is the case then is there a way to tell Spook to ignore specific missing entities from generating a repair?

Yeah, I’m sure that’s all clear as mud… :grinning_face_with_smiling_eyes:

:ghost::ghost::ghost::ghost::ghost::ghost::ghost::ghost::ghost::ghost:

v3.1.0

This release prepares for the upcoming Home Assistant 2024.8 release :rocket:

While it is not required to upgrade (2024.8 isn’t breaking Spook, and Spook not breaking 2024.8), it does take into account changes made in Home Assistant 2024.8. That release will rename “Services” to “Actions”, which Spook has done now as well :sunglasses:

Furthermore, we have a brand new action available this release: homeassistant.list_orphaned_database_entities, contributed by @gieljnssns.

Oh! And @piitaya :mushroom: dropped by to add support for finding unknown entities in the new (experimental) sections dashboards! Nice :heart:

:sparkles: New features

  • Add list_orphaned_database_entities service @gieljnssns (#752)

:bug: Bug fixes

  • Fix decimal math inaccuracy in increment/decrement services @frenck (#766)
  • Remove platinum quality scale markers (they were fake anyways) @frenck (#804)

:rocket: Enhancements

  • Search for unknown entities inside sections @piitaya (#798)

:toolbox: Maintenance

  • Translations update from Hosted Weblate @weblate (#747)
  • Translations update from Hosted Weblate @weblate (#761)
  • Rename ‘service’ to ‘action’ following Home Assistant 2024.8 @frenck (#805)
  • Translations update from Hosted Weblate @weblate (#807)

:books: Documentation

  • Rename ‘service’ to ‘action’ following Home Assistant 2024.8 @frenck (#805)
  • Fix link to import statistics @frenck (#806)

:arrow_up: Dependency updates

Details
  • :arrow_up: Update dependency node to v20.13.0 @renovate (#755)
  • :arrow_up: Update softprops/action-gh-release action to v2.0.5 @renovate (#754)
  • :arrow_up: Update actions/checkout action to v4.1.5 @renovate (#756)
  • :arrow_up: Update dependency node to v20.13.1 @renovate (#757)
  • :arrow_up: Update eifinger/setup-rye action to v3 @renovate (#759)
  • :arrow_up: Update eifinger/setup-rye action to v3.0.1 @renovate (#765)
  • :arrow_up: Update actions/checkout action to v4.1.6 @renovate (#767)
  • :arrow_up: Update eifinger/setup-rye action to v3.0.2 @renovate (#770)
  • :arrow_up: Update dependency node to v20.14.0 @renovate (#772)
  • :arrow_up: Update actions/checkout action to v4.1.7 @renovate (#777)
  • :arrow_up: Update softprops/action-gh-release action to v2.0.6 @renovate (#778)
  • :arrow_up: Update dependency node to v20.15.0 @renovate (#779)
  • :arrow_up: Update eifinger/setup-rye action to v3.0.3 @renovate (#780)
  • :arrow_up: Update eifinger/setup-rye action to v4 @renovate (#788)
  • :arrow_up: Update eifinger/setup-rye action to v4.0.2 @renovate (#789)
  • :arrow_up: Update dependency node to v20.15.1 @renovate (#790)
  • :arrow_up: Update actions/setup-node action to v4.0.3 @renovate (#791)
  • :arrow_up: Update eifinger/setup-rye action to v4.1.0 @renovate (#792)
  • :arrow_up: Update eifinger/setup-rye action to v4.2.0 @renovate (#793)
  • :arrow_up: Update sigstore/gh-action-sigstore-python action to v3 @renovate (#794)
  • :arrow_up: Update softprops/action-gh-release action to v2.0.7 @renovate (#795)
  • :arrow_up: Update softprops/action-gh-release action to v2.0.8 @renovate (#797)
  • :arrow_up: Update eifinger/setup-rye action to v4.2.1 @renovate (#799)
  • :arrow_up: Update dependency node to v20.16.0 @renovate (#800)
  • :arrow_up: Update eifinger/setup-rye action to v4.2.2 @renovate (#801)

:ghost::ghost::ghost::ghost::ghost::ghost::ghost::ghost::ghost::ghost:

3 Likes

The list_orphaned_database_entities service is great.

What would make it better would be a way to display the reponse_variable on a dashboard.
Then it would be simple to create a dashboard/script that takes an input_text value and purges based on that pattern.

Is that possible now?


I have 1288 orphaned entities and over 1000 of those are geo_location.lightning_strike_nnnn
It would be nice to get rid of those in one go before checking if the rest can be removed

1 Like

You can try this script

alias: Delete orphaned lightning_strike entities
sequence:
  - action: homeassistant.list_orphaned_database_entities
    response_variable: orphaned
  - action: recorder.purge_entities
    target:
      entity_id: |
        {%- set new_list = namespace(all=[]) %}
          {%- for i in orphaned.entities %}
            {% if i | contains("lightning_strike") %}
              {%- set new_list.all = new_list.all + [ i ] %}
            {%- endif %}
          {%- endfor %}
        {{ new_list.all }}
    data:
      keep_days: 0
mode: single
1 Like

Thanks!

I was hoping to find a way to show response_variable on a dashboard and have an input_text to provide the contains parameter.

Now I think about it again… I could probably get it into a sensor. I believe actions are now part of template sensors?

(So much changes - and improves- with HA that if you go away for a few months or more it is hard to keep up!!)


EDIT:

Looks like this is the way to go…

Yes it is! Thanks to Giel for the push…


If anyone is interested this is what I have (I’ve had a cleanup!):

#================
#=== Input Texts
#================
input_text:
  system_orphan_search_string:
    name: Orphan Search String


#=====================
#=== Template Sensors
#=====================
template:
  - trigger:
      - platform: time_pattern
        hours: /1

      - platform: state
        entity_id: script.system_delete_orphaned_entities
        from: 'on'
        to: 'off'
        for:
          seconds: 2

    action:
      - service: homeassistant.list_orphaned_database_entities
        response_variable: orphaned
    sensor:
      - name: System List Orphaned Database Entities
        unique_id: system_list_orphaned_database_entities
        state: >
          {{ orphaned.count }}
        attributes:
          orphans: >
            {{ orphaned.entities }}


#============
#=== Scripts
#============
script:
  system_delete_orphaned_entities:
    alias: System Delete Orphaned Entities
    mode: single
    sequence:
      - service: recorder.purge_entities
        data:
          entity_id: >
            {% set ns_new_list = namespace(to_delete=[]) %}
              {% for orphan in state_attr('sensor.system_list_orphaned_database_entities', 'orphans') %}
                {% if orphan | contains(states('input_text.system_orphan_search_string')) %}
                  {% set ns_new_list.to_delete = ns_new_list.to_delete + [ orphan ] %}
                {% endif %}
              {% endfor %}
            {{ ns_new_list.to_delete }}
          keep_days: 0

DASHBOARD

      - type: entities
        entities:
          - entity: sensor.system_list_orphaned_database_entities
            name: Number of orphaned entities

          - type: custom:fold-entity-row
            head:
              entity: input_text.system_orphan_search_string
              tap_action:
                action: fire-dom-event
                fold_row: true
            padding: 0
            entities:
              - type: custom:hui-element
                card_type: markdown
                content: >
                  ### ⚠️<font color=DarkOrange>Entities Selected For Removal</font>⚠️ ###

                  {% set new_list = namespace(to_delete=[]) %}
                    {%- for orphan in state_attr('sensor.system_list_orphaned_database_entities', 'orphans') %}
                      {%- if orphan | contains(states('input_text.system_orphan_search_string')) %}
                        {%- set new_list.to_delete = new_list.to_delete + [ orphan ] -%}
                      {% endif -%}
                    {% endfor -%}
                  {{ new_list.to_delete   | list | sort | join(', \n')}}

          - entity: script.system_delete_orphaned_entities
            name: Delete Selected Entities
            icon: mdi:delete

      - type: markdown
        content: >
          ### <font color=SteelBlue>All Orphaned Entities</font> ###

          {{ state_attr('sensor.system_list_orphaned_database_entities', 'orphans')  | list | sort | join(', \n') }}
1 Like

Is there a way to ignore deactivated automations and only notice them again when they are activated?