Download the PHP package oriceon/mammotion without Composer

On this page you can find all versions of the php package oriceon/mammotion. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package mammotion

Mammotion for Laravel

Laravel client for the Mammotion Open API — list your Luba / Yuka robot mowers, read what they are doing right now, send work commands and subscribe to live telemetry.

Requirements

Installation

The service provider and the Mammotion alias are auto-discovered. Publish the config if you need to change it:

Configuration

Only the credentials are mandatory:

Everything else has a sane default and can be overridden through config/mammotion.php or the environment:

Key Env Default Meaning
auth_url MAMMOTION_AUTH_URL https://id.mammotion.com OAuth2 server that issues the access token
api_url MAMMOTION_API_URL https://api-open.mammotion.com API server
language MAMMOTION_LANGUAGE en-US Sent as Accept-Language
timeout MAMMOTION_TIMEOUT 15 HTTP timeout, in seconds
token_leeway MAMMOTION_TOKEN_LEEWAY 60 Safety margin shaved off expires_in when caching the token
cache.store MAMMOTION_CACHE_STORE app default Cache store holding the tokens
cache.prefix MAMMOTION_CACHE_PREFIX mammotion Cache key prefix

Authentication

Authentication is client_credentials and is handled for you: every call fetches the token if needed, caches it until shortly before it expires (as Mammotion asks integrators to do) and, on a 401, re-authenticates and retries the request exactly once. A refresh_token, when the server returns one, is preferred over a new client_credentials exchange.

You never need to call it explicitly, but it is available:

Usage

Resolve the client however you prefer — facade, container, or a plain instance with explicit credentials:

Devices

What the mower is doing right now

Two limitations belong to the Mammotion API, not to this package:

  1. REST does not expose which task or area is running, nor the progress percentage. Mammotion::tasks($id) only lists the tasks defined in the app, without marking the active one.
  2. work-params is asynchronous despite its name. The first GET merely asks the mower to report; the immediate response is often just {"commandResult": true, "resultMessage": "Command has been sent", …} with every value at 0.

The package never turns those zeros into settings. When it happens, settings stays empty and workParamsPending is true. To tell the two apart yourself:

Live progress, track and coordinates arrive exclusively through the SSE push channel — see Telemetry.

Commands

Mammotion::taskNames('DEV-1') returns the names accepted by start().

Telemetry

Subscribing tells the Mammotion server to push updates over its SSE channel. A subscription expires after 10 minutes and has to be renewed; the API accepts at most 20 devices per request.

Enums

Enum Covers
MammotionActionEnum commands accepted by POST /v1/mower/action
MammotionDeviceStatusEnum mower states, mapped case-insensitively
MammotionJobContentEnum operating mode (mowing / collecting / both)
MammotionSubscriptionPropertyEnum telemetry property keys

Every case exposes a translated label(). Translations ship for en and ro; publish them to add your own locale.

Error handling

Both transport failures (HTTP != 2xx) and application errors (code other than 0 / 200 in the response envelope) raise MammotionApiException:

A missing or empty credential pair raises MammotionConfigurationException at build time.

Testing

The package is covered by Pest, and every HTTP call goes through Laravel's HTTP client — so Http::fake() is all you need in your own tests:

License

MIT. See LICENSE.md.


All versions of mammotion with dependencies

PHP Build Version
Package Version
Requires php Version ^8.5
illuminate/contracts Version ^13.0
illuminate/http Version ^13.0
illuminate/support Version ^13.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package oriceon/mammotion contains the following files

Loading the files please wait ...