Create weather metric


First, create weather stations by triggering the creation job with:

// create weather stations
var job = Location.refreshWeatherStations();
c3Grid(WeatherStationCreator.fetch({filter: Filter.eq('id',}))
// once job completed and weather stations created, fetch weather data

Check the weather data with a metric of the sort:

var sm = SimpleMetric.make({
    "id": "AverageDailyTemp_Facility",
    "name": "AverageDailyTemp",
    "srcType": "Facility",
    "path": "placedAt.weatherStation",
    "expression": "avg(avg(",
    "unit": {
      "id": "degrees_fahrenheit"
  ids: ['0082'],
  expressions: ['AverageDailyTemp'],
  start: '2018-10-01',
  end: '2018-11-31',
  interval: 'DAY'

To debug issues related to temperature data, check this thread WeatherDataUpdater debug