Skip to content

Instantly share code, notes, and snippets.

@jeroenboumans
Created March 7, 2021 16:34
Show Gist options
  • Select an option

  • Save jeroenboumans/decd031b8211aee0480120d3c078c2ea to your computer and use it in GitHub Desktop.

Select an option

Save jeroenboumans/decd031b8211aee0480120d3c078c2ea to your computer and use it in GitHub Desktop.
#!/usr/bin/env python
import time
import asyncws
import asyncio
import threading
import json
token = HASS_IO_AUTHORIZATION_TOKEN # fill in your token
host = HASS_IO_HOSTNAME_OR_URL # fill in your Home Assistant IP-address or domain
port = 8123
cache = {}
entities = [
"sensor.power_tariff",
"sensor.power_consumption_watt",
"sensor.gas_consumption"
...
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment