Documentation ¶
Overview ¶
* API documentation: https://dev.netatmo.com/resources/technical/reference/weatherstation/getstationsdata
Index ¶
- Constants
- func New(b *beat.Beat, cfg *common.Config) (beat.Beater, error)
- type Dashboard_data
- type Device
- type Measure
- type Module
- type ModuleDashboard_data
- type Netatmobeat
- func (bt *Netatmobeat) GetAccessToken() error
- func (bt *Netatmobeat) GetRegionData(region config.Region) error
- func (bt *Netatmobeat) GetStationsData(stationID string) error
- func (bt *Netatmobeat) RefreshAccessToken() error
- func (bt *Netatmobeat) Run(b *beat.Beat) error
- func (bt *Netatmobeat) Stop()
- func (bt *Netatmobeat) TransformPublicData(data PublicData, regionName string, regionDescription string) []common.MapStr
- func (bt *Netatmobeat) TransformStationData(data StationsData) []common.MapStr
- type Place
- type PublicData
- type PublicStation
- type ResponseOauth2Token
- type StationsData
- type User
Constants ¶
const (
UriPathPublicData = "/api/getpublicdata"
)
const (
UriPathStation = "/api/getstationsdata"
)
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Dashboard_data ¶
type Dashboard_data struct { AbsolutePressure float32 `json:"AbsolutePressure"` Time_utc int64 `json:"time_utc"` Noise float32 `json:"Noise"` Temperature float32 `json:"Temperature"` Temp_trend string `json:"temp_trend"` Humidity float32 `json:"Humidity"` Pressure float32 `json:"Pressure"` Pressure_trend string `json:"pressure_trend"` CO2 float32 `json:"CO2"` Date_max_temp int `json:"date_max_temp"` Date_min_temp int `json:"date_min_temp"` Min_temp float32 `json:"min_temp"` Max_temp float32 `json:"max_temp"` }
type Device ¶
type Device struct { Device_id string `json:"_id"` Cipher_id string `json:"cipher_id"` Last_status_store int `json:"last_status_store"` Modules []Module `json:"modules"` Place Place `json:"place"` Station_name string `json:"station_name"` Type string `json:"type"` Dashboard_data Dashboard_data `json:"dashboard_data"` Data_type []string `json:"data_type"` Co2_calibrating bool `json:"co_2_calibrating"` Date_setup int `json:"date_setup"` Last_setup int `json:"last_setup"` Module_name string `json:"module_name"` Firmware int `json:"firmware"` Last_upgrade int `json:"last_upgrade"` Wifi_status int `json:"wifi_status"` }
type Measure ¶
type Measure struct { Res map[string][]float32 `json:"res"` Mes_type []string `json:"type"` Rain_60min float32 `json:"rain_60min"` //"rain_60min": 0 Rain_24h float32 `json:"rain_24h"` //"rain_24h": 1.515 Rain_live float32 `json:"rain_live"` //"rain_live": 0 Rain_timestamp int `json:"rain_timeutc"` //"rain_timeutc": 1504796338 Wind_strength float32 `json:"wind_strength"` //"wind_strength": 18 Wind_angle int `json:"wind_angle"` //"wind_angle": 335 Gust_strength int `json:"gust_strength"` //"gust_strength": 33 Gust_angle int `json:"gust_angle"` //"gust_angle": 341 Wind_timestamp int `json:"wind_timeutc"` //"wind_timeutc": 1504796344 }
type Module ¶
type Module struct { Module_id string `json:"_id"` Type string `json:"type"` Last_message int64 `json:"last_message"` Last_seen int64 `json:"last_seen"` ModuleDashboard_data ModuleDashboard_data `json:"dashboard_data"` Data_type []string `json:"data_type"` Module_name string `json:"module_name"` Last_setup int `json:"last_setup"` Battery_vp int `json:"battery_vp"` Battery_percent int `json:"battery_percent"` Rf_status int `json:"rf_status"` Firmware int `json:"firmware"` }
type ModuleDashboard_data ¶
type ModuleDashboard_data struct { Time_utc int `json:"time_utc"` Temperature float32 `json:"Temperature"` Temp_trend string `json:"temp_trend"` Humidity float32 `json:"Humidity"` Date_max_temp int64 `json:"date_max_temp"` Date_min_temp int64 `json:"date_min_temp"` Min_temp float32 `json:"min_temp"` Max_temp float32 `json:"max_temp"` }
type Netatmobeat ¶
type Netatmobeat struct {
// contains filtered or unexported fields
}
func (*Netatmobeat) GetAccessToken ¶
func (bt *Netatmobeat) GetAccessToken() error
func (*Netatmobeat) GetRegionData ¶
func (bt *Netatmobeat) GetRegionData(region config.Region) error
* access_token yes * lat_ne yes 15 latitude of the north east corner of the requested area. -85 <= lat_ne <= 85 and lat_ne>lat_sw * lon_ne yes 20 Longitude of the north east corner of the requested area. -180 <= lon_ne <= 180 and lon_ne>lon_sw * lat_sw yes -15 latitude of the south west corner of the requested area. -85 <= lat_sw <= 85 * lon_sw yes -20 Longitude of the south west corner of the requested area. -180 <= lon_sw <= 180 * required_data no rain, humidity To filter stations based on relevant measurements you want (e.g. rain will only return stations with rain gauges). Default is no filter. You can find all measurements available on the Thermostat page. * filter no true True to exclude station with abnormal temperature measures. Default is false.
func (*Netatmobeat) GetStationsData ¶
func (bt *Netatmobeat) GetStationsData(stationID string) error
func (*Netatmobeat) RefreshAccessToken ¶
func (bt *Netatmobeat) RefreshAccessToken() error
Endpoint: https://api.netatmo.com/oauth2/token
func (*Netatmobeat) Stop ¶
func (bt *Netatmobeat) Stop()
func (*Netatmobeat) TransformPublicData ¶
func (bt *Netatmobeat) TransformPublicData(data PublicData, regionName string, regionDescription string) []common.MapStr
func (*Netatmobeat) TransformStationData ¶
func (bt *Netatmobeat) TransformStationData(data StationsData) []common.MapStr
type PublicData ¶
type PublicData struct { Stations []PublicStation `json:"body"` Status string `json:"status"` TimeExec float32 `json:"time_exec"` TimeServer int `json:"time_server"` }
type PublicStation ¶
type ResponseOauth2Token ¶
type StationsData ¶
type User ¶
type User struct { Mail string `json:"mail"` Administrative struct { Lang string `json:"lang"` Reg_locale string `json:"reg_locale"` Country string `json:"country"` Unit int `json:"unit"` Windunit int `json:"windunit"` Pressureunit int `json:"pressureunit"` Feel_like_algo int `json:"feel_like_algo"` } }