Rest sensor: 401 Unauthorized

I’m trying to get a rest sensor to work but I get 401 Unauthorized and I don’t know what I’m doing wrong. I can post PUT commands to the same device via rest command with out any problems at all.

Configuration for the rest sensor:

sensor:
  - platform: rest
    name: litecom_heating
    resource: "https://192.168.1.254/rest/v1/zones/4320c874-b2a1-4ef3-8d24-9efe3ef75697/services/scene"
    method: GET
    headers:
      accept: 'application/json'
      Autorization: !secret litecom
    verify_ssl: false

Configuration for the rest command

varme_till:
  url: "https://192.168.1.254/rest/v1/zones/4320c874-b2a1-4ef3-8d24-9efe3ef75697/services/scene"
  method: PUT
  headers:
    accept: 'application/json'
    Authorization: !secret litecom
  content_type: 'application/json'
  payload: '{ "activeScene": 0 }'
  verify_ssl: false 

From states:

Usually the Authorization header value includes something Basic or Digest after the colon and before the actual token - is that included in your secret?

Yes, Bearer is included in the secret


litecom: 'Bearer xxxxxxxxxx’

1 Like

This one has a typo: AutorizationAuthorization

I’ve corrected the typo but still get 401 Unauthorized