Help with quotations

Hi, I have this line that is a subset of a shell command:

IRHVAC%20{"Vendor":"GREE","Power":"On","Mode":"Heat","FanSpeed":"Auto","Temp":"{{ states('input_number.hvac_temperature')|int }}","Light":"On"}

and it has to be enclosed in quotes, but I’m already using both sets of quote symbols (’ and "). What can I do? Below, ‘##’ is where the problematic quote are:

wget --spider -q http://192.168.2.175/cm?cmnd=##IRHVAC%20{"Vendor":"GREE","Power":"On","Mode":"Heat","FanSpeed":"Auto","Temp":"{{ states('input_number.hvac_temperature')|int }}","Light":"On"}##

So what can I use instead of ‘##’? Thanks.

Just a guess…
Use single quotes for the whole URL, and escape the nested single quotes:

wget --spider -q 'http://192.168.2.175/cm?cmnd=IRHVAC%20{"Vendor":"GREE","Power":"On","Mode":"Heat","FanSpeed":"Auto","Temp":"{{ states('\''input_number.hvac_temperature'\'')|int }}","Light":"On"}'

1 Like

It was easier than expected. I didn’t need to do anything lol. They don’t interfere with one another. This works:

shell_command:
  set_hvac_temp_input: |
    wget --spider -q http://192.168.2.175/cm?cmnd='IRHVAC%20{"Vendor":"GREE","Power":"On","Mode":"Heat","FanSpeed":"Auto","Temp":"{{ states('input_number.hvac_temperature')|int }}","Light":"On"}'