Sturmkater
(Sturmkater)
November 7, 2022, 3:32pm
1
I want to send a shutdown signal to an hifiberry Audiodevice. The curl command looks like this:
curl -X POST hifiberry.local:81/api/system/poweroff -H "Authtoken: hifiberry"
When I add this to the configuration.yaml I’m getting an error that Authtoken is unknown.
Is it a syntax problem or how to achieve this goal?
sr_off:
url: "http://192.168.1.21:81/api/system/poweroff"
method: POST
authtoken: hifiberry
All the other commands without the authtoken work perfect by the way.
koying
(Chris B)
November 7, 2022, 3:54pm
2
authtoken
is a header.
sr_off:
url: "http://192.168.1.21:81/api/system/poweroff"
method: POST
headers:
Authtoken: hifiberry
Sturmkater
(Sturmkater)
November 7, 2022, 4:02pm
3
Failed to restart Home Assistant
The system cannot restart because the configuration is not valid: Error loading /config/configuration.yaml: while parsing a block mapping in "/config/configuration.yaml", line 3, column 1 expected <block end>, but found '<block mapping start>' in "/config/configuration.yaml", line 52, column 3
Sturmkater
(Sturmkater)
November 7, 2022, 4:43pm
4
It works now!! Thanks a lot. The problem was that I did not copy the space in front of the sr_off. Now your solution works