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

Shelly integration does not support devices connected via Shelly range extenders #78820

Closed
tempesta-home opened this issue Sep 20, 2022 · 6 comments

Comments

@tempesta-home
Copy link

tempesta-home commented Sep 20, 2022

The problem

I'm trying the new feature "Range Extender" of the shelly Pro and Plus series.
You can connect Shelly devices through other Shelly devices, but the result is that you can have one IP address (the shelly device that acts as gateway/proxy) that maps on many shelly devices on different ports.
The Shelly App works regularly.
When you try to connect HA Shelly integration with an IP:Port pattern the result is: "Unexpected Error"

Unexpected exception
Traceback (most recent call last):
  File "/usr/local/lib/python3.10/site-packages/aioshelly/common.py", line 52, in process_ip_or_options
    ipaddress.ip_address(options.ip_address)
  File "/usr/local/lib/python3.10/ipaddress.py", line 54, in ip_address
    raise ValueError(f'{address!r} does not appear to be an IPv4 or IPv6 address')
ValueError: '10.82.55.43:8083' does not appear to be an IPv4 or IPv6 address

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/shelly/config_flow.py", line 119, in async_step_user
    device_info = await validate_input(
  File "/usr/src/homeassistant/homeassistant/components/shelly/config_flow.py", line 72, in validate_input
    block_device = await BlockDevice.create(
  File "/usr/local/lib/python3.10/site-packages/aioshelly/block_device.py", line 75, in create
    options = await process_ip_or_options(ip_or_options)
  File "/usr/local/lib/python3.10/site-packages/aioshelly/common.py", line 55, in process_ip_or_options
    options.ip_address = await loop.run_in_executor(
  File "/usr/local/lib/python3.10/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
socket.gaierror: [Errno -2] Name does not resolve

What version of Home Assistant Core has the issue?

2022.9.5

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/

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

No response

@probot-home-assistant
Copy link

Hey there @balloob, @bieniu, @thecode, @chemelli74, mind taking a look at this issue as it has been labeled with an integration (shelly) you are listed as a code owner for? Thanks!
(message by CodeOwnersMention)


shelly documentation
shelly source
(message by IssueLinks)

@thecode
Copy link
Member

thecode commented Sep 20, 2022

Shelly integration does not support this feature, we currently have other Shelly features with higher priority that are already in work so I can't update on a timeline for that.

@thecode thecode changed the title Shelly integration can't connect to Shelly device when port is different from 80 Shelly integration does not support devices connected via Shelly range extenders Sep 20, 2022
@JZach
Copy link

JZach commented Oct 1, 2022

Ran into the same problem. Although, the shelly "Range Extender" feature is still in BETA, it seems to work quite promising. According to @thecode, the feature won't be supported within the near future. Therefore I was giving it a shot to work-around the issue.

  1. Enable "Range Extender" feature on primary shelly
  2. Connect secondary shelly to primary shelly
  3. Secondary shelly should be available at "primary-ip:port" (eg. 10.0.0.1:8002)
  4. Set up a "proxy" that forwards http/websocket requests to that url (10.0.0.1:8002)

In my case I've used apache2 with "mod_proxy, mod_proxy_http and mod_proxy_wstunnel" to handle the requests.

<VirtualHost 10.0.0.2:80>
    ProxyRequests Off
    ProxyPreserveHost On

    RewriteEngine On
    RewriteCond %{HTTP:Connection} Upgrade [NC]
    RewriteCond %{HTTP:Upgrade} websocket [NC]
    RewriteRule /(.*) ws://10.0.0.1:8002/$1  [P,L]

    ProxyPass / http://10.0.0.1:8002/ retry=1
    ProxyPassReverse / http://10.0.0.1:8002/
</VirtualHost>

All requests to 10.0.0.2 will be forwarded to 10.0.0.1:8002 (secondary shelly) and it's possible to be used within home-assistant. Unfortunately, this is nothing more that a proof-of-concept.

@iamthe1st
Copy link

I would love this feature! I would like to add a "Shelly 3EM" next to my "Pro 4PM" and share the "4PMs" ethernet connection to the 3EM with this "Range Extender" feature.

@bluechris
Copy link

I would love this feature! I would like to add a "Shelly 3EM" next to my "Pro 4PM" and share the "4PMs" ethernet connection to the 3EM with this "Range Extender" feature.

Yeah me to... i hope some day this will be fixed :)

@thecode
Copy link
Member

thecode commented Dec 9, 2022

Please create a feature request here: https://community.home-assistant.io/c/feature-requests/13
Locking this issue, it is on my todo list, when there are news I will link to this issue.

@thecode thecode closed this as completed Dec 9, 2022
@home-assistant home-assistant locked as off-topic and limited conversation to collaborators Dec 9, 2022
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

8 participants