Skip to content

'Recorder' object has no attribute 'async_get_database_engine' #38

Description

@gricey432

While attempting to run backfill with deletion on I get a failure.

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 530, in _async_step
    await getattr(self, handler)()
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 1027, in _async_step_call_service
    response_data = await self._async_run_long_action(
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    ...<9 lines>...
    )
    ^
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 640, in _async_run_long_action
    return await long_task
           ^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/core.py", line 2827, in async_call
    response_data = await coro
                    ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/core.py", line 2870, in _execute_service
    return await target(service_call)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/isolarcloud/services.py", line 232, in import_historical_data
    imported_count = await async_import_historical_data(
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    ...<8 lines>...
    )
    ^
  File "/config/custom_components/isolarcloud/services.py", line 44, in async_import_historical_data
    await async_delete_statistics_range(
    ...<4 lines>...
    )
  File "/config/custom_components/isolarcloud/services.py", line 171, in async_delete_statistics_range
    await get_instance(hass).async_add_executor_job(
    ...<5 lines>...
    )
  File "/usr/local/lib/python3.14/concurrent/futures/thread.py", line 86, in run
    result = ctx.run(self.task)
  File "/usr/local/lib/python3.14/concurrent/futures/thread.py", line 73, in run
    return fn(*args, **kwargs)
  File "/config/custom_components/isolarcloud/services.py", line 184, in _delete_statistics_range_blocking
    db = get_instance(hass).async_get_database_engine()
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'Recorder' object has no attribute 'async_get_database_engine'

HA version 2026.6.4 running this plugin at 0.9.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions