Command line sensor error - Command failed: curl

Hi I am trying to fetch data from an InfluxDB query using Curl. It works perfectly when I type it into my MacOS terminal, but I just get ‘Command failed: curl’ on the Home Assistant log. I would use the InfluxDB sensor, but it does not appear to support integer and cumulative parameters. Any ideas?

sensor 600:
- platform: command_line
  command: >-
    curl -X POST -d -G 'http://192.168.1.101:8086/query' --data-urlencode "db=iotawatt" --data-urlencode "max-row-limit=5" --data-urlencode "epoch=ms" --data-urlencode "q=SELECT cumulative_sum(integral("value")) /3600000 FROM "autogen"."Grid_import" WHERE time >= now() - 2m GROUP BY time(10s) fill(null)"
    scan_interval: 30
    name: Influxdb_query