Skip to main content

Async client and O-Net protocol codec for OASE InScenio FM-Master (EGC / OASE Control) devices

Project description

pyoase

Async Python client and O-Net protocol codec for OASE InScenio FM-Master (Easy Garden Control / "OASE Control") smart garden & pond power controllers.

It talks to the OASE cloud (Azure AD B2C + REST) using just your OASE account email and password, and controls the device by relaying its native O-Net protocol packets through the cloud's SendONetPacket endpoint. This library is the engine behind the OASE Home Assistant integration.

Not affiliated with OASE GmbH. Use at your own risk.

Install

pip install pyoase

Quick start

import asyncio, aiohttp
from pyoase import OaseAuth, OaseCloudClient, onet

async def main():
    async with aiohttp.ClientSession() as session:
        auth = OaseAuth(session, "you@example.com", "your-password")
        client = OaseCloudClient(session, auth)

        inv = await client.async_get_inventory()
        gw = next(g for g in inv.gateways if g.is_fm_master)
        print(gw.sockets)  # SocketsState(socket1=..., dimmer_value=...)

        await client.async_set_socket(gw.id, onet.Socket.SOCKET_1, on=True)
        await client.async_set_dimmer_value(gw.id, 128)

asyncio.run(main())

CLI

export OASE_EMAIL=you@example.com OASE_PASSWORD='...'
python -m pyoase inventory
python -m pyoase set --gateway <gateway-id> --socket 1 --on
python -m pyoase set --gateway <gateway-id> --dimmer 128

How it works

  • Auth — the OASE B2C tenant only exposes the interactive B2C_1A_SignUp_SignIn policy (no password grant), so OaseAuth scripts the browser login flow headlessly (authorize → SelfAsserted → confirmed → token, PKCE S256) and caches the refresh token. See docs/REVERSE_ENGINEERING.md.
  • ReadsGET /User/Inventory returns fully structured state (SocketsState, PumpState), no packet parsing required.
  • WritesPOST /Gateway/{id}/SendONetPacket relays a raw O-Net packet to the gateway. The path parameter is the gateway GUID id (not the serial). onet.py builds the SET_LIVE_SCENE packets; it is a clean-room port of the MIT-licensed ioBroker.oasecontrol codec (see NOTICE).

The onet codec (stdlib-only)

from pyoase import onet
pkt = onet.set_socket_packet(onet.Socket.SOCKET_1, onet.ON)   # bytes ready for SendONetPacket
onet.parse_socket_state(scene_bytes)                          # -> SocketState

onet and the data models import without aiohttp, so the codec can be used standalone.

Development

python -m pytest        # onet golden vectors + model parsing (no network)
ruff check .

License

MIT. The protocol codec is a clean-room reimplementation; see NOTICE.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyoase-0.1.0.tar.gz (51.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pyoase-0.1.0-py3-none-any.whl (28.8 kB view details)

Uploaded Python 3

File details

Details for the file pyoase-0.1.0.tar.gz.

File metadata

  • Download URL: pyoase-0.1.0.tar.gz
  • Upload date:
  • Size: 51.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for pyoase-0.1.0.tar.gz
Algorithm Hash digest
SHA256 6a0f3ecab3e17be549023e07205cb8d7b60c28744dfbcce1c5f6beb1f1293281
MD5 382062d9696aa9dd5fa19b70ba6e16c7
BLAKE2b-256 792d5b0c4c9f7cd0041693a4d916c1d6f12891d5972bb7c2d16b0fb1c17335c4

See more details on using hashes here.

File details

Details for the file pyoase-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: pyoase-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 28.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for pyoase-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e4e3d43fcbec020a486c153123bcc0c0e7e1696643423b6ed560e55d187d8ce9
MD5 e7d8deda4b6833555c619ca80462be7f
BLAKE2b-256 eb8bd823a00952ff611417484188e4442f173d33cfae9c66333a3102c7008eb5

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page