Skip to main content

python library for accessing the openHAB REST API

Project description

Code Health Codacy badge Documentation Status pypi version

python library for accessing the openHAB REST API

This library allows for easily accessing the openHAB REST API. A number of features are implemented but not all, this is work in progress.


  • python >= 3.5
  • python :: dateutil
  • python :: requests
  • python :: typing

Note on openHAB1:

The current version is focused on OpenHAB 2.x; OpenHAB 1.x might still work, though this is not tested. If you require older OpenHAB support, please use an older version of this library.


Install the latest version using pip:

pip install python-openhab


Example usage of the library:

from openhab import openHAB

base_url = 'http://localhost:8080/rest'
openhab = openHAB(base_url)

# fetch all items
items = openhab.fetch_all_items()

sunset = items.get('Sunset')

# fetch a single item
item = openhab.get_item('light_switch')

# turn a swith on

# send a state update (this only update the state)
item.state = 'OFF'

# send a command

Project details

Download files

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

Filename, size & hash SHA256 hash help File type Python version Upload date
python_openhab-2.9-py3-none-any.whl (12.7 kB) Copy SHA256 hash SHA256 Wheel py3
python-openhab-2.9.tar.gz (6.7 kB) Copy SHA256 hash SHA256 Source None

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page