Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API works for an hour then fails #56

Closed
israndy opened this issue Jan 3, 2023 · 1 comment
Closed

API works for an hour then fails #56

israndy opened this issue Jan 3, 2023 · 1 comment

Comments

@israndy
Copy link

israndy commented Jan 3, 2023

To troubleshoot I copied the code from the read me here and wrote this script:

from sense_energy import Senseable
import datetime
from time import sleep
sense = Senseable()
sense.authenticate('israndy@yahoo.com', 'XXX')

def printmsg(msg) :                                        # Timestamped message
    print( " ", datetime.datetime.now().strftime( "%a %I:%M %p" ), msg )
    
while True:
    try:
        sense.update_realtime()
        sense.update_trend_data()
    except :
        printmsg("\033[31mSense Timeout\033[m")
        sleep(120)
        continue
    else :
        print ("Active:", sense.active_power, "W")
        print ("Active Solar:", sense.active_solar_power, "W")
        print ("Daily:", sense.daily_usage, "KWh")
        print ("Daily Solar:", sense.daily_production, "KWh")
        print ("Active Devices:",", ".join(sense.active_devices))
        printmsg('Wait three minutes...')
        sleep(180)

After one hour I get Sense Timeouts until I quit and relaunch the app, identical to how my original code is behaving.

I recently updated my Python but that shouldn't break the API

@kbickar
Copy link
Collaborator

kbickar commented Jan 4, 2023

Duplicate of #55

@kbickar kbickar marked this as a duplicate of #55 Jan 4, 2023
@kbickar kbickar closed this as not planned Won't fix, can't repro, duplicate, stale Jan 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants