Light weight python package to interface with EnergyID webhooks
Project description
energyid-webhooks-py
Light weight Python package to interface with EnergyID Webhooks
Installation
pip install energyid-webhooks
Usage
Get your URL at https://app.energyid.eu/integrations/WebhookIn
from energyid_webhooks import WebhookClient
url = "https://app.energyid.eu/integrations/WebhookIn/..."
client = WebhookClient(url)
# Get some information about the webhook
print(client.get())
# Post some data to the webhook
data = {
'remoteId': 'my-solar-inverter',
'remoteName': 'My Solar Panels',
'metric': 'solarPhotovoltaicProduction',
'metricKind': 'total',
'unit': 'kWh',
'interval': 'P1D',
'data': [['2022-10-05T08:00+0200', 0.004]]
}
client.post(data)
Async usage
import asyncio
from energyid_webhooks import WebhookClientAsync
url = "https://app.energyid.eu/integrations/WebhookIn/..."
client = WebhookClientAsync(url)
async def main():
# Get some information about the webhook
print(await client.get())
# Post some data to the webhook
data = {
'remoteId': 'my-solar-inverter',
'remoteName': 'My Solar Panels',
'metric': 'solarPhotovoltaicProduction',
'metricKind': 'total',
'unit': 'kWh',
'interval': 'P1D',
'data': [['2022-10-05T08:00+0200', 0.004]]
}
await client.post(data)
asyncio.run(main())
Demo Notebook
See demo.ipynb for a demo notebook.
Development
Setup
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt
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
Close
Hashes for energyid_webhooks-0.0.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d7b3477a675de88f0bfd327522b8d894bc095b5a97e50a292c6e9d246a91c254 |
|
MD5 | 2027d2ee262ba7a67ed24695670c5303 |
|
BLAKE2b-256 | 2f7c096110a9e0da82ebd2e3f88a89ae57eff071432176af3570beac4fe1d1de |