/pyXcomfort

Python library for controlling Moeller Eaton Xcomfort lights.

Primary LanguagePythonGNU General Public License v3.0GPL-3.0

pyXcomfort

Tests Coverage Status Known Vulnerabilities

This is an unofficial Python library for controlling Moeller Eaton Xcomfort lights. It requires the Xcomfort CRSZ-00/01 RS-232 programming interface.

This repository is not associated with Moeller Eaton, Home Assistant or other integrations.

If you are running Home Assistant Supervisor you can use the XComfort HA Addon

How to use

git clone git@github.com:olekenneth/pyXcomfort.git xcomfort

Callback when a specific light changes

from xcomfort.xcomfort import Xcomfort

xcomfort = Xcomfort(devicePath='/dev/ttyUSB0')
xcomfort.lights = [{ serial: 2118491, name: 'Plafond' }, ... ]

def lightChangeCallback(light):
  print(light.name + ' changed state to ' + str(light.state))

light = xcomfort.lights[0]
light.onChange(lightChangeCallback)
light.state = False   # turn off the light
light.brightness = 25 # turn light on and set brightness to 25%

Callback when one of the lights change

xcomfort.onLight(lightChangeCallback)

Contribute

Please contribute.

License

GPLv3 see LICENSE