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
2 Likes

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?

I have a file in my custom components folder called “spook_inverse” (at the very bottom of the screenshot here):

image

But the file seems to not actually exist?

It causes issues with my backups as this error pops up every time and I have to intervene to continue the backup:

image

I’ve tried deleting the file but it keeps getting re-created. The strange thing besides the “file doesn’t exist” thing is that the file isn’t in the spook folder.

Is this expected or a bug?

Not much help, but it’s not there on my install…
Looking at the icon on the file could it be some sort of symbolic link type file that’s been created?

As far as I know I never did anything to create that. I only installed the Spook integration and it did everything from there. But TBH, I don’t even remember when it showed up. as far as I can remember it has been there as long as I’ve had Spook installed. I’ve just lived with it.

I don’t think I’ve tried uninstalling/re-installing Spook yet but I wasn’t even sure if it was normal or not.

Maybe I’ll give that a try now that I know that at least not everyone has it.

1 Like

Had another look and it IS there for me…sorry :see_no_evil:
(had turned of showing hidden files on Windows but forgot and showig now on diff machine)

What backup/copy software you using?

1 Like

I’m just doing a manual copy of the files in the config folder using WinSCP.

Not that big of a deal really but I always have to watch for that error to pop up and click OK to continue the backup. Otherwise I forget about it and the dialogue just sits there forever.

Sorry again about the bad steer…

You could always just excl that file in your copy command…or use something like SyncBack to copy/backup (and again excl the file) as that’ll continue on error (prob WinSCP can too)

No problem. And thanks for the replies. It’s good to know that I’m not the only one.

I don’t use a copy command.

I just select everything in that folder and drag it to the copy location.

And because the file is buried in a sub-folder (custom_components) I can’t not select only that one file.

So it goes thru copying everything until it gets to that file and then error’s out waiting for a response.

I might be able to do something more tricky but I’ve not dug into any work arounds yet.

This was mostly a “why-do-we-have-a-file-listed-but-that-also-doesn’t-exist” question.

I was hoping to bring attention to it here but I may just need to submit a bug report and be done with it. I’ll probably give it a bit to see if anyone in authority notices my question.

1 Like

WinSCP has some symbolic link option settings in the Advanced Site Settings dialog. You might try adjusting those. The file you are having problems with is a linked file:

2 Likes