Skip to main content

A package to interact with the OPUS greenNet API

Project description

OPUS greenNet python API wrapper

Disclaimer: This is my first ever published libary for python so it might be messy and i would not recommend using it for things that have to work reliably. However if you want to build your own libary or help me making mine better take a look at the last section of the readme where you can find some more information about the API behind the project.

Supported Devices

Switch

Monetoring

  • OPUS smoke detector
  • OPUS door/window contact
  • Any Motion sensor
  • Any Water detector
  • Any Handle sensor
  • Any Temperature / Heat sensor

Usage

Setup:

# import the libary
import opus_greennet

# create the Auth object to authenticate with the API
# the password can be found on a sticker on your gateway
auth = Auth('http://IP_OF_YOUR_GATEWAY:8080', 'PASSWORD_OF_YOUR_GATEWAY')

# create the OPUS object and pass the auth
opus = OPUSAPI(auth)

Print all switches to the console

# get all onechannel switches
# other types: two_channel_switches, blind_switches, dimming_switches
one_channel_switches = opus.get_one_channel_switches()

# print information for every switch
for switch in one_channel_switches:
  # available propertys: name, id, state, location, manufacturer, productId 
  # for two channel switches you have state_1 and state_2 instead of state
  print(f"{switch.name} with ID '{switch.id} is located at {switch.location} with state {switch.state}")

change the state of a device

# change the state of the first switch in list using change_state
one_channel_switches[0].change_state(True)

# for two channel switches you have to use change_state_1 and change_state_2 instead of change_state
# for dimmers and blinds the state is represented in integers from 0-100 instead of bools

Some info about the API

The REST API is exposed by the OPUS SmartHome Gateway at port 8080. There you will also find a UI where you can test and discover the API. To access the API you have to authenticate yourself.

  • Username: "admin"
  • Password: on a sticker on the OPUS SmartHome Gateway. (8 characters long and consists of capital letters and numbers e.g. "GBA7VD3G")

Screenshot_20220107_153159 The UI should look like this

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

opus-greennet-0.0.2.tar.gz (4.9 kB view hashes)

Uploaded Source

Built Distribution

opus_greennet-0.0.2-py3-none-any.whl (7.9 kB view hashes)

Uploaded Python 3

Supported by

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