Hi,
I am trying to create a sensor for Homeassistant so I can see which BlueIris profile is active for the moment.
I have created a bash-script for the json commands but I am stuck, it wont log me in.
# Ask about sessionkey and add it to $sessionkey
sessionkey=$(curl --header "Content-Type: application/json" --request POST --data '{"cmd":"login"}' http://192.168.1.205:81/json | jq -r '.session')
# create responsekey
responsekey=$(echo -n username:$sessionkeyassword | md5sum)
# Log in via json
curl --header "Content-Type: application/json" --request POST --data '{"cmd":"login","session":'"$sessionkey"',"response":'"$responsekey"'}' http://192.168.1.205:81/json
Any ideas?
Thanks in advance!
I am trying to create a sensor for Homeassistant so I can see which BlueIris profile is active for the moment.
I have created a bash-script for the json commands but I am stuck, it wont log me in.
# Ask about sessionkey and add it to $sessionkey
sessionkey=$(curl --header "Content-Type: application/json" --request POST --data '{"cmd":"login"}' http://192.168.1.205:81/json | jq -r '.session')
# create responsekey
responsekey=$(echo -n username:$sessionkeyassword | md5sum)
# Log in via json
curl --header "Content-Type: application/json" --request POST --data '{"cmd":"login","session":'"$sessionkey"',"response":'"$responsekey"'}' http://192.168.1.205:81/json
Any ideas?
Thanks in advance!