guilly
June 7, 2021, 10:54am
1
Hi,
I’m trying to change dashboard views based on an event. I’ve configured the rest_command in configuration.yaml.
#configuration .yaml
rest_command:
kiosk_mainfloor_new:
url: !secret rest_url2_kiosk_command
#secrets .yaml
rest_url2_kiosk_command: 'http://10.0.10.27:2323/?cmd={{ cmd }}&url={{ key }}&value={{ value }}&type=json&password=#####'
I know the rest command is properly formatted because if I replace the Jinja variables and hard code the cmd and url it works. Is there any way to see how the service call is passing the values ? I’m guessing the url isn’t being passed properly ?
#service call - developer tools
service: rest_command.kiosk_mainfloor_new
data:
cmd: "loadUrl"
url: "https://www.google.com
Troon
(Troon)
June 7, 2021, 10:59am
2
What happens if you put the command template directly into configuration.yaml
?
Anything in the logs?
guilly
June 7, 2021, 11:02am
3
I’ve put the command directly in configuration.yaml and secrets.yaml and it works. Nothing in the system logs.
I’m fairly certain it’s the url that isn’t being parsed properly but can’t confirm.
koying
(Chris B)
June 7, 2021, 11:18am
4
Yes, I’m not convinced strings included via !secret
are template-compatible.
rest_command:
kiosk_mainfloor_new:
url: 'http://10.0.10.27:2323/?cmd={{ cmd }}&url={{ key }}&value={{ value }}&type=json&password={{ password }}'
service: rest_command.kiosk_mainfloor_new
data:
cmd: "loadUrl"
key: "https://www.google.com"
value: "my value"
password: !secret rest_url2_kiosk_command_password
Would likely work, though.
Troon
(Troon)
June 7, 2021, 11:18am
5
I mean put it in configuration.yaml
with the template as it is.
guilly
June 7, 2021, 10:27pm
6
wow that was incredibly noobish of me …
Strings in the template work fine. It would help if I passed in the correct key though.
service: rest_command.kiosk_mainfloor_new
data:
cmd: "loadURL"
**key:** "https://www.google.com"