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.

Revisions

  1. jeroenboumans created this gist Mar 7, 2021.
    19 changes: 19 additions & 0 deletions logger.py
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,19 @@
    #!/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"
    ...
    ]