mardi 8 novembre 2022

Checking Measurement Data Error - 'If only Constants arrive'

Example:

If the Photovoltaik Number is constant over a certain period, there is something wrong, because Solar Power Irradation fluctuats alot. So One should want to recognize this bevarioul pattern to e.g. restart the system.

old_pv = []

while True:

    
    try:
        count = 1
        sunny_scraper.driver.current_url
        new_pv = sunny_scraper.scrape()
        old_pv.append(new_pv)
        count += 1
        if count in [19, 20]:
            if len(list(set(old_pv))) == 1:
                sunny_scraper.start_browser()
                sunny_scraper.accept_cookies()
                sunny_scraper.enter_email_password()
                new_pv = sunny_scraper.scrape()
                time.sleep(5)
                old_pv = []
                old_pv.append(new_pv)
        else:
            time.sleep(10)
    except:
        time.sleep(120)
        sunny_scraper.start_browser()
        sunny_scraper.accept_cookies()
        sunny_scraper.enter_email_password()
        sunny_scraper.scrape()
        time.sleep(10)

pv - Photovoltaic (solar power)

the pv value is scraped in high resolution (~ 10s), I work in Solar Industrie for Power Prediction using All Sky Imager. Sometimes the value freezes (reason unclear), so restarting the script is the current idea.

What other implementation options would be conceivable and useful? I would be happy for inspiration.

ERROR EXAMPLE




Aucun commentaire:

Enregistrer un commentaire