Help with REST JSON sensor

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

This coupled with a reboot did the trick. Maybe there’s a more elegant way but it did what I needed:

  - platform: rest
    resource: http://192.168.1.122:8080/jsonrpc?request={%22jsonrpc%22:%222.0%22,%22method%22:%22Player.GetProperties%22,%22params%22:{%20%22playerid%22:%201,%20%22properties%22:%20[%22shuffled%22]%20},%20%22id%22:%201%20}
    name: mbr_shuffle
    timeout: 30
    scan_interval: 10    
    value_template: "{{value_json.result.shuffled}}"
    force_update: true