Thanks for sharing this!
I have tried to get this working here… a few changes were needed to get the commands to working but the status update doesn’t work. I changed the switch definition like this:
switch:
platform: command_line
switches:
hombot:
command_on: "curl GET http://1HOMBOTIP:HOMBOTPORT/json.cgi?%7b%22COMMAND%22:%22CLEAN_START%22%7d"
command_off: "curl GET http://HOMBOTIP:HOMBOTPORT/json.cgi?%7b%22COMMAND%22:%22HOMING%22%7d"
command_state: grep -oP '(?<=JSON_ROBOT_STATE=").*(?<=")' /home/pi/Hombot.txt | sed -e 's/^"//' -e 's/"$//'
value_template: '{{ return_value == "WORKING" }}'
friendly_name: LG HomBot
So using command_on and command_off, value_template and “WORKING” as my Hombot returns. I can see the status “WORKING” as a sensor value and also when executing the grep command manually, but the switch never shows “on”, and so switching off is not possible. Any idea what’s wrong?