XKNX

A KNX library written in Python

Introduction

Changelog

XKNX Object

Lights / Dimmer

Cover

Switches

Time

Sensors

Binary Sensors

HVAC

Configuration

Home Assistant Plugin

Sensor - Monitor values of KNX

Overview

Sensors are monitoring temperature, air humidity, pressure etc. from KNX bus.

    sensor = Sensor(
        xknx=xknx,
        name='DiningRoom.Temperature.Sensor',
        group_address_state='6/2/1',
        sync_state=True,
        value_type='temperature'
    )
    await sensor.sync()
    print(sensor)

Configuration via xknx.yaml

Sensor objects are usually configured via xknx.yaml:

    sensor:
        Heating.Valve1: {group_address_state: '2/0/0', value_type: 'percent'}
        Heating.Valve2: {group_address_state: '2/0/1', value_type: 'percent', sync_state: False}
        Kitchen.Temperature: {group_address_state: '2/0/2', value_type: 'temperature'}
        Some.Other.Value: {group_address_state: '2/0/3'}

Interface

sensor = Sensor(
        xknx=xknx,
        name='DiningRoom.Temperature.Sensor',
        group_address_state='6/2/1')

await sensor.sync() # Syncs the state. Tries to read the corresponding value from the bus.

sensor.resolve_state() # Returns the value of in a human readable way

sensor.unit_of_measurement() # returns the unit of the value in a human readable way