Hi @asetGem ,
If I follow your config I get the following log:
s6-rc: info: service legacy-services successfully started
[00:49:59] INFO: Generating config.yaml from options.json
[00:49:59] INFO: Configuration :
[00:49:59] INFO: # Generated by homeassistant, do not edit!
# Edit configuration only at the Add-on configuration tab!
debug: true
delay_device: 60
delay_site: 10
homeassistant_config:
code: <code>
code_arm_required: false
code_disarm_required: false
manual_snapshot: false
mqtt:
client-id: somfy-protect
ha_discover_prefix: homeassistant
host: core-mosquitto
password: <its password which is a very long string>
port: 1883
ssl: false
topic_prefix: somfyProtect2mqtt
username: homeassistant
somfy_protect:
password: <pw>
sites:
- <sitename>
username: <uname>
curl: (7) Couldn't connect to server
[00:49:59] ERROR: Something went wrong contacting the API
[00:49:59] INFO: Image build
[00:49:59] INFO: starting original stuff...
2022-07-03 00:49:59,720 [INFO] [__main__:55] Starting SomfyProtect2Mqtt 0.2.1
2022-07-03 00:49:59,721 [INFO] [root:43] Reading config file /usr/bin/SomfyProtect2MQTT/somfyProtect2Mqtt/config/config.yaml
2022-07-03 00:49:59,724 [INFO] [root:114] Init SSO
2022-07-03 00:49:59,724 [INFO] [somfy_protect.sso:79] Requesting Token
Traceback (most recent call last):
File "/usr/lib/python3.9/site-packages/urllib3/connection.py", line 174, in _new_conn
conn = connection.create_connection(
File "/usr/lib/python3.9/site-packages/urllib3/util/connection.py", line 73, in create_connection
for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM):
File "/usr/lib/python3.9/socket.py", line 954, in getaddrinfo
for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
PermissionError: [Errno 13] Permission denied
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/lib/python3.9/site-packages/urllib3/connectionpool.py", line 699, in urlopen
httplib_response = self._make_request(
File "/usr/lib/python3.9/site-packages/urllib3/connectionpool.py", line 382, in _make_request
self._validate_conn(conn)
File "/usr/lib/python3.9/site-packages/urllib3/connectionpool.py", line 1010, in _validate_conn
conn.connect()
File "/usr/lib/python3.9/site-packages/urllib3/connection.py", line 358, in connect
conn = self._new_conn()
File "/usr/lib/python3.9/site-packages/urllib3/connection.py", line 186, in _new_conn
raise NewConnectionError(
urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPSConnection object at 0x7fca05304b50>: Failed to establish a new connection: [Errno 13] Permission denied
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/lib/python3.9/site-packages/requests/adapters.py", line 439, in send
resp = conn.urlopen(
File "/usr/lib/python3.9/site-packages/urllib3/connectionpool.py", line 755, in urlopen
retries = retries.increment(
File "/usr/lib/python3.9/site-packages/urllib3/util/retry.py", line 574, in increment
raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='sso.myfox.io', port=443): Max retries exceeded with url: /oauth/oauth/v2/token (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7fca05304b50>: Failed to establish a new connection: [Errno 13] Permission denied'))
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/bin/SomfyProtect2MQTT/somfyProtect2Mqtt/main.py", line 59, in <module>
SSO = init_sso(config=CONFIG)
File "/usr/bin/SomfyProtect2MQTT/somfyProtect2Mqtt/somfy_protect/sso/__init__.py", line 122, in init_sso
token = sso.request_token()
File "/usr/bin/SomfyProtect2MQTT/somfyProtect2Mqtt/somfy_protect/sso/__init__.py", line 80, in request_token
return self._oauth.fetch_token(
File "/usr/lib/python3.9/site-packages/requests_oauthlib/oauth2_session.py", line 341, in fetch_token
r = self.request(
File "/usr/lib/python3.9/site-packages/requests_oauthlib/oauth2_session.py", line 521, in request
return super(OAuth2Session, self).request(
File "/usr/lib/python3.9/site-packages/requests/sessions.py", line 542, in request
resp = self.send(prep, **send_kwargs)
File "/usr/lib/python3.9/site-packages/requests/sessions.py", line 655, in send
r = adapter.send(request, **kwargs)
File "/usr/lib/python3.9/site-packages/requests/adapters.py", line 516, in send
raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPSConnectionPool(host='sso.myfox.io', port=443): Max retries exceeded with url: /oauth/oauth/v2/token (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7fca05304b50>: Failed to establish a new connection: [Errno 13] Permission denied'))
[22:49:59] WARNING: Halt add-on
s6-rc: info: service legacy-services: stopping
[22:49:59] INFO: Service restart after closing
s6-rc: info: service legacy-services successfully stopped
s6-rc: info: service legacy-cont-init: stopping
s6-rc: info: service legacy-cont-init successfully stopped
s6-rc: info: service fix-attrs: stopping
s6-rc: info: service fix-attrs successfully stopped
s6-rc: info: service s6rc-oneshot-runner: stopping
s6-rc: info: service s6rc-oneshot-runner successfully stopped
The strange thing is, when I run the docker container instead of the HA plugin, I do get it to work but only in 1 direction: I can see the status of the alarm_panel but cannot control it.
For that I have to run like so: docker run -v /home/rakimac/somfy:/usr/src/SomfyProtect2MQTT/somfyProtect2Mqtt/config treynaer/somfyprotect2mqtt
with config:
somfy_protect:
username: <uname>
password: <pw>
sites:
- <sitename>
homeassistant_config:
code: <code>
code_arm_required: false
code_disarm_required: false
mqtt:
host: 192.168.xx.xxx (internal ip of ha)
port: 1882 (had to use a different port for this)
ssl: false
username: <user created for mqtt>
password: <its pw>
client-id: somfy-protect
topic_prefix: somfyProtect2mqtt
ha_discover_prefix: homeassistant
delay_site: 10
delay_device: 60
manual_snapshot: false
debug: true
So Iâm a bit lost hereâŚ