Hello I’m working to adapt the post message in the power shell script below to work with the restful service in home assistant.
So far I’ve got a little bit of the body worked out for the body of the request but I seem to be missing a few parameters. Can someone here help me format my Yaml to match what is the PowerShell script below? Also would it be possible to set the value of the request based off of the value of an input number helper?
Powershell Script
$Headers = @{
'X-Auth-PSK' = '1234'
}
$TVIP = '192.168.10.128'
$Body = @{
method = 'setPictureQualitySettings'
version = '1.0'
id = 12
params = @(
@{
settings = @(
@{
target = 'brightness'
value = '49'
}
)
}
)
} | ConvertTo-Json -Depth 6
Invoke-RestMethod -Uri http://$TVIP/sony/video -Body $Body -Headers $Headers -Method POST
YAML Restful Service
tv_brightness1:
url: http://192.168.10.128/sony/video
method: POST
headers:
X-Auth-PSK: '1234'
content_type: 'application/json'
payload: '{"method": "setPictureQualitySettings","id": 12,"params": ??? "version": "1.0"}'
verify_ssl: false