Skip to content

[FEATURE] Live data from more than one home #26

@TerjeMyk

Description

@TerjeMyk

Hi

I have 2 home with pulser. I writing a program in python so I can look at the realtime use.

But I only get data from 1 of the homes.

I get:

Connection to websocket failed... Retrying in 10 seconds...
received 4429 (private use) Too many open connections on this server: 2; then sent 4429 (private use) Too many open connections on this server: 2

This is probably me that has tried to mutch.

WHAT IS THE CORRECT WAY TO GET REALTIME DATA FROM MORE THAN 1 HOME?

Here is my code:

import tibber
import init

account = tibber.Account(init.GetTibberKey())
home0 = account.homes[0]
home1 = account.homes[1]

@home0.event("live_measurement")
def show_accumulated_cost(data):
print(f"0 - {data.power} {data.power_production}")

@home1.event("live_measurement")
def show_accumulated_cost1(data):
print(f"1 - {data.power} {data.power_production}")

if name == 'main':
# Start the live feed. This runs forever.
home0.start_live_feed()
home1.start_live_feed()

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestlow priorityThis issue will probably not be looked into for a while

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions