Hello Community,
I’m very new here and let’s say “advanced beginner” in home assistant.
A few days ago I bought a new smart lock that I want to integrate in my ha.
To authenticate at the locks api I have to generate an acces_token. I thought rest sensor is the best choice. So I coded in the configuration.yaml the following sensor.
sensors:
- platform: rest
name: token
resource: https://tedee.b2clogin.com/tedee.onmicrosoft.com/oauth2/v2.0/token?p=B2C_1_SignIn_Ropc
method: POST
headers:
Content-Type: application/x-www-form-urlencoded
payload: 'grant_type=password&username=myuser&password=mypassword&scope=openid 02106b82-0524-4fd3-ac57-af774f340979&client_id=02106b82-0524-4fd3-ac57-af774f340979&response_type=token id_token'
json_attributes:
- access_token
value_template: '{{ value_json.access_token }}'
Unfortunately I don’t get any response. Even the sensor itself is not visible when I try to add it in the ui. And I really do not know whats wrong.
I would appreciate any help. Thanks in advance.