Is it possible to use !secrets
with a REST Sensor?
This works (the password is hard coded in the resource
secret)
sensor:
- platform: rest
name: hall_panel_fully_kiosk_info
resource: !secret fully_kiosk_rest_resource
value_template: '{{ value_json.isScreenOn }}'
json_attributes:
- batteryLevel
But neither of these do
sensor:
- platform: rest
name: hall_panel_fully_kiosk_info
resource: http://192.168.1.223:2323//?cmd=deviceInfo&type=json
password: !secret fully_kiosk_rest_password
value_template: '{{ value_json.isScreenOn }}'
json_attributes:
- batteryLevel
(I didn’t actually expect this next one to work)
sensor:
- platform: rest
name: hall_panel_fully_kiosk_info
resource: http://192.168.1.223:2323//?cmd=deviceInfo&type=json&!secret fully_kiosk_rest_password
value_template: '{{ value_json.isScreenOn }}'
json_attributes:
- batteryLevel