Help with RESTful params variable

Baby steps. Have updated my config to something like:

sensor:
  - platform: rest
    name: poolsensors
    resource: https://192.168.0.1/api/poolstatus
    method: POST
    payload: '{"pool_api_code":"magicnumbers"}'
    scan_interval: 600
    json_attributes:
    - pool_spa_selection
    - heat_cool_selection
    - temperature
    - active_favourite
    - heaters
    - solar_systems
    - channels
    - valves
    - lighting_zones

and it loads without errors. But. On starting I’m now getting a “REST result could not be parsed as JSON” warning in the log, so something else is happening. I might need to wait now until the morning after I’ve had a decent amount of coffee. :wink:

Update - turned on debug and got:

2021-06-01 17:07:03 WARNING (MainThread) [homeassistant.components.rest.sensor] REST result could not be parsed as JSON
2021-06-01 17:07:03 DEBUG (MainThread) [homeassistant.components.rest.sensor] Erroneous JSON: <?xml version="1.0" encoding="utf-8"?>

So, initially looks like the data being returned is not correctly formatted. Dang. Might need two coffees.

Another update:

< HTTP/2 200 
< cache-control: private
< content-type: application/json; charset=utf-8
< server: Microsoft-IIS/10.0
< x-aspnet-version: 4.0.30319
< x-powered-by: ASP.NET

Sigh. Oh, and on top of that I’ve just realised that the output from the server is greater than 255 characters, so that won’t be helping either. I’ll need to look at a workaround (eg json_attributes) in any case.