Hi @runevad,
I tried to use your method, so in my configuration.yaml i have this:
#Synology Home Mode
rest_command:
ss_enable_home:
url: !secret home_mode_on
method: get
ss_disable_home:
url: !secret home_mode_off
method: get
In my secrets.yaml file i have the both urls, that works, because when i do it by my firefox, i see that home mode turn off and on.
#Home mode on
home_mode_on: https://192.168.1.100:7001/webapi/entry.cgi?api=SYNO.SurveillanceStation.HomeMode&version=1&method=Switch&on=true&_sid=E9POXXXXXXXXXXXXXXXX
#Home mode off
home_mode_off: https://192.168.1.100:7001/webapi/entry.cgi?api=SYNO.SurveillanceStation.HomeMode&version=1&method=Switch&off=true&_sid=E9POXXXXXXXXXXXXXXXX
And then i have my automation:
alias: Desactivar Disp No Presencia
hide_entity: True
initial_state: 'on'
trigger:
platform: state
entity_id: group.track_casa
from: 'home'
to: 'not_home'
condition:
- condition: state
entity_id: input_boolean.suegros_casa
state: 'off'
action:
- service: homeassistant.turn_off
entity_id: group.regleta_dormitorio
- service: switch.turn_off
entity_id: switch.enchufe_tv
- service: switch.turn_off
entity_id: switch.00117477dc4f22c971de_4
- service: switch.turn_off
entity_id: switch.deco_ruso
- service: switch.turn_off
entity_id: switch.tele
- service: switch.turn_off
entity_id: switch.enchufe_cocina
- service: rest_command.ss_disable_home
- service: notify.telegram
data_template:
title: "Casa: "
message: "Dispositivos OFF, Home Mode ON"
So when i go out from home, all devices of automation, turn off, but the service rest_command don’t works and also the telegram notification does’t work.
In my logs, i can see this:
2019-02-04 19:26:29 ERROR (MainThread) [homeassistant.components.automation] Error while executing automation automation.activar_disp_presencia. Unknown error for call_service at pos 7:
Traceback (most recent call last):
File “/usr/local/lib/python3.6/site-packages/aiohttp/connector.py”, line 924, in _wrap_create_connection
await self._loop.create_connection(*args, **kwargs))
File “uvloop/loop.pyx”, line 1945, in create_connection
File “uvloop/loop.pyx”, line 1942, in uvloop.loop.Loop.create_connection
File “uvloop/handles/stream.pyx”, line 977, in uvloop.loop.__uv_stream_buffered_on_read
File “uvloop/sslproto.pyx”, line 367, in uvloop.loop.SSLProtocol.buffer_updated
File “uvloop/sslproto.pyx”, line 483, in uvloop.loop.SSLProtocol._do_handshake
File “/usr/local/lib/python3.6/ssl.py”, line 694, in do_handshake
match_hostname(self.getpeercert(), self.server_hostname)
File “/usr/local/lib/python3.6/site-packages/idna_ssl.py”, line 19, in patched_match_hostname
return real_match_hostname(cert, hostname)
File “/usr/local/lib/python3.6/ssl.py”, line 331, in match_hostname
% (hostname, dnsnames[0]))
ssl.CertificateError: hostname ‘192.168.1.100’ doesn’t match ‘my.domain.com’
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File “/usr/src/app/homeassistant/components/rest_command.py”, line 101, in async_service_handler
headers=headers
File “/usr/local/lib/python3.6/site-packages/aiohttp/client.py”, line 476, in _request
timeout=real_timeout
File “/usr/local/lib/python3.6/site-packages/aiohttp/connector.py”, line 522, in connect
proto = await self._create_connection(req, traces, timeout)
File “/usr/local/lib/python3.6/site-packages/aiohttp/connector.py”, line 854, in _create_connection
req, traces, timeout)
File “/usr/local/lib/python3.6/site-packages/aiohttp/connector.py”, line 992, in _create_direct_connection
raise last_exc
File “/usr/local/lib/python3.6/site-packages/aiohttp/connector.py”, line 974, in _create_direct_connection
req=req, client_error=client_error)
File “/usr/local/lib/python3.6/site-packages/aiohttp/connector.py”, line 927, in _wrap_create_connection
req.connection_key, exc) from exc
aiohttp.client_exceptions.ClientConnectorCertificateError: Cannot connect to host 192.168.1.100:7001 ssl:True [CertificateError: (“hostname ‘192.168.1.100’ doesn’t match ‘my.domain.com’”,)]
Someone can help me with this?
thanks