Skip to main content

pyechorobotics

Echorobotics Logo

Allows control and reads status of robot lawn mowers by echorobotics.

Used by Home Assistant Echorobotics integration.

Example:

import sys

import echoroboticsapi
import aiohttp
import asyncio
import logging


async def main():
    async with aiohttp.ClientSession() as session:
        api = echoroboticsapi.Api(session, robot_ids=["your-robot-id"], email="your-email", password="your-password")
        print(await api.last_statuses())
        print(await api.set_mode("chargeAndWork"))


if __name__ == "__main__":
    logging.basicConfig(stream=sys.stdout, level=logging.DEBUG)
    loop = asyncio.new_event_loop()
    loop.run_until_complete(main())

Unfortunately, the API doesn't tell is which mode ("chargeAndWork", "work" or "chargeAndStay") the robot is in. We can make an educated guess though, depending on what we set ourselves, history events and the status. This is what SmartMode does:

import sys

import echoroboticsapi
import aiohttp
import asyncio
import logging


async def main():
    async with aiohttp.ClientSession() as session:
        api = echoroboticsapi.Api(session, robot_ids=["your-robot-id"], email="your-email", password="your-password")
        smartmode = echoroboticsapi.SmartMode("your-robot-id")
        api.register_smart_mode(smartmode)
        
        print(await api.history_list())
        print(await api.last_statuses())
        print(smartmode.get_robot_mode())


if __name__ == "__main__":
    logging.basicConfig(stream=sys.stdout, level=logging.DEBUG)
    loop = asyncio.new_event_loop()
    loop.run_until_complete(main())

See also src/main.py

SmartFetch

While calling last_statuses() and history_list() regularly (suggestion every 2min and 15min), this is somewhat wasteful of bandwidth. Especially history_list() uses some 60KiB of data volume. If calling this every 15mins is an issue for you, you may be interested in SmartFetch.

import sys

import echoroboticsapi
import aiohttp
import asyncio
import logging


async def main():
    async with aiohttp.ClientSession() as session:
        api = echoroboticsapi.Api(session, robot_ids=["your-robot-id"], email="your-email", password="your-password")
        smartmode = echoroboticsapi.SmartMode("your-robot-id")
        api.register_smart_mode(smartmode)
        smartfetch = echoroboticsapi.SmartFetch(api)
        
        last_statuses = await smartfetch.smart_fetch()
        print(last_statuses)
        print(smartmode.get_robot_mode())


if __name__ == "__main__":
    logging.basicConfig(stream=sys.stdout, level=logging.DEBUG)
    loop = asyncio.new_event_loop()
    loop.run_until_complete(main())

Dev notes

To make a new release, use GitHub website and draft a release manually. Make sure the version number in pyproject.toml matches the new tag. GitHub Actions will publish it to pypi.

Adding a new state

If a new state is found, it must be added to models.py. Also check notify_laststatuses_received() in smart_mode.py if it should be recognized as a specific Mode.

Finally, in home-assistant-echorobotics-integration, increment the version number in the manifest.json. Also check the translations in echorobotics/translations, and any custom dashboard code.

Release files for pyechorobotics 2.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pyechorobotics 2.0.0
File Size Uploaded
pyechorobotics-2.0.0.tar.gz 28.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pyechorobotics 2.0.0
File Interpreter ABI Platform
pyechorobotics-2.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 52.2 kB

Release files / pyechorobotics-2.0.0.tar.gz

Download URL pyechorobotics-2.0.0.tar.gz
Size 28.4 kB
Tags Source
SHA-256 checksum
How to use checksums
c69bc6ff0598d80e9cc87846fa00b10547198771cf725f41a83f96dd62864fe1
BLAKE2b-256 checksum
How to use checksums
f29c9b0326c522b3062912849fa372074b15fae82f2e274e82f61999d89fe719
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.25

Release files / pyechorobotics-2.0.0-py3-none-any.whl

Download URL pyechorobotics-2.0.0-py3-none-any.whl
Size 23.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e52963f9a48c34e51050207cf04fce4f29a1f4e1946ec8b4d3eb5aeb1610afdc
BLAKE2b-256 checksum
How to use checksums
f3c8c8867043197d6b2158fba739dd125fdd838fc9ba0ca3800d0b60cac11bb0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.25
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page