You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When Shelly button is used as trigger in automation and HA is freshly restarted the automation is not triggered because the device_trigger.py throws an exception. Creating a new automation or editing an existing one with shelly button trigger is not possible because the shelly device trigger is unavailable. The "trigger type" and "device" are available, but the "trigger" is not (S, SS, SSS, L). Home Assistant server restart is not possible as the check configuration detects an error "Unexpected error calling config validator: 'NoneType' object is not iterable".
This error state lasts until a button is pressed. Once any shelly button is pressed the trigger script initializes/passes and button triggers become available. Unfortunately this first press gets missed by the automations.
This behavior is caused by the Shelly button being in sleep mode (unavailable) until pressed.
What is version of Home Assistant Core has the issue?
core-2021.3.4
What was the last working version of Home Assistant Core?
1. add Shelly integration2. add Button device (the device is on USB power)3. create some automation using the shelly button device### Automation sample ###platform: devicedevice_id: 9f0f19857071c75042b78f0dec1d6b62domain: shellytype: longsubtype: button4. disconnect the shelly button from the USB power, wait for it to go to sleep.5. restart HA6. go to the automation and edit it - the shelly button trigger is unavailable7. go to Configuration / Server Controls / Check Configuration - results in error8. try restarting the HA server - not possible because of the config check failing.9. Press the button of the sleeping shelly device10. Now all works correctly until HA restart.
Anything in the logs that might be useful for us?
Logger: homeassistant.components.websocket_api.http.connection
Source: components/shelly/device_trigger.py:71
Integration: Home Assistant WebSocket API (documentation, issues)
First occurred: 19:32:28 (1 occurrences)
Last logged: 19:32:28
[2812764992] Error handling message: Unknown error
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/websocket_api/decorators.py", line 18, in _handle_async_response
await func(hass, connection, msg)
File "/usr/src/homeassistant/homeassistant/components/device_automation/__init__.py", line 187, in with_error_handling
await func(hass, connection, msg)
File "/usr/src/homeassistant/homeassistant/components/device_automation/__init__.py", line 237, in websocket_device_automation_list_triggers
triggers = await _async_get_device_automations(hass, "trigger", device_id)
File "/usr/src/homeassistant/homeassistant/components/device_automation/__init__.py", line 133, in _async_get_device_automations
device_automations = await asyncio.gather(
File "/usr/src/homeassistant/homeassistant/components/device_automation/__init__.py", line 108, in _async_get_device_automations_from_domain
return await getattr(platform, function_name)(hass, device_id)
File "/usr/src/homeassistant/homeassistant/components/shelly/device_trigger.py", line 71, in async_get_triggers
for block in wrapper.device.blocks:
TypeError: 'NoneType' object is not iterable
Logger: homeassistant.helpers.check_config
Source: components/shelly/device_trigger.py:53
First occurred: 12:48:01 (1 occurrences)
Last logged: 12:48:01
Unexpected error validating config
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/check_config.py", line 147, in async_check_ha_config_file
await config_validator.async_validate_config( # type: ignore
File "/usr/src/homeassistant/homeassistant/components/automation/config.py", line 103, in async_validate_config
await asyncio.gather(
File "/usr/src/homeassistant/homeassistant/components/automation/config.py", line 85, in _try_async_validate_config_item
config = await async_validate_config_item(hass, config, full_config)
File "/usr/src/homeassistant/homeassistant/components/automation/config.py", line 63, in async_validate_config_item
config[CONF_TRIGGER] = await async_validate_trigger_config(
File "/usr/src/homeassistant/homeassistant/helpers/trigger.py", line 49, in async_validate_trigger_config
conf = await platform.async_validate_trigger_config(hass, conf)
File "/usr/src/homeassistant/homeassistant/components/device_automation/trigger.py", line 21, in async_validate_trigger_config
return await getattr(platform, "async_validate_trigger_config")(hass, config)
File "/usr/src/homeassistant/homeassistant/components/shelly/device_trigger.py", line 53, in async_validate_trigger_config
for block in wrapper.device.blocks:
TypeError: 'NoneType' object is not iterable
The text was updated successfully, but these errors were encountered:
Thanks @LZ7AA for the detailed reproducing steps, I understand what is causing the issue, fix for it is simple, I will try to make it ready for the next hotfix.
Thank you for the prompt reaction. Unfortunately the issue with the Shelly sleeping button partly fixed.
The automation edit in UI is OK and configuration validation passes now, but the first ever trigger is missed. The automation, which uses button trigger misses the first press after server restart. Second press successfully triggers the automation.
= core-2021.4.4
= nothing in the logs for the first trigger/press
I will open a new issue for this.
The problem
When Shelly button is used as trigger in automation and HA is freshly restarted the automation is not triggered because the device_trigger.py throws an exception. Creating a new automation or editing an existing one with shelly button trigger is not possible because the shelly device trigger is unavailable. The "trigger type" and "device" are available, but the "trigger" is not (S, SS, SSS, L). Home Assistant server restart is not possible as the check configuration detects an error "Unexpected error calling config validator: 'NoneType' object is not iterable".
This error state lasts until a button is pressed. Once any shelly button is pressed the trigger script initializes/passes and button triggers become available. Unfortunately this first press gets missed by the automations.
This behavior is caused by the Shelly button being in sleep mode (unavailable) until pressed.
What is version of Home Assistant Core has the issue?
core-2021.3.4
What was the last working version of Home Assistant Core?
No response
What type of installation are you running?
Home Assistant OS
Integration causing the issue
Shelly
Link to integration documentation on our website
https://www.home-assistant.io/integrations/shelly
Example YAML snippet
Anything in the logs that might be useful for us?
Logger: homeassistant.helpers.check_config
Source: components/shelly/device_trigger.py:53
First occurred: 12:48:01 (1 occurrences)
Last logged: 12:48:01
Unexpected error validating config
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/check_config.py", line 147, in async_check_ha_config_file
await config_validator.async_validate_config( # type: ignore
File "/usr/src/homeassistant/homeassistant/components/automation/config.py", line 103, in async_validate_config
await asyncio.gather(
File "/usr/src/homeassistant/homeassistant/components/automation/config.py", line 85, in _try_async_validate_config_item
config = await async_validate_config_item(hass, config, full_config)
File "/usr/src/homeassistant/homeassistant/components/automation/config.py", line 63, in async_validate_config_item
config[CONF_TRIGGER] = await async_validate_trigger_config(
File "/usr/src/homeassistant/homeassistant/helpers/trigger.py", line 49, in async_validate_trigger_config
conf = await platform.async_validate_trigger_config(hass, conf)
File "/usr/src/homeassistant/homeassistant/components/device_automation/trigger.py", line 21, in async_validate_trigger_config
return await getattr(platform, "async_validate_trigger_config")(hass, config)
File "/usr/src/homeassistant/homeassistant/components/shelly/device_trigger.py", line 53, in async_validate_trigger_config
for block in wrapper.device.blocks:
TypeError: 'NoneType' object is not iterable
The text was updated successfully, but these errors were encountered: