Code Monkey home page Code Monkey logo

spook's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

spook's Issues

Getting this one now:

Getting this one now:


Logger: custom_components.spook
Source: custom_components/spook/repairs/lovelace_unknown_entity_references.py:263
Integration: Spook ([documentation](https://github.com/frenck/spook), [issues](https://github.com/frenck/spook/issues))
First occurred: 10:14:54 (188 occurrences)
Last logged: 11:59:09

Unexpected exception from <function AbstractSpookRepair.async_activate.<locals>._async_inspect at 0xffff59469360>
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/debounce.py", line 117, in _handle_timer_finish
    await task
  File "/config/custom_components/spook/repairs/__init__.py", line 130, in _async_inspect
    await self.async_inspect()
  File "/config/custom_components/spook/repairs/lovelace_unknown_entity_references.py", line 108, in async_inspect
    for entity_id in self.__async_extract_entities(config)
  File "/config/custom_components/spook/repairs/lovelace_unknown_entity_references.py", line 159, in __async_extract_entities
    entities.update(self.__async_extract_entities_from_card(card))
  File "/config/custom_components/spook/repairs/lovelace_unknown_entity_references.py", line 225, in __async_extract_entities_from_card
    entities.update(self.__async_extract_entities_from_card(card))
  File "/config/custom_components/spook/repairs/lovelace_unknown_entity_references.py", line 235, in __async_extract_entities_from_card
    entities.update(self.__async_extract_entities_from_element(element))
  File "/config/custom_components/spook/repairs/lovelace_unknown_entity_references.py", line 284, in __async_extract_entities_from_element
    entities.update(self.__async_extract_entities_from_actions(config))
  File "/config/custom_components/spook/repairs/lovelace_unknown_entity_references.py", line 255, in __async_extract_entities_from_actions
    entities.update(self.__async_extract_entities_from_action(action))
  File "/config/custom_components/spook/repairs/lovelace_unknown_entity_references.py", line 263, in __async_extract_entities_from_action
    if (target := config.get(key)) and (entity_id := target.get("entity_id")):
AttributeError: 'str' object has no attribute 'get'

Originally posted by @holdestmade in #180 (comment)

AttributeError: 'list' object has no attribute 'get'

Updated and get this one

Logger: custom_components.spook
Source: custom_components/spook/repairs/lovelace_unknown_entity_references.py:215
Integration: Spook (documentation, issues)
First occurred: 10:34:36 (4 occurrences)
Last logged: 10:35:21

Unexpected exception from <function AbstractSpookRepair.async_activate.._async_inspect at 0xffff55d203a0>
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/debounce.py", line 117, in _handle_timer_finish
await task
File "/config/custom_components/spook/repairs/init.py", line 130, in _async_inspect
await self.async_inspect()
File "/config/custom_components/spook/repairs/lovelace_unknown_entity_references.py", line 108, in async_inspect
for entity_id in self.__async_extract_entities(config)
File "/config/custom_components/spook/repairs/lovelace_unknown_entity_references.py", line 159, in __async_extract_entities
entities.update(self.__async_extract_entities_from_card(card))
File "/config/custom_components/spook/repairs/lovelace_unknown_entity_references.py", line 215, in __async_extract_entities_from_card
if condition := config.get("condition"):
AttributeError: 'list' object has no attribute 'get'

AttributeError: 'list' object has no attribute 'get'

Sorry Frenck, another one, getting this on v0.13.131315. This one repeats

Logger: custom_components.spook
Source: custom_components/spook/repairs/lovelace_unknown_entity_references.py:254
Integration: Spook (documentation, issues)
First occurred: 09:29:35 (5 occurrences)
Last logged: 09:30:34

Unexpected exception from <function AbstractSpookRepair.async_activate.._async_inspect at 0xffff4c76dbd0>
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/debounce.py", line 117, in _handle_timer_finish
await task
File "/config/custom_components/spook/repairs/init.py", line 130, in _async_inspect
await self.async_inspect()
File "/config/custom_components/spook/repairs/lovelace_unknown_entity_references.py", line 108, in async_inspect
for entity_id in self.__async_extract_entities(config)
File "/config/custom_components/spook/repairs/lovelace_unknown_entity_references.py", line 159, in __async_extract_entities
entities.update(self.__async_extract_entities_from_card(card))
File "/config/custom_components/spook/repairs/lovelace_unknown_entity_references.py", line 213, in __async_extract_entities_from_card
entities.update(self.__async_extract_entities_from_actions(config))
File "/config/custom_components/spook/repairs/lovelace_unknown_entity_references.py", line 254, in __async_extract_entities_from_actions
if action := config.get(key):
AttributeError: 'list' object has no attribute 'get'

Enable Entity is missing

under services, it says you can enable/disable an entity, but I have found the enable feature to be missing while trying to create an automation. (homeassistant.enable_entity)

Input_number.decrease is incrementing

Hi! Thank you for this integration!

As the title says, and by looking at the code, it seems there a typo in the math sign. Decrement should remove the amount and is adding.

I'm not providing an amount to the service call.

Thanks!

AttributeError: 'str' object has no attribute 'get'

Getting this on v0.13.131314

Logger: custom_components.spook
Source: custom_components/spook/repairs/lovelace_unknown_entity_references.py:264
Integration: Spook (documentation, issues)
First occurred: 16:32:14 (8 occurrences)
Last logged: 16:34:12

Unexpected exception from <function AbstractSpookRepair.async_activate.._async_inspect at 0xffff5adcbd00>
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/debounce.py", line 117, in _handle_timer_finish
await task
File "/config/custom_components/spook/repairs/init.py", line 130, in _async_inspect
await self.async_inspect()
File "/config/custom_components/spook/repairs/lovelace_unknown_entity_references.py", line 108, in async_inspect
for entity_id in self.__async_extract_entities(config)
File "/config/custom_components/spook/repairs/lovelace_unknown_entity_references.py", line 159, in __async_extract_entities
entities.update(self.__async_extract_entities_from_card(card))
File "/config/custom_components/spook/repairs/lovelace_unknown_entity_references.py", line 225, in __async_extract_entities_from_card
entities.update(self.__async_extract_entities_from_card(card))
File "/config/custom_components/spook/repairs/lovelace_unknown_entity_references.py", line 235, in __async_extract_entities_from_card
entities.update(self.__async_extract_entities_from_element(element))
File "/config/custom_components/spook/repairs/lovelace_unknown_entity_references.py", line 288, in __async_extract_entities_from_element
entities.update(self.__async_extract_entities_from_actions(config))
File "/config/custom_components/spook/repairs/lovelace_unknown_entity_references.py", line 255, in __async_extract_entities_from_actions
entities.update(self.__async_extract_entities_from_action(action))
File "/config/custom_components/spook/repairs/lovelace_unknown_entity_references.py", line 264, in __async_extract_entities_from_action
(target := config.get(key))
AttributeError: 'str' object has no attribute 'get'

Remove all orphaned entities 👻 not working

I tried to use the remove all orphaned entities service call, but this apparently does not result into any actions. When looking in the debug log there is also nothing that refers to any actions.

Google Drive Backup

First thanks for the very interesting and helpful project, I've been using it from the very begining. But it's strange to me that nobody mentioned the following issue. If you have the Google Drive Backup add-on installed, it uses 2 additional entities for monitoring the success of the backup creation, 'sensor.backup_state' and 'binary_sensor.backups_stale'. Nobody is using those entities in their dashboard or in an automation, as me? Because if you do, spook finds them unknown at every reboot of the system and ceates a warning, probably because of the fact, that they become available after the full system reboot. Can it be somehow fixed? Thanks
Untitled

Suggestion: service to rename area id

Currently area id's cannot be changed easily.

If you initially made a typo in the name or you created them in your native language and want to switch to English, there is no way to do that.

You can rename an area and add aliases, but in your yaml automations for example, you still need to use the old area id.

Zones can be changed without a problem, not the case for areas. I once tried it by manually changing the config storage but borked my whole installation that way.

Unexpected exception

Hi, i'm relatively new at reporting issues, so I apologize if I'm omitting some information. I'm getting this message in the logs (I believe this occurs on startup):

This error originated from a custom integration.

Logger: custom_components.spook
Source: custom_components/spook/repairs/lovelace_unknown_entity_references.py:217
Integration: Spook (documentation, issues)
First occurred: 07:02:37 (2 occurrences)
Last logged: 07:04:22

Unexpected exception from <function AbstractSpookRepair.async_activate.<locals>._async_inspect at 0x7f1fff6dec20>
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/debounce.py", line 117, in _handle_timer_finish
    await task
  File "/config/custom_components/spook/repairs/__init__.py", line 130, in _async_inspect
    await self.async_inspect()
  File "/config/custom_components/spook/repairs/lovelace_unknown_entity_references.py", line 108, in async_inspect
    for entity_id in self.__async_extract_entities(config)
  File "/config/custom_components/spook/repairs/lovelace_unknown_entity_references.py", line 156, in __async_extract_entities
    entities.update(self.__async_extract_entities_from_card(card))
  File "/config/custom_components/spook/repairs/lovelace_unknown_entity_references.py", line 218, in __async_extract_entities_from_card
    entities.update(self.__async_extract_entities_from_card(card))
  File "/config/custom_components/spook/repairs/lovelace_unknown_entity_references.py", line 218, in __async_extract_entities_from_card
    entities.update(self.__async_extract_entities_from_card(card))
  File "/config/custom_components/spook/repairs/lovelace_unknown_entity_references.py", line 218, in __async_extract_entities_from_card
    entities.update(self.__async_extract_entities_from_card(card))
  File "/config/custom_components/spook/repairs/lovelace_unknown_entity_references.py", line 217, in __async_extract_entities_from_card
    for card in config.get("cards", []):
TypeError: 'NoneType' object is not iterable

AttributeError: 'AutomationEntity' object has no attribute 'script'

And another. This one only occurred on startup

Logger: custom_components.spook
Source: custom_components/spook/repairs/automation_unknown_area_references.py:34
Integration: Spook (documentation, issues)
First occurred: 09:29:35 (1 occurrences)
Last logged: 09:29:35

Unexpected exception from <function AbstractSpookRepair.async_activate.._async_inspect at 0xffff4c76e0e0>
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/debounce.py", line 117, in _handle_timer_finish
await task
File "/config/custom_components/spook/repairs/init.py", line 130, in _async_inspect
await self.async_inspect()
File "/config/custom_components/spook/repairs/automation_unknown_area_references.py", line 34, in async_inspect
for area in entity.script.referenced_areas - areas
AttributeError: 'AutomationEntity' object has no attribute 'script'

Service "homeassistant.disable_entity" error with entity without unique_id

I have test to disable and enable the device_tracker with service "homeassistant.disable_entity" or "enable".

service: homeassistant.disable_entity
data:
entity_id: device_tracker.test_1

The service don't work with device_tracker don't have unique_id ex: "ble tracker"
I have this error:
139955523604528] Error handling message: Unknown error (unknown_error) Alesoft73 from 95.232.27.3 (Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Firefox/102.0)

Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/websocket_api/decorators.py", line 26, in _handle_async_response
await func(hass, connection, msg)
File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 647, in handle_execute_script
await script_obj.async_run(msg.get("variables"), context=context)
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 1533, in async_run
await asyncio.shield(run.async_run())
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 410, in async_run
await self._async_step(log_exceptions=False)
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 454, in _async_step
self._handle_exception(
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 477, in _handle_exception
raise exception
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 452, in _async_step
await getattr(self, handler)()
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 685, in _async_call_service_step
await service_task
File "/usr/src/homeassistant/homeassistant/core.py", line 1849, in async_call
task.result()
File "/usr/src/homeassistant/homeassistant/core.py", line 1889, in _execute_service
await cast(Callable[[ServiceCall], Awaitable[None]], handler.job.target)(
File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 874, in admin_handler
await result
File "/config/custom_components/spook/services/homeassistant_disable_entity.py", line 28, in async_handle_service
entity_registry.async_update_entity(
File "/usr/src/homeassistant/homeassistant/helpers/entity_registry.py", line 884, in async_update_entity
return self._async_update_entity(
File "/usr/src/homeassistant/homeassistant/helpers/entity_registry.py", line 760, in _async_update_entity
old = self.entities[entity_id]
File "/usr/local/lib/python3.10/collections/init.py", line 1106, in getitem
raise KeyError(key)
KeyError: 'device_tracker.test_1'

Many thanks ;)

Unknown entity 'all'

Seems like Spook is being a bit strict on this:

Unknown entities used in: Turn off lights and heating when nobody is home
Spook has found a ghost in your automations 👻

While floating around, Spook crossed path with the following automation:

Turn off lights and heating when nobody is home (automation.turn_off_lights_when_nobody_is_home)

This automation references the following entities, which are unknown to Home Assistant:

all
To fix this error, edit the automation and remove the use of these non-existing entities.

Spook 👻 Not your homie.

Warning - 2/28/2023

Afaik all is a valid 'entity' (and the automation seems to works just fine).

Spook v0.10.100
Home Assistant 2023.3.0b5
Supervisor 2023.01.1
Operating System 9.5
Frontend 20230224.0 - latest

Related to spook?

Ofc I don't use spook as is is not allowed or recommended. 😉 But let's assume I would and would find these lines in my log often but now and then directly after I would have installed it:

Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/util/logging.py", line 185, in coro_wrapper
    return await target
TypeError: object NoneType can't be used in 'await' expression

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/util/logging.py", line 187, in coro_wrapper
    log_exception(format_err, *args)
  File "/usr/src/homeassistant/homeassistant/util/logging.py", line 115, in log_exception
    friendly_msg = format_err(*args)
  File "/usr/src/homeassistant/homeassistant/util/logging.py", line 207, in <lambda>
    target.__name__,
AttributeError: 'NoneType' object has no attribute '__name__'

Would it be possible that it is related to spook?

Unexpected exception from <function AbstractSpookRepair.async_activate.<locals>._async_inspect at 0x7f81b5b04ca0>

Logger: custom_components.spook
Source: custom_components/spook/repairs/lovelace_unknown_entity_references.py:264
Integration: Spook (documentation, issues)
First occurred: 13:53:04 (1 occurrences)
Last logged: 13:53:04

Unexpected exception from <function AbstractSpookRepair.async_activate.._async_inspect at 0x7f81b5b04ca0>
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/debounce.py", line 117, in _handle_timer_finish
await task
File "/config/custom_components/spook/repairs/init.py", line 130, in _async_inspect
await self.async_inspect()
File "/config/custom_components/spook/repairs/lovelace_unknown_entity_references.py", line 108, in async_inspect
for entity_id in self.__async_extract_entities(config)
File "/config/custom_components/spook/repairs/lovelace_unknown_entity_references.py", line 159, in __async_extract_entities
entities.update(self.__async_extract_entities_from_card(card))
File "/config/custom_components/spook/repairs/lovelace_unknown_entity_references.py", line 225, in __async_extract_entities_from_card
entities.update(self.__async_extract_entities_from_card(card))
File "/config/custom_components/spook/repairs/lovelace_unknown_entity_references.py", line 225, in __async_extract_entities_from_card
entities.update(self.__async_extract_entities_from_card(card))
File "/config/custom_components/spook/repairs/lovelace_unknown_entity_references.py", line 213, in __async_extract_entities_from_card
entities.update(self.__async_extract_entities_from_actions(config))
File "/config/custom_components/spook/repairs/lovelace_unknown_entity_references.py", line 255, in __async_extract_entities_from_actions
entities.update(self.__async_extract_entities_from_action(action))
File "/config/custom_components/spook/repairs/lovelace_unknown_entity_references.py", line 264, in __async_extract_entities_from_action
(target := config.get(key))
AttributeError: 'str' object has no attribute 'get'

recorder.import_statistics always requires last_reset

When using recorder.import_statistics there is an error when the last_reset field is not used in the stats: Invalid datetime specified: None for dictionary value @ data['stats'][0]['last_reset']. Got None

When entering a date for last_reset the service is working.

That field is not mandatory but due to the cv.datetime check with the default None value this seems to be going wrong.

Ignore Button Missing

I have a few entities that are unavailable until they are used (in the custom emby component)

Spook finds these entities, but I cannot ignore them. If I click submit, the repair goes away but reappears shortly afterwards:

1

Spook implicitly using device name

Error says it all - happening on 2023.7.0b2

Entity sensor.custom_integrations (<class 'custom_components.spook.ectoplasms.homeassistant.sensor.HomeAssistantSpookSensorEntity'>) is implicitly using device name by not setting its name. Instead, the name should be set to None, please report it to the custom integration author.

I am not using Spook of course. That would be in violation of the terms. ;-)

Error processing platform spook.repairs

However, I'm not your homie
Here is an issue,

Logger: homeassistant.helpers.integration_platform
Source: components/repairs/issue_handler.py:113
First occurred: 12:58:19 (2 occurrences)
Last logged: 12:58:19

Error processing platform spook.repairs
Error processing platform hassio.repairs
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/integration_platform.py", line 51, in _async_process_single_integration_platform_component
    await integration_platform.process_platform(hass, component_name, platform)
  File "/usr/src/homeassistant/homeassistant/components/repairs/issue_handler.py", line 113, in _register_repairs_platform
    raise HomeAssistantError(f"Invalid repairs platform {platform}")
homeassistant.exceptions.HomeAssistantError: Invalid repairs platform <module 'custom_components.spook.repairs' from '/config/custom_components/spook/repairs/__init__.py'>

TypeError: sequence item 0: expected str instance, Template found

Sorry, frenck....I'm not trying to be a pain in your neck, but I'm also getting this one related to "unknown area references":

Logger: custom_components.spook
Source: custom_components/spook/repairs/script_unknown_area_references.py:47
Integration: Spook (documentation, issues)
First occurred: 06:16:54 (1 occurrences)
Last logged: 06:16:54

Unexpected exception from <function AbstractSpookRepair.async_activate.<locals>._async_inspect at 0x7f394e38c790>
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/debounce.py", line 117, in _handle_timer_finish
    await task
  File "/config/custom_components/spook/repairs/__init__.py", line 130, in _async_inspect
    await self.async_inspect()
  File "/config/custom_components/spook/repairs/script_unknown_area_references.py", line 47, in async_inspect
    ", ".join(unknown_areas),
TypeError: sequence item 0: expected str instance, Template found

Originally posted by @jprasm in #185 (comment)

Automatically remove solved issues

First of all, Spook has been pretty helpful in the past weeks so thanks for that!

Not sure if I'm missing something, but whenever Spook shows me there is an issue and I fix the issue, the notification stays until I restart HA. Is there a way to have Spook "recheck" after I've solved the issue?

AttributeError: 'ScriptEntity' object has no attribute 'referenced_devices'

Sorry, another one... This one only occurred on startup

Logger: custom_components.spook
Source: custom_components/spook/repairs/script_unknown_device_references.py:33
Integration: Spook (documentation, issues)
First occurred: 09:29:38 (1 occurrences)
Last logged: 09:29:38

Unexpected exception from <function AbstractSpookRepair.async_activate.._async_inspect at 0xffff50e36ef0>
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/debounce.py", line 117, in _handle_timer_finish
await task
File "/config/custom_components/spook/repairs/init.py", line 130, in _async_inspect
await self.async_inspect()
File "/config/custom_components/spook/repairs/script_unknown_device_references.py", line 33, in async_inspect
for device in entity.referenced_devices - devices
AttributeError: 'ScriptEntity' object has no attribute 'referenced_devices'

Results with fixing inconsistent, no bug but could be improved.

When missing entities in automation are fixed by altering the automation Spook does dismiss the repair issue.
When missing devices in automation are fixed by altering the automation Spook does NOT dismiss the repair issue. (doesn't reproduce after reboot)
When missing entities or device in automation is fixed by deleting the automation Spook does NOT dismiss the repair issue. (doesn't reproduce after reboot)

Unexpected exception from <function AbstractSpookRepair.async_activate.<locals>._async_inspect at 0x7f4f82ede0>

Since update to 2023.6.x, I get errors like the following, around every minute:

Source: custom_components/spook/repairs/lovelace_unknown_entity_references.py:217 
Integration: Spook ([documentation](https://github.com/frenck/spook), [issues](https://github.com/frenck/spook/issues)) 
First occurred: 14:54:38 (22 occurrences) 
Last logged: 15:23:49

Unexpected exception from <function AbstractSpookRepair.async_activate.<locals>._async_inspect at 0x7f4f82ede0>
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/debounce.py", line 117, in _handle_timer_finish
    await task
  File "/config/custom_components/spook/repairs/__init__.py", line 130, in _async_inspect
  File "/config/custom_components/spook/repairs/lovelace_unknown_entity_references.py", line 108, in async_inspect
  File "/config/custom_components/spook/repairs/lovelace_unknown_entity_references.py", line 156, in __async_extract_entities
  File "/config/custom_components/spook/repairs/lovelace_unknown_entity_references.py", line 215, in __async_extract_entities_from_card
  File "/config/custom_components/spook/repairs/lovelace_unknown_entity_references.py", line 218, in __async_extract_entities_from_card
  File "/config/custom_components/spook/repairs/lovelace_unknown_entity_references.py", line 217, in __async_extract_entities_from_card
TypeError: 'NoneType' object is not iterable

Anything else that I can provide to help fix this issue?

Cant find on HACS

The HACS badge is not working and i can't find it by searching.

When I use the badge I get this message in HA
Repository frenck/spook not found

This is the search result in HACS:
Skärmavbild 2023-02-26 kl  16 38 52

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Awaiting Schedule

These updates are awaiting their schedule. Click on a checkbox to get an update now.

  • ⬆️ Lock file maintenance

Detected dependencies

devcontainer
.devcontainer/devcontainer.json
  • ghcr.io/devcontainers/features/github-cli 1
  • ghcr.io/devcontainers/features/node 1
  • ghcr.io/schlich/devcontainer-features/rye 1
dockerfile
.devcontainer/Dockerfile
github-actions
.github/workflows/documentation.yaml
  • actions/checkout v4.1.7
  • actions/setup-node v4.0.2
  • actions/upload-pages-artifact v3
  • actions/deploy-pages v4.0.5
.github/workflows/hacs.yaml
  • actions/checkout v4.1.7
.github/workflows/hassfest.yaml
  • actions/checkout v4.1.7
.github/workflows/labels.yaml
  • actions/checkout v4.1.7
  • micnncim/action-label-syncer v1.3.0
.github/workflows/pr-labels.yaml
  • jesusvasquez333/verify-pr-label-action v1.4.0
.github/workflows/pylint.yaml
  • actions/checkout v4.1.7
  • eifinger/setup-rye v3.0.2
.github/workflows/release-drafter.yaml
  • release-drafter/release-drafter v6.0.0
.github/workflows/release.yaml
  • actions/checkout v4.1.7
  • sigstore/gh-action-sigstore-python v2.1.1
  • softprops/action-gh-release v2.0.5
.github/workflows/ruff.yaml
  • actions/checkout v4.1.7
  • eifinger/setup-rye v3.0.2
nvm
documentation/.nvmrc
  • node 20.14.0
pep621
pyproject.toml
  • homeassistant >=2024.4.0
pyenv
.python-version
  • python 3.12

  • Check this box to trigger a request for Renovate to run again on this repository

AttributeError: 'Template' object has no attribute 'startswith'

error in the HA log:

Deze fout is ontstaan door een aangepaste integratie.

Logger: custom_components.spook
Source: custom_components/spook/repairs/script_unknown_entity_references.py:96 
Integration: Spook (documentation, issues) 
First occurred: 15:37:18 (66 occurrences) 
Last logged: 16:07:46

Unexpected exception from <bound method SpookRepair.async_inspect of <custom_components.spook.repairs.script_unknown_entity_references.SpookRepair object at 0x7f6202b55990>>
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/debounce.py", line 109, in _handle_timer_finish
    await task
  File "/config/custom_components/spook/repairs/script_unknown_entity_references.py", line 92, in async_inspect
    referenced_entities = {
  File "/config/custom_components/spook/repairs/script_unknown_entity_references.py", line 96, in <setcomp>
    not entity_id.startswith("device_tracker.")
AttributeError: 'Template' object has no attribute 'startswith'

v 10.111

Updating state for sensor.device_trackers took 0.652 seconds.

Logger: homeassistant.helpers.entity
Source: helpers/entity.py:749
First occurred: 16:54:31 (1 occurrences)
Last logged: 16:54:31

Updating state for sensor.device_trackers (<class 'custom_components.spook.ectoplasms.homeassistant.sensor.HomeAssistantSpookSensorEntity'>) took 0.652 seconds. Please report it to the custom integration author.

import_statistics can't start

2023-03-09 20:43:21.969 ERROR (MainThread) [homeassistant.helpers.script.websocket_api_script] websocket_api script: Error executing script. Invalid data for call_service at pos 1: extra keys not allowed @ data['statistics_id']
2023-03-09 20:43:22.117 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection] [547569047088] Error handling message: extra keys not allowed @ data['statistics_id']. Got None

statistics_meta has a statistic_id field, no s before _

Spook is implicitly using device name by not setting its name (HA 2023.7.1)

I got this warning in my Home Assistant and should report to you ;)

Logger: homeassistant.helpers.entity
Source: helpers/entity.py:1006
First occurred: 09:20:37 (1 occurrences)
Last logged: 09:20:37

Entity sensor.custom_integrations (<class 'custom_components.spook.ectoplasms.homeassistant.sensor.HomeAssistantSpookSensorEntity'>) is implicitly using device name by not setting its name. Instead, the name should be set to None, please report it to the custom integration author.

Usind Home Assistant (Docker) 2023.7.1 with Spook v0.14.0

Torque Integration and Spook

Hi!

Just something I wanted to raise here.

I'm using the Torque core integration. Its kind of a strange integration, in that the entities are not available soon after restart, but when I start the Torque application on my phone and starts logging data, they come back with all their history.

Problem is, of course, Spook tells me that I have automations for entities that don't exist (the Torque entities). So, I'm not sure if you can introduce "Ignore" issue that gets remembered at every restart or perhaps the Torque integration could be updated so that the entities survive a restart.

Any thoughts on this?

set precision

Would it be possible a add a set_precision service call to easily set the precision of multiple sensors in one go?

No groups are spooky during reboot

Hi,

When no helper groups are defined, spooky gets really scared during restarting home assistant. It will spook out the error below.
When creating a helper light group with 1 member (1 light), spooky is satisfied during restarting home assistant and the error is gone.

This error originated from a custom integration.

Logger: homeassistant
Source: custom_components/spook/repairs/group_unknown_members.py:46
Integration: Spook (documentation, issues)
First occurred: 14:58:36 (1 occurrences)
Last logged: 14:58:36

Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/config/custom_components/spook/__init__.py", line 32, in _ghost_busters
    await repairs.async_setup()
  File "/config/custom_components/spook/repairs/__init__.py", line 186, in async_setup
    await self.async_activate(module.SpookRepair(self.hass))
  File "/config/custom_components/spook/repairs/__init__.py", line 195, in async_activate
    await repair.async_activate()
  File "/config/custom_components/spook/repairs/group_unknown_members.py", line 46, in async_activate
    self._entity_platforms = self.hass.data[DATA_ENTITY_PLATFORM][self.domain]
KeyError: 'group'

False positives on missing entities

Hi!
I have some automations with persistent_notification.* entities, like this:

- alias: "HASS: Login Failed [notify to group system]"
  id: 142e502b-3e63-49e3-b790-9150f155dc6d
  mode: queued
  max: 5
  trigger:
    - platform: state
      entity_id: persistent_notification.http_login
  condition:
    - condition: template
      value_template: "{{ trigger.to_state.state != off }}"
  action:
    - service: telegram_bot.send_message
      data:
        target: !secret tlg_group_system
        disable_web_page_preview: true
        message: |
          *Внимание!*
          Неудачная попытка входа, ошибка авторизации!
          Источник: {{ state_attr('persistent_notification.http_login','message') | regex_findall_index('from (.*)\. ') }}
          _http://whatismyipaddress.com/ip/{{ state_attr('persistent_notification.http_login','message') | regex_findall_index('\((.*)\)') }}_
    - service: persistent_notification.dismiss
      data:
        notification_id: http_login

- alias: "HASS: IP Banned [notify to group system]"
  id: ba2318c5-5c2e-4575-aa13-02f53063793d
  mode: queued
  max: 5
  trigger:
    - platform: state
      entity_id: persistent_notification.ip_ban
  action:
    - service: telegram_bot.send_message
      data:
        target: !secret tlg_group_system
        disable_web_page_preview: true
        message: |
          *Внимание!*
          Заблокирован IP: {{ state_attr('persistent_notification.ip_ban', 'message').split('Too many login attempts from ')[1] }}
          _http://whatismyipaddress.com/ip/{{ state_attr('persistent_notification.ip_ban', 'message').split('Too many login attempts from ')[1] }}_
    - service: persistent_notification.dismiss
      data:
        notification_id: ip_ban

and spook creates a problem for each such entity, which doesn't seem right to me =)

image

The persistent_notification.* entities are really not there at the time of the check, but they appear and disappear as they work.

Services not found

Hello,

I have installed Spook on Home Assistant via HACS as i wanted to be able to use the enable/disable integration service in an automation. Unfortunately, after installing i tried to find the services in the Developer Tools and to my surprise they were not there. Of course i have restarted my Home Assistance instance multiple times.

Here is a few details more:

Home Assistant 2023.3.1
Supervisor 2023.01.1
Operating System 9.5
Frontend 20230302.0 - latest

Should you need more details please let me know!

Checked the logs as well but there is no error. Since this is the latest version of Home Assistance, is there a possibility that the integration is not working yet with the latest version?

Thanks

Can´t find and use Services

Using HomeAssistant
Home Assistant 2023.3.6
Supervisor 2023.03.3
Operating System 9.5
Frontend 20230309.1 - latest

with

Spook V0.11.1117 installed via HACS
and also tried the manual installation.

Tried to use
Service: Disable an integration
and
Service: Enable an integration

but i can´t find

homeassistant.disable_config_entry
or
homeassistant.enable_config_entry

in HomeAssistant / Developer Tools / Services.

Input number increase/decrease has issues with the step value

input number increase/decrease isn't working: When using it without the new amount option I get this error:

File "/config/custom_components/spook/services/input_number_increment.py", line 31, in async_handle_service
if (amount := call.data.get("amount", entity.step)) % entity.step != 0:
AttributeError: 'InputNumber' object has no attribute 'step'

Even thought the input number has a step (and min/max) configured (through the UI).

When i try to call the service with explicitly setting the new amount value I get this (with both a whole number and a decimal):

Error handling message: extra keys not allowed @ data['step']. Got None (invalid_format)

One of my input numbers has a decimal step configured, min: 0.1, max 1, step 0.1. The dev tools/service UI shows a red line under the input field when I enter a decimal number, but it does allow me to save it.

Feature request: service to add/remove/update zones

HA itself currently has no possibility to dynamically create/modify/delete zones (lat/long/radius).

However, this function would be quite practical for a few applications.

https://community.home-assistant.io/t/device-tracer-and-dynamic-zones/567829
https://community.home-assistant.io/t/create-a-zone-around-a-moving-person/473978
Another use case would be, for example, to operate HA in a camper van and make the current location automatically the home zone.

I have no idea how the zones in HA are structured internally and if this is even currently possible.

input number services don't allow to select a input helper

First: Many thanks for the wonderful Spook!

I use input number helpers in some automations. When I want to use 'Input number: Increase/Decrease value 👻' that replaced the HA services the entity list is populated with number sensors but no longer with the input_numbers. The entity list is correctly populated with the input numbers when using 'Input number: Set maximum/minimum value 👻'.

I figured I could just enter them in yaml mode but then the service simply doesn't do anything at all anymore. Previously working and not altered automations using this service aren't working either.

Screenshot 2023-03-03 200450
Screenshot 2023-03-03 200605

I'm on 2023.3.1 and the latest spook.

AttributeError: 'list' object has no attribute 'get'

Getting this in logs, several times.

HA v2023.5.4 SPOOK v0.13.5791

Logger: custom_components.spook
Source: custom_components/spook/repairs/lovelace_unknown_entity_references.py:168
Integration: Spook ([documentation](https://github.com/frenck/spook), [issues](https://github.com/frenck/spook/issues))
First occurred: 15:00:11 (13 occurrences)
Last logged: 15:09:33

Unexpected exception from <function AbstractSpookRepair.async_activate.<locals>._async_inspect at 0xffff444cef80>
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/debounce.py", line 117, in _handle_timer_finish
    await task
  File "/config/custom_components/spook/repairs/__init__.py", line 130, in _async_inspect
    await self.async_inspect()
  File "/config/custom_components/spook/repairs/lovelace_unknown_entity_references.py", line 108, in async_inspect
    for entity_id in self.__async_extract_entities(config)
  File "/config/custom_components/spook/repairs/lovelace_unknown_entity_references.py", line 156, in __async_extract_entities
    entities.update(self.__async_extract_entities_from_card(card))
  File "/config/custom_components/spook/repairs/lovelace_unknown_entity_references.py", line 206, in __async_extract_entities_from_card
    entities = self.__async_extract_common(config)
  File "/config/custom_components/spook/repairs/lovelace_unknown_entity_references.py", line 168, in __async_extract_common
    if entity := config.get(key):
AttributeError: 'list' object has no attribute 'get'

Unexpected exception: lovelace.const.ConfigNotFound

v0.13.37 raises the following error on my production machine:

Unexpected exception from <function AbstractSpookRepair.async_activate.<locals>._async_inspect at 0x7f4ba0ea20>
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/debounce.py", line 117, in _handle_timer_finish
    await task
  File "/config/custom_components/spook/repairs/__init__.py", line 130, in _async_inspect
    await self.async_inspect()
  File "/config/custom_components/spook/repairs/lovelace_unknown_entity_references.py", line 99, in async_inspect
    config = await dashboard.async_load(force=False)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/lovelace/dashboard.py", line 124, in async_load
    raise ConfigNotFound
homeassistant.components.lovelace.const.ConfigNotFound

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.