Hi,
I seem to be struggling w/ REST JSON sensors. Below is my sensor.
- platform: rest
resource: http://192.168.1.122:8080/jsonrpc
name: "mbr_shuffle"
method: GET
timeout: 30
scan_interval: 10
payload: '{"jsonrpc":"2.0","method":"Player.GetProperties","params":{ "playerid": 1, "properties": ["shuffled"] }, "id": 1 }'
value_template: '{{ value_json.result.shuffled }}'
Below is my url which works fine pasted directly into a browser:
http://192.168.1.122:8080/jsonrpc?request={"jsonrpc":"2.0","method":"Player.GetProperties","params":{ "playerid": 1, "properties": ["shuffled"] }, "id": 1 }
which returns:
{"id":1,"jsonrpc":"2.0","result":{"shuffled":true}}
I have validated my results in template editor thusly:
{% set value_json =
{"id":1,"jsonrpc":"2.0","result":{"shuffled":true}}
%}
{{ value_json.result.shuffled }}
which returns “True” as expected. My problem is no sensor seems to be getting created and I’m not seeing anything in the logs indicating syntax or other issues.
Would appreciate any advice!
thanks
rob