Giter Site home page Giter Site logo

openhab-sucks's Introduction

openhab-sucks

My attempt at monitor and control Ecovacs Deebot vacuum cleaners from OpenHAB, via MQTT.

At the core, the great sucks library by @wpietri.

Installation

  1. Follow the instructions at https://github.com/wpietri/sucks, basically:

pip install sucks

  1. Run sucks login, in order to generate the necesary sucks.conf config file.

  2. PLEASE TEST that you can run sucks correctly. Play with sucks clean 1, sucks stop.

Only continue if you are sure that sucks it's running fine. If not please go to the great sucks community and ask for help.

  1. Install dependencies

pip install paho-mqtt

  1. If and only if (3) it's ok: Clone this repo and run ecovacs-mqtt-gateway.py

Run it with python3.

It should remain running in the background, for that, I recommend Supervisor

There is a provided supervisord ecovacs.ini example.

Concept

I'm using sucks library to connect to the Ecovacs system and monitor for status and activity. At startup and whenever a status change is detected, it publishes the values to the mqtt broker Eclipse Mosquitto. It also listen for mqtt control messages to send commands to the vacuum cleaners.

I use MQTT for all my IoT/Sensors communications to OpenHAB and strongly recommend everybody to do so.

MQTT it's standard, lightewight, easy to deploy, easy to monitor from any device, and gives the possibility of isolate devices from the home automation controller with a simple standard layer of abstraction.

If you are an OpenHAB user, you can use the provided ecovacs.things, ecovacs.items and ecovacs.sitemap to show the status of your robots and/or control them.

If you are not an OpenHAB user, no matter how wrong you are, you can monitor and command via mqtt topics using your preferred software.

Features

Monitor

This gateway, when running, will listen from sucks events and update the following mqtt topics:

ecovacs/{did}/battery_level
ecovacs/{did}/battery_status
ecovacs/{did}/clean_status
ecovacs/{did}/vacuum_status
ecovacs/{did}/fan_speed
ecovacs/{did}/components/main_brush
ecovacs/{did}/components/side_brush
ecovacs/{did}/components/filter

Note:

{did} its the Device Id. It's something like E0000626317798704736. You can get it by running ecovacs-mqtt-gateway.py and it will show on the first line. Or you can also get it running sucks --debug stop, and it will be in a line like this:

sucks DEBUG got {'todo': 'result', 'result': 'ok', 'devices': [{'did': 'E0000693437743404736', 'name ...

Example:

ecovacs/E0345693817701104736/battery_level

Keep in mind that this is simply a convention by me. This will be useful if in the future I decide to support more than one robot. If you understand this you can use anything you want in {did}, even something more human friendly like /my_vacuum_cleaner/

So from this on, you can use your usual mqtt consuming software to keep yourself posted of the Ecovacs whereabouts.

I use and recommend OpenHAB.

Control

To control the vacuum cleaner via mqtt you have to publish 0 for auto, 2 for charge, 1 for stop or 3 for playsound message to the following topic:

ecovacs/{did}/command

Note:

I recommmend MQTT.fx to monitor mqtt activity and do the troubleshooting.

To do - Next steps

  • Move some harcoded config (mqtt base topic, server, port) to some config file.
  • Error handling. Stuck here because sucks library it's giving me errors when I force errors. At least the most usual, like stuck robot. Is there a warning when it runs out of batteries returning?
  • Test for stability on the mqtt connection. Reconnect if necessary.
  • Test for stability in general. Monitor memory usage.
  • (mine) Apply some logic with presence and automate ecovacs run daily.
  • Adhere to Homie convention
  • Add control buttons on OpenHAB sitemap. Done!
  • Adapt to new OpenHAB 2.4 MQTT binding

Contact

Feel free to send push requests or drop me a line at: gschimmel at gmail dot com.

openhab-sucks's People

Contributors

guillebot avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.