Skip to content

bang-olufsen/beoremote-halo

Repository files navigation

Beoremote Halo Open API

build License Version Downloads

The Beoremote Halo Open API is an open source async API that allows you to interact with a Beoremote Halo from a home automation system.

Using a WebSocket to communicate with the Beoremote Halo, it is possible to create a configuration of buttons to interact with your home automation to control your home applications.

Beoremote Halo supports buttons with icons or text for most general home automation applications. You can find a list of the supported icons on our wiki pages. For further details on the Open API list of commands please refer to the API description.

Installation

The Python package beoremote-halo requires Python 3.9 or higher and contains a library for communicating with Beoremote Halo and a CLI tool for discovering Beoremote Halo on the network.

Install using pip:

pip3 install beoremote-halo

Basic Usage

In the following example a client instance connects to Beoremote Halo and listens for events. When a SystemEvent is received the on_system_event callback is executed and prints the Beoremote Halo's system state. Please refer to the API for details on each type of event.

from beoremote import Halo
from beoremote.events import SystemEvent

def on_system_event(client: Halo, event: SystemEvent):
    print(event)


remote = Halo("192.168.1.57")
remote.set_on_system_event_callback(on_system_event)
remote.connect()

Example

Use the beoremote-halo CLI tool to discover and then run a demo by connecting to your Beoremote Halo.

In the above demo the CLI is used to locate Beoremote Halo on the network.

beoremote-halo scan

Afterwards the CLI demo is run by passing the serial number of the discovered Beoremote Halo.

beoremote-halo demo --serial xxxxxxxx

The demo configures the Beoremote Halo and reacts to events received from Halo. The callbacks each handle a specific type of event.

on_system_event is provided but unused in this example.

on_wheel_event changes the indicator ring on the centered/controlled button.

on_button_event changes the active/inactive state of a button, will start/pause/resume the timer if the "Oven Timer" button is pressed.