Check URL for content and then take action

Hello Home Assistant-world,
i would like to build a switch for a heating control.
I’ve got it done so far and it’s running. But I have to rely on the URL to work.

I built a switch with url and built the control buttons via rest_command.

switch:
  - platform: command_line
    switches:
      heater:
        command_on: "/usr/bin/curl -X GET http://192.168.1.111/cmd.cgi/?Heat=on"
        command_off: "/usr/bin/curl -X GET http://192.168.1.111/cmd.cgi/?Heat=off"
        friendly_name: Heizung
rest_command:
  heater_lvl_1:
    url: "http://192.168.1.111/cmd.cgi/?PwrLvl=1"
  heater_lvl_2:
    url: "http://192.168.1.111/cmd.cgi/?PwrLvl=2"
  heater_lvl_3:
    url: "http://192.168.1.111/cmd.cgi/?PwrLvl=3"

Now I’m looking for a way to check the URL for correctness, that the action was really executed.
On the web page of the URL (all URLs), the following is output when executed correctly:

{"state":"OK"}

How can I use this in Home Assistant?
Does somebody has any idea?

is there any other web page you can get current state? As far as i know, you want two different solutions at once;

  1. rest command to call web pages to initiate an event
  2. restful sensor to read the output of web call and expose as sensor (binary sensor or just sensor)
    if you can find a rest endpoint to get the status (on,off) and heat level (1,2,3), you can create restful sensor following here: RESTful Sensor - Home Assistant

P.S.: you can convert your switch into restful switch to standardize your implementation: RESTful Switch - Home Assistant