ohadbenita
(Ohad Benita)
1
Consider the following shell_command:
shell_command:
toggle_adguard_protection: curl -H "Authorization: Basic {{auth}}" -d "{'protection_enabled': {{enable_protection}}}" "http://{{ip_address}}:{{port}}/control/dns_config
However, the configuration validation fails on the colon after the Authorization
part.
Any idea how to work around this?
petro
(Petro)
2
You have to wrap the whole thing in quotes, but you have quotes allover it. So just use multiline indicator
shell_command:
toggle_adguard_protection: >
curl -H "Authorization: Basic {{auth}}" -d "{'protection_enabled': {{enable_protection}}}" "http://{{ip_address}}:{{port}}/control/dns_config
2 Likes
ohadbenita
(Ohad Benita)
4
This didn’t work out, no errors appear in the logs…
petro
(Petro)
5
are you sure the command is correct? It looks suspect. You’re at least missing a quote at the end
ohadbenita
(Ohad Benita)
6
Here’s my latest configuration
toggle_adguard_protection: >
curl -H "Authorization: Basic {{auth}}" -d "{'protection_enabled': {{enable_protection}}}" "http://{{ip_address}}:{{port}}/control/dns_config"
nickrout
(Nick Rout)
7
I wonder whether the adguard integration covers what you want to do? https://www.home-assistant.io/integrations/adguard/
ohadbenita
(Ohad Benita)
8
Funny that you asked - I have two instances (one for failover) so the integration doesn’t support it.