Skip to content

Instantly share code, notes, and snippets.

@smitmartijn
Created March 6, 2023 16:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save smitmartijn/8fd1006326cc49b26691f71c3b15d46d to your computer and use it in GitHub Desktop.
Save smitmartijn/8fd1006326cc49b26691f71c3b15d46d to your computer and use it in GitHub Desktop.
import asyncio
from Smile import Smile
import json
async def main():
smile = Smile("192.168.0.0", "password")
await smile.connect()
await smile.update_locations()
# Get the current power consumption in watts
current_power = smile.get_power_data_from_location("location-id")
print(json.dumps(current_power))
await smile.close_connection()
if __name__ == '__main__':
loop = asyncio.get_event_loop()
loop.run_until_complete(main())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment