Ambient Temperature PVoutput - SBFspot/SBFspot GitHub Wiki

HowTo add Ambient Temperature to your PVoutput.org graphs

WUnderground Logo

❗️ New users can't get an API key for free anymore. This is what they say about it:

To improve our services and enhance our relationship with our users, we will no longer provide free weather API keys as part of our program.

I will see how we can manage to use https://openweathermap.org

If you still have an API key, it still should work.
But then you probably know how to configure it.


Adding a Wunderground weather station enables live temperature data to be combined with your live generation or consumption data.

Details

  • Create an account at http://www.wunderground.com (Free membership)
  • Edit your system in PVoutput.org (Settings/Edit)
  • In the "Automatic Uploads" section, select primary device = "Weather"
  • Select a nearby weather station
  • Copy/Paste your Weather API key from your wunderground account
  • Configure SBFspot

Example

AutoTempUpload

SBFspot configuration

By default, SBFspot uploads the inverter temperature (V5) to PVoutput. To visualize the ambient temperature, you need to modify the view used for PVoutput data upload.

Depending on the database you've chosen (SQLite or MySQL) you must first connect to your DB to make the change.

By default, the V5 and V6 columns return the system temperature and Uac1 - AC Value (from vwAvgSpotData view). If you want to replace the V5 value by the one collected from weather service (in this case WUnderground), avoid sending the inverter temperature by setting V5 to NULL.

SQLite_logo_small

SQLite doesn't support the "ALTER" command, so delete it first:

DROP VIEW IF EXISTS vwPvoData;

Then, recreate it:

CREATE VIEW vwPvoData AS
    SELECT dd.Timestamp, dd.Name, dd.Type, dd.Serial,  
        dd.TotalYield AS V1,
        dd.Power AS V2,  
        cons.EnergyUsed AS V3,
        cons.PowerUsed AS V4,  
        NULL AS V5,  
        spot.Uac1 AS V6,  
        NULL AS V7,
        NULL AS V8,
        NULL AS V9,  
        NULL AS V10,
        NULL AS V11,
        NULL AS V12,  
        dd.PVoutput  
    FROM vwDayData AS dd  
    LEFT JOIN vwAvgSpotData AS spot ON dd.Serial = spot.Serial AND dd.Timestamp = spot.Nearest5min  
    LEFT JOIN vwAvgConsumption AS cons ON dd.Timestamp = cons.Nearest5min  
    ORDER BY dd.Timestamp DESC;

MySQL_logo_small

ALTER VIEW vwPvoData AS
    SELECT dd.Timestamp, dd.Name, dd.Type, dd.Serial,
        dd.TotalYield AS V1,
        dd.Power AS V2,
        cons.EnergyUsed AS V3,
        cons.PowerUsed AS V4, 
        NULL AS V5,
        spot.Uac1 AS V6,
        NULL AS V7,
        NULL AS V8,
        NULL AS V9,
        NULL AS V10,
        NULL AS V11,
        NULL AS V12,
        dd.PVoutput
    FROM vwDayData AS dd
    LEFT JOIN vwAvgSpotData AS spot ON dd.Serial = spot.Serial AND dd.Timestamp = spot.Nearest5min
    LEFT JOIN vwAvgConsumption AS cons ON dd.Timestamp = cons.Nearest5min
    ORDER BY dd.Timestamp DESC;

:exclamation: If you omit this configuration step, you can see some strange effects:

pvo_temperature_issue

:book: Read also the "Tweaking" section in the Installation Linux SQLite

:exclamation: If you have more than one system defined, be sure to create an API key for each system. If you use the same key for different systems, you will exceed the 500 requests per day limit of Wunderground, especially when your systems are set up for 5 minutes interval.