An api interface for WiBeee
Project description
██╗ ██╗██╗██████╗ ███████╗███████╗███████╗
██║ ██║██║██╔══██╗██╔════╝██╔════╝██╔════╝
██║ █╗ ██║██║██████╔╝█████╗ █████╗ █████╗
██║███╗██║██║██╔══██╗██╔══╝ ██╔══╝ ██╔══╝
╚███╔███╔╝██║██████╔╝███████╗███████╗███████╗
╚══╝╚══╝ ╚═╝╚═════╝ ╚══════╝╚══════╝╚══════╝
This is a python API client for WiBeee products. WiBeee client will get live info like Power (W) usage in an easy-to-use python class. Currently, WiBeee is in the early stages and can be improved. If you have any feature requests or optimisations, feel free to set up a pull request or drop me a message.
This project assumes you already have your WiBeee hardware setup.
This project was inspired by pywibeee.
To see code examples checkout examples.py
or scroll down to usages
Projects that use yodas
No open source projects yet! Send me your projects to be featured here.
Install
From PIP
The easiest method of installing is through pip
$ pip install wibeee
or to upgrade
$ pip install --upgrade wibeee
From Git Repository
For this I assume you already have a virtual python environment or that python3 is aliased as python.
$ python -m pip install --upgrade build
$ python -m build
$ pip install dist/*.tar.gz # for the latest version of yodas.
From Releases (latest)
$ wget https://github.com/veryheavypickle/wibeee/releases/download/v1.4.0/wibeee-1.0.2.tar.gz
$ pip install wibeee-1.0.2.tar.gz
Usages
Connecting
If you know the local IP address of your WiBeee device, then you can connect as such.
>>> from wibeee import WiBeee
>>> wb = WiBeee("192.168.1.150")
If you don't know the IP address, don't worry as there is a discovery function and it will connect to the first WiBeee device it finds. This discovery will take a while.
>>> from wibeee import WiBeee
>>> wb = WiBeee()
WiBeee
>>> from wibeee import WiBeee
>>> wb = WiBeee(ip=None, port=80, timeout=10.0, verbose=False)
ip:
str
port:
int
timeout:
float
verbose:
bool
returns:
WiBeee
ip
This is the IP address of the WiBeee device. ip
is not a required variable but providing ip
skips discovery which speeds up the process.
For example WiBeee("192.168.1.150")
or WiBeee(ip="192.168.1.150")
.
port
By default it is 80
, This is the open port of the WiBeee device webserver.
timeout
By default it is 10.0
, This is how many seconds the program waits while attempting to connect to the WiBeee device.
If you wish to change this after creating the WiBeee
object, simply run WiBeee.setTimeout(newValue)
.
verbose
By default it is False
, in my case the WiBeee webserver is highly unreliable. If you want to watch wibeee
solve errors in real time,
either set verbose=True
when creating the WiBeee
object or WiBeee.setVerbose(True)
.
Power
>>> wb.power() # returns the current active power usage in Watts (W)
100.0
This function returns the current power usage. The phase is by default 1
but can be up to 3
.
phase:
int
returns:
float
Current
>>> wb.current() # returns the rms current power usage in Amps (A)
1.0
This function returns the current usage. The phase is by default 1
but can be up to 3
.
phase:
int
returns:
float
Voltage
>>> wb.voltage() # returns the rms volage in Volts (V)
230.0
This function returns the voltage. The phase is by default 1
but can be up to 3
.
phase:
int
returns:
float
Frequency
>>> wb.frequency() # returns the rms volage in Volts (V)
50.0
This function returns the frequency of the AC power. The phase is by default 1
but can be up to 3
.
phase:
int
returns:
float
Information
>>> wb.getInfo() # returns all information the client can currently access
{'model': 'WBB', 'webversion': '4.4.164',... ...., 'ground': '0.00'}
Returns all possible information.
returns:
dict
IP
>>> wb.getIP() # returns the rms volage in Volts (V)
'192.168.1.150'
This function returns the ip address of the WiBeee device.
returns:
str
Changelog
1.1.0 Added documentation.
- Moved
WiBeee.getHost()
toWiBeee.getIP()
- Moved
WiBeee.host
toWiBeee.ip
- Removed
pretty
option inWiBeee.power()
- Moved
WiBeee.callURL()
toWiBeee.__callURL()
- Moved
errors.BadHostName
toerrors.BadIP
- Moved
WiBeee.autoDiscover()
toWiBeee.__findDeviceIP()
- Added variable
attempts
toWiBeee.__findDeviceIP
- Added
WiBeee.setTimeout()
- Added
WiBeee.setVerbose()
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
Built Distribution
File details
Details for the file wibeee-1.1.0.tar.gz
.
File metadata
- Download URL: wibeee-1.1.0.tar.gz
- Upload date:
- Size: 17.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.10.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 125b5e56734edc22548e87d01d1a78313b80e15d3b842097306d75cba0c0cd19 |
|
MD5 | 61f34cd29ee97dd477a2a05f8cd80d09 |
|
BLAKE2b-256 | 131f6df184d2fbc1f4c07f2bac83388bc2300e1a3f973faa1cde45618f933eea |
File details
Details for the file wibeee-1.1.0-py3-none-any.whl
.
File metadata
- Download URL: wibeee-1.1.0-py3-none-any.whl
- Upload date:
- Size: 17.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.10.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 50e1781765b2ea11e9871fe1719e2f21f9f4ec4ac270666fd910af8bade1efb5 |
|
MD5 | cc67eed775cd126296506f60465b1d85 |
|
BLAKE2b-256 | ee5d61491612c69e1c6d763a99388120925a4fa45b6a250bc064ad64a65ec86a |