LG HomBot 3.0 (wifi mod) support

Integration for LG HomBot 3.0 vacuum cleaner with wifi mod.

API and all documentation:

Android app source code:

More info: ht tps://docs.google.com/spreadsheets/d/1XrkwcEoUCcH_7AU6FB0oHssCYAulYqaYV6cqU8_O3cc/edit#gid=130369842

HTTP Request:
If you want to send via automation scripts commands directly to the Hombot can (adjust IP address of your Hombots) this conduct HTTP Request

Here is an example of the most common three Views:

Start cleaning:
ht tp://192.168.1.30:6260/json.cgi?%7b%22COMMAND%22:%22CLEAN_START%22%7d
Cleaning pause:
ht tp://192.168.1.30:6260/json.cgi?%7b%22COMMAND%22:%22PAUSE%22%7d
Travel charger:
ht tp://192.168.1.30:6260/json.cgi?%7b%22COMMAND%22:%22HOMING%22%7d

Hello Danny!

You actually do not need a dedicated integration for your HomBot. You can do this with out-of-the-box functionality.

This is what I have:

Sensor for Battery and Status

sensor:

  • platform: command_line
    command: “curl h_ttp://192.168.0.30:6260/status.txt | awk ‘NR==2’ | awk -F’=’ ‘{print $2}’ | awk -F’"’ ‘{print $2}’”
    name: HomBot_Battery
    unit_of_measurement: “%”
  • platform: command_line
    command: “curl h_ttp://192.168.0.30:6260/status.txt | awk ‘NR==1’ | awk -F’=’ ‘{print $2}’ | awk -F’"’ ‘{print $2}’”
    name: HomBot_Status

Switch to control my HomBot

switch:

  • platform: command_line
    switches:
    HomBot_Control:
    oncmd: curl h_ttp://192.168.0.30:6260/json.cgi?%7b%22COMMAND%22:%22CLEAN_START%22%7d
    offcmd: curl h_ttp://192.168.0.30:6260/json.cgi?%7b%22COMMAND%22:%22HOMING%22%7d
    statecmd: curl http://192.168.0.30:6260/status.txt | awk ‘NR==1’ | awk -F’=’ ‘{print $2}’ | awk -F’"’ ‘{print $2}’
    value_template: ‘{{ value == “WORKING” }}’

Grouping it all together

HomBot:
name: Staubsauger
entities:

  • sensor.HomBot_Battery
  • sensor.HomBot_Status
  • switch.HomBot_Control

It’s basic, it’s not perfect, but it works very well. Any other properties of your HomBot (e.g., setting the cleaning mode etc.) can be integrated in a similar way.

Best
Martin

PS: Remove the underscores in the http calls above. The forum does not permit posting links.

1 Like

Thanks, the out of the box code is working very well! :grinning:

Is there more information to see from the LG hombot or commands we can give trough the code?
Example pause?

The Domoticz wiki has a page dedicated to integrating the LG HomBot into Domoticz. That page contains a link to this post (scroll past the quoted text) on a German forum with more commands.

What kink of HomeBot do you have and have you patched the OS?

It would still be nice to integrate the LG homebot into the newish https://home-assistant.io/components/vacuum/ component.

1 Like

Thanks for your sharing
Unfortunately I am not able to make the code work.
I get stuck with this error “utf-8’ codec can’t decode byte 0x93 in position 1304: invalid start byte”.
It has to do with some kind of charcters that are not properly encoded, but I do not understand what is wrong.
The .txt file is the one i get from http://my.local.ip:6260/status.txt and it looks fine.

Where am I going wrong?

Thanks,
Andrea

The command I use is slightly different (note the backslash);

command: "curl http://192.168.5.3:6260/status.txt | awk 'NR==2' | awk -F'=' '{print $2}' | awk -F'\"' '{print $2}'"

Great!
Many thanks.
It worked perfectly…
From m_kloeckner config I had to change from unit_of_measurement: “%” to unit_of_measurement: ‘%’
I finally have my homebot sensors working.

Unfortunately I am still not able to make the switches work.
thins is my config in switches.yaml
:

  • platform: command_line
    switches:
    HomBot_Control:
    command_on: “curl h_ttp://192.168.1.33:6260/json.cgi?%7b%22COMMAND%22:%22CLEAN_START%22%7d”
    command_off: “curl h_ttp://192.168.1.33:6260/json.cgi?%7b%22COMMAND%22:%22HOMING%22%7d”
    command_state: “curl h_ttp://192.168.1.33:6260/status.txt | awk ‘NR==1’ | awk -F’=’ ‘{print $2}’ | awk -F’”’ ‘{print $2}’"
    value_template: ‘{{ value == “WORKING” }}’

and this is the error I get:

Testing configuration at /home/homeassistant/.homeassistant
ERROR:homeassistant.config:Invalid config for [switch.command_line]: [HomBot_Control] is an invalid option for [switch.command_line]. Check: switch.command_line->switches->HomBot_Control. (See ?, line ?). Please check the docs at h_ttps://home-assistant.io/components/switch.command_line/
Failed config
switch.command_line:
platform: command_line
friendly_name: HomBot
switches: [source /home/homeassistant/.homeassistant/switches.yaml:14]
HomBot_Control: [source /home/homeassistant/.homeassistant/switches.yaml:15]
command_off: curl h_ttp://192.168.1.33:6260/json.cgi?%7b%22COMMAND%22:%22HOMING%22%7d
command_on: curl h_ttp://192.168.1.33:6260/json.cgi?%7b%22COMMAND%22:%22CLEAN_START%22%7d
command_state: curl h_ttp://192.168.1.33:6260/status.txt | awk ‘NR==1’ | awk -F’=’ ‘{print $2}’ | awk -F’"’ ‘{print $2}’
value_template: {{ value == “WORKING” }}

Successful config (partial)
switch.command_line:

( I have changed http in h_ttp for posting limitations)

Any suggestion?
Thanks again

Solved!
It was just a matter of changing from

platform: command_line
switches:
HomBot_Control:

to

platform: command_line
switches:
hombot:

no uppercase, no underscore

Everyone above, thanks for all your support, after a lot of struggle with the HACS integration this method is what actually worked. I’m pretty sure I’m not the last one to want to integrate a hombot to HA so I’ll leave the config that worked for me - had to update a few things.

Into configuration.yaml:

sensor:

  • platform: command_line
    command: “curl h_ttp://192.168.1.x:6260/status.txt | awk ‘NR==2’ | awk -F’=’ ‘{print $2}’ | awk -F’”’ ‘{print $2}’"
    name: HomBot_Battery
    unit_of_measurement: ‘%’
  • platform: command_line
    command: “curl h_ttp://192.168.1.x:6260/status.txt | awk ‘NR==1’ | awk -F’=’ ‘{print $2}’ | awk -F’”’ ‘{print $2}’"
    name: HomBot_Status

switch:

  • platform: command_line
    switches:
    hombot:
    command_on: curl h_ttp://192.168.1.x:6260/json.cgi?%7b%22COMMAND%22:%22CLEAN_START%22%7d
    command_off: curl h_ttp://192.168.1.x:6260/json.cgi?%7b%22COMMAND%22:%22HOMING%22%7d
    command_state: curl h_ttp://192.168.1.x:6260/status.txt | awk ‘NR==1’ | awk -F’=’ ‘{print $2}’ | awk -F’"’ ‘{print $2}’
    value_template: ‘{{ value == “WORKING” }}’
    friendly_name: HomBot Switch

p.s.: sorry for bringing such an old topic back - I would have been happy to ‘just find’ the working, up to date script here :slight_smile:

1 Like

HACS also has an custom integration.