I have the following Rest Sensor set which does show up in HA. The issue is that it won’t login to provide me with the info I need (accessToken) and the ‘Success’ attribute always shows as False. I have run the info through Postman and it returns True with all other attributes. Any ideas?
- platform: rest
name: kaluza_login
resource_template: https://identity.gridsvc.net/login
force_update: true
headers:
content_type: "application/json"
Accept: "application/json"
Accept-Language: "en-gb"
Origin: https://cev.kaluza.com
Referer: https://cev.kaluza.com/
Host: "identity.gridsvc.net"
Connection: "keep-alive"
method: POST
# payload: !secret kaluza_login
payload: '{ "username": "[email protected]","password": "xxxxx","ignoreChallenges": true }'
value_template: "{{ value_json.accessToken }}"
json_attributes:
- success
- accessToken
- refreshToken
- idToken
- expires
Postman details are here:
{
"name": "Login Only (Not needed - Example only)",
"event": [
{
"listen": "test",
"script": {
"type": "text/javascript",
"exec": [
"const responseJson = pm.response.json();\r",
"\r",
"pm.collectionVariables.set('access_token', responseJson[\"idToken\"]);\r",
""
]
}
}
],
"request": {
"method": "POST",
"header": [
{
"key": "Host",
"value": "identity.gridsvc.net"
},
{
"key": "Content-Type",
"value": "application/json"
},
{
"key": "Accept",
"value": "application/json"
},
{
"key": "Accept-Language",
"value": "en-gb"
},
{
"key": "Origin",
"value": "https://cev.kaluza.com",
"type": "text"
},
{
"key": "Referer",
"value": "https://cev.kaluza.com/",
"type": "text"
}
],
"body": {
"mode": "raw",
"raw": "{\r\n \"username\": \"{{emailId}}\",\"password\": \"{{passwordId}}\",\"ignoreChallenges\": true\r\n }"
},
"url": "https://identity.gridsvc.net/login"
},
"response": []
}