Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error trying to create automation with a Shelly Button1 #47782

Closed
FelixHansson opened this issue Mar 12, 2021 · 4 comments
Closed

Error trying to create automation with a Shelly Button1 #47782

FelixHansson opened this issue Mar 12, 2021 · 4 comments
Assignees

Comments

@FelixHansson
Copy link

The problem

I can't get a Shelly Button1 to work, I can add it through the integration either through discovery or manually with IP address but I can't get the button to work with an automation. No variation of clicking works, the automation itself works when triggered through the web-ui.

I tried restarting the server but that resulted in the provided error log and causes the automation UI to glitch, I can no longer select what kind of click I want, it is grayed out and says "Unknown trigger" (in the language I use). Furthermore, when trying to create a new automation after a restart, I can no longer select to use a click as a trigger, I only get the alternative to react to changing battery level. These options come back if I remove and add the button again but the automation still won't work and if I restart the server I get same error as before.

The Button1 uses the following firmware: 20201124-092049/v1.9.0@57ac4ad8, which should be the latest. Battery or usb-power seems to make no difference.

What is version of Home Assistant Core has the issue?

core-2021.3.3

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

# Put your YAML below this line
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

Anything in the logs that might be useful for us?

# Put your logs below this line
Logger: homeassistant.components.websocket_api.http.connection
Source: components/shelly/device_trigger.py:71
Integration: Home Assistant WebSocket API (documentation, issues)
First occurred: 03:12:40 (1 occurrences)
Last logged: 03:12:40

[2887002864] 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 created a post on the community forum here: https://community.home-assistant.io/t/error-trying-to-create-automation-with-shelly-button1/288964

It contains some additional logs but they are of the same nature as the one I posted here pretty much.

@probot-home-assistant
Copy link

shelly documentation
shelly source
(message by IssueLinks)

@FelixHansson
Copy link
Author

I have updated the Shelly firmware to 20210318-140853/v1.10.0-geba262d and HA to core-2021.3.4 with no difference

Logger: homeassistant.components.websocket_api.http.connection
Source: components/shelly/device_trigger.py:71
Integration: Home Assistant WebSocket API (documentation, issues)
First occurred: 11:52:57 (1 occurrences)
Last logged: 11:52:57

[2886162944] 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

@FelixHansson
Copy link
Author

FelixHansson commented Mar 23, 2021

Noticed this issue #48095 and I'm not sure if I screwed up and missed CoIoT on https://www.home-assistant.io/integrations/shelly/ but I followed the instructions and the button now works with and without charger plugged in. Seems to work even after multiple server restarts. I'll leave the issue open for now and close it in the coming days if nothing pop ups

@FelixHansson
Copy link
Author

Ok, so something did go wrong with my setup that I deem unrelated and it's working now so I'll close this issue. I got an issue with a Shelly H&T (something about not receiving updates) but that will become a separate issue if the problem persists. The problem that occurred with my setup was REALLY weird. Philips Hue stopped working since it couldn't be reached according to HA, but it was very much plugged in and the only thing I did do with my router was to reserve the IP for the Hue Bridge. My router is behaving a bit weird and doesn't always list all the wired connected devices for whatever reason, it is alternating between not showing the Hue Bridge or HA Server, and in some menus it does show that something is connected to the ports. Removing and re-adding the Philips Hue got it working and the HA now works even after a restart so as mentioned in the beginning I'll close this issue.

@github-actions github-actions bot locked and limited conversation to collaborators Apr 23, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants