Error trying to create automation with Shelly Button1

First post so pardon if formatting is bad.

Can’t get a Shelly Button1 to work, here is the YAML generated through the UI:

alias: Shelly Button1 Single Click
description: ''
trigger:
  - platform: device
    device_id: c3f146c006da258747631dcf21c1e730
    domain: shelly
    type: single
    subtype: button
condition: []
action:
  - service: homeassistant.toggle
    target:
      area_id: huvudrum
mode: single

The automation works when pressing run in web-ui, but nothing happens when pressing the button, battery or usb power make no difference. If I restart the server and open the automation the trigger type (single click in this case) is set to unknown and I can no longer create an automation based on clicks through the UI, only reacting to battery levels shows up and I haven’t touched that one. I get the following error log:

Logger: homeassistant.components.websocket_api.http.connection
Source: components/shelly/device_trigger.py:71
Integration: Home Assistant WebSocket API (documentation, issues)
First occurred: 01:22:33 (1 occurrences)
Last logged: 01:22:33
[2937669568] 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

I run the latest version of Home Assistent, here is the system info:

Version 	core-2021.3.3
Installation Type 	Home Assistant OS
Development 	false
Supervisor 	true
Docker 	true
Virtual Environment 	false
Python Version 	3.8.7
Operating System Family 	Linux
Operating System Version 	5.4.83-v7l
CPU Architecture 	armv7l

I also downloaded the latest firmware for the Button1 through the Shelly App. If I remove the device and add it again I can once again create automations through the UI based on various clicks. Below are some other logs that led me to investigate, they also stemmed from me trying to get the button to work.

2021-03-11 01:14:13 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection] [2883287576] 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

2021-03-11 01:15:02 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection] [2883287576] 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

2021-03-11 01:15:23 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection] [2883287576] 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

2021-03-11 01:16:05 ERROR (MainThread) [homeassistant] Error doing job: Exception in callback EventBus.async_listen_once.<locals>._onetime_listener(<Event homeassistant_stop[L]>) at /usr/src/homeassistant/homeassistant/core.py:814
Traceback (most recent call last):
File "/usr/local/lib/python3.8/asyncio/events.py", line 81, in _run
self._context.run(self._callback, *self._args)
File "/usr/src/homeassistant/homeassistant/core.py", line 828, in _onetime_listener
self._hass.async_run_job(listener, event)
File "/usr/src/homeassistant/homeassistant/core.py", line 454, in async_run_job
return self.async_run_hass_job(HassJob(target), *args)
File "/usr/src/homeassistant/homeassistant/core.py", line 435, in async_run_hass_job
hassjob.target(*args)
File "/usr/src/homeassistant/homeassistant/components/shelly/__init__.py", line 268, in _handle_ha_stop
self.shutdown()
File "/usr/src/homeassistant/homeassistant/components/shelly/__init__.py", line 261, in shutdown
self.device.shutdown()
File "/usr/local/lib/python3.8/site-packages/aioshelly/__init__.py", line 230, in shutdown
self._unsub_listening()
File "/usr/local/lib/python3.8/site-packages/aioshelly/coap.py", line 110, in <lambda>
return lambda: self.subscriptions.pop(ip)
KeyError: '192.168.0.15'

2021-03-11 01:16:05 ERROR (MainThread) [homeassistant] Error doing job: Exception in callback EventBus.async_listen_once.<locals>._onetime_listener(<Event homeassistant_stop[L]>) at /usr/src/homeassistant/homeassistant/core.py:814
Traceback (most recent call last):
File "/usr/local/lib/python3.8/asyncio/events.py", line 81, in _run
self._context.run(self._callback, *self._args)
File "/usr/src/homeassistant/homeassistant/core.py", line 828, in _onetime_listener
self._hass.async_run_job(listener, event)
File "/usr/src/homeassistant/homeassistant/core.py", line 454, in async_run_job
return self.async_run_hass_job(HassJob(target), *args)
File "/usr/src/homeassistant/homeassistant/core.py", line 435, in async_run_hass_job
hassjob.target(*args)
File "/usr/src/homeassistant/homeassistant/components/shelly/__init__.py", line 268, in _handle_ha_stop
self.shutdown()
File "/usr/src/homeassistant/homeassistant/components/shelly/__init__.py", line 261, in shutdown
self.device.shutdown()
File "/usr/local/lib/python3.8/site-packages/aioshelly/__init__.py", line 230, in shutdown
self._unsub_listening()
File "/usr/local/lib/python3.8/site-packages/aioshelly/coap.py", line 110, in <lambda>
return lambda: self.subscriptions.pop(ip)
KeyError: '192.168.0.15'

Got more errors during the night and day

Logger: frontend.js.latest.202103026
Source: components/system_log/__init__.py:190
First occurred: 05:50:36 (1 occurrences)
Last logged: 05:50:36

http://192.168.0.10:8123/frontend_latest/core.a16e4a28.js:1:7525 Uncaught Error: Suspend promise not set
Logger: homeassistant.components.shelly
Source: helpers/update_coordinator.py:173
Integration: Shelly (documentation, issues)
First occurred: 15:46:04 (1 occurrences)
Last logged: 15:46:04

Error fetching shellybutton1-84CCA8AB4A3A data: Sleeping device did not update
Logger: homeassistant.components.websocket_api.http.connection
Source: components/shelly/device_trigger.py:71
Integration: Home Assistant WebSocket API (documentation, issues)
First occurred: 01:22:33 (2 occurrences)
Last logged: 18:26:09

[2937669568] Error handling message: Unknown error
[2936775800] 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

Please open issue here https://github.com/home-assistant/core/issues/new?assignees=&labels=&template=bug_report.yml&title= and we will try to fix this.

I just found your issue https://github.com/home-assistant/core/issues/47782
Thanks

New to the place so made post here first, but realized that flat out errors maybe should be reported somewhere else and found the issue tracker. I’ll leave this post up in case someone else have issues and looks around.

Cheers