core: Synology shutdown error
The problem
When invoking synology_dsm.shutdown an error gets printed in the logs, after a while stops working.
Environment
- Home Assistant Core release with the issue: 2021.1.3
- Last working Home Assistant Core release (if known): N/A
- Operating environment (OS/Container/Supervised/Core): OS
- Integration causing this issue: Synology DSM
- Link to integration documentation on our website: https://www.home-assistant.io/integrations/synology_dsm/
Problem-relevant configuration.yaml
- platform: wake_on_lan
mac: !secret synology_mac
name: Synology NAS
host: !secret synology_host
turn_off:
service: synology_dsm.shutdown
Traceback/Error logs
await getattr(
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 457, in _async_call_service_step
await service_task
File "/usr/src/homeassistant/homeassistant/core.py", line 1445, in async_call
task.result()
File "/usr/src/homeassistant/homeassistant/core.py", line 1480, in _execute_service
await handler.job.target(service_call)
File "/usr/src/homeassistant/homeassistant/components/synology_dsm/__init__.py", line 273, in service_handler
await dsm_api.system.shutdown()
TypeError: object dict can't be used in 'await' expression
subsequent calls yield
2021-01-22 20:50:39 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection] [1749415440] 'NoneType' object has no attribute 'shutdown'
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 135, in handle_call_service
await hass.services.async_call(
File "/usr/src/homeassistant/homeassistant/core.py", line 1445, in async_call
task.result()
File "/usr/src/homeassistant/homeassistant/core.py", line 1480, in _execute_service
await handler.job.target(service_call)
File "/usr/src/homeassistant/homeassistant/components/synology_dsm/__init__.py", line 273, in service_handler
await dsm_api.system.shutdown()
AttributeError: 'NoneType' object has no attribute 'shutdown'
Additional information
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 18 (16 by maintainers)
Tried reproducing and it didn’t happen. Perhaps I was just too eager to shutdown after reboot?
Greetings from Berlin 👯
I copied the
synology_dsmfolder from your branch intocustom_componentson my pi and rebooted Home Assistant.I turned my NAS off using the
synology_dsm.shutdownand all worked good, turning it back on and logged in via the Synology WebUI and issued another shutdown command and this came up in the logs + as a modal.However trying again shortly after it worked. Perhaps the NAS API wasn’t up at that time?
Just retried - same experience - first time fails, second works
Hi @mib1185,
Thanks for doing this! How would be best to test this in my normal hassio setup?
Would checking out your branch locally and copying the
synology_dsmcomponent into mycustom_componentsbe enough?Looks like it is https://skylar.tech/overriding-default-home-assistant-components/
Trying now - will report back.