Skip to content

Cannot flexmeasures weather get-weather-forecasts using asset-id <n> #6

@beralt85

Description

@beralt85

Description

Using flexmeasures weather register-weather-sensor I created a weather station with asset id 16 and a couple of sensors:

$ flexmeasures show asset --id 16
=====================================================
Asset weather station (created by FM-Weather) (ID: 16)
=====================================================

Type             Location          Flex-Context    Sensors to show    Attributes
---------------  ----------------  --------------  -----------------  ------------
weather station  (<redacted>, <redacted>)

================================================================
Child assets of weather station (created by FM-Weather) (ID: 16)
================================================================

No children assets ...

All sensors in asset:
 
  ID  Name         Unit    Resolution    Timezone    Attributes
----  -----------  ------  ------------  ----------  -------------------------
  12  cloud cover  %       an hour       UTC         daily_seasonality: True
                                                     weekly_seasonality: False
                                                     yearly_seasonality: True
  13  irradiance   W/m²    an hour       UTC         daily_seasonality: True
                                                     weekly_seasonality: False
                                                     yearly_seasonality: True
  11  temperature  °C      an hour       UTC         daily_seasonality: True
                                                     weekly_seasonality: False
                                                     yearly_seasonality: True
  10  wind speed   m/s     an hour       UTC         daily_seasonality: True
                                                     weekly_seasonality: False
                                                     yearly_seasonality: True

When trying to get the weather forecasts by specifying the asset id, I get an error

$ flexmeasures weather get-weather-forecasts --asset-id 16

[FLEXMEASURES] Task get-weather-forecasts encountered a problem: "'NoneType' object has no attribute 'generic_asset_type'". More details: {'src_module': '/app/instance/flexmeasures-weather/flexmeasures_weather/utils/locating.py', 'src_linenr': 120, 'src_func': 'get_location_by_asset_id', 'src_code': 'if asset.generic_asset_type.name != WEATHER_STATION_TYPE_NAME:'}
[FLEXMEASURES] Reported task get-weather-forecasts status as False

In contrast, retrieving weather forecasts by location works as expected.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions