Opus Greennet 0.0.2 | Coderz Repository

opus-greennet 0.0.2

Last updated:

0 purchases

opus-greennet 0.0.2 Image
opus-greennet 0.0.2 Images

Free

Languages

Categories

Add to Cart

Description:

opusgreennet 0.0.2

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

OPUS BRiDGE 1 Channel
OPUS BRiDGE 2 Channel
OPUS BRiDGE Roller shutter / Venetian blind
OPUS BRIDGE Universaldimmer
OPUS BRiDGE 1 channel, 16A
OPUS actuator "Professional" round

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")


The UI should look like this

License:

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Files In This Product: (if this is empty don't purchase this product)

Customer Reviews

There are no reviews.