Skip to content

ripienaar/ambientctl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Interact with Ambient Weather weather stations

A small client utility for interacting with the Ambient Weather weather stations.

Tested on a Raspberry PI with Go 1.24

Setup?

Visit the Ambient Weather console API Keys section and create one API key and one Application Key.

You need to either pass those as arguments or set them in the environment variables $AMBIENT_API_KEY and $AMBIENT_APP_KEY.

Usage?

Basic usage information:

$ ambientctl --help
usage: ambientctl [<flags>] <command> [<args> ...]

Interact with Ambient Weather devices

Commands:
  query  Queries devices
  ls     Lists devices

Global Flags:
  --help     Show context-sensitive help
  --version  Show application version.
  --api=KEY  Ambient Weather API Key ($AMBIENT_API_KEY)
  --app=KEY  Ambient Weather Application Key ($AMBIENT_APP_KEY)

Lit all devices in your account:

$ ambientctl ls
Ambient Weather Devices

Device "Talsi":

   Information:

       Last Seen: 1m28s
     MAC Address: 4C:EB:D6:20:XX:XX
        Location: Spāre
         Address: Ģibuļi Parish, Talsi Municipality, Latvia
       Elevation: 36.405
     Coordinates: lon: 22 lat: 57

View details for a specific device:

$ ambientctl query 4C:EB:D6:20:XX:XX
Ambient Weather Device Info

General:

                 Time: 2025-05-28 09:45:00
        Previous Rain: 1d11h35m43s
             Pressure: 29.991 inHg (absolute: 29.805 inHg)

Temperature:

  Outdoor Temperature: 16.611 C (feels like 16.611 C)
    Outdoor Dew Point: 8.311 C
   Indoor Temperature: 21 C (feels like 20.333 C)
     Indoor Dew Point: 8.944 C

Wind:

           Wind Speed: 10.444 Km/h
       Wind Direction: SE / 138 degrees

Rain:

          Hourly Rain: 0 mm
           Daily Rain: 0 mm
          Weekly Rain: 0.787 mm
         Monthly Rain: 0.787 mm
           Total Rain: 0.787 mm

Humidity:

      Indoor Humidity: 46
     Outdoor Humidity: 58

Solar:

            Radiation: 192.95 W/m^2
             UV Index: 1

It supports JSON output:

$ ambientctl query 4C:EB:D6:20:XX:XX --json
{
  "dateutc": 1748414700000,
  "winddir": 138,
  "windspeedmph": 6.49,
  "windgustmph": 8.05,
  "maxdailygust": 9.17,
  "tempf": 61.9,
  "hourlyrainin": 0,
  "dailyrainin": 0,
  "weeklyrainin": 0.031,
  "monthlyrainin": 0.031,
  "totalrainin": 0.031,
  "baromrelin": 29.991,
  "baromabsin": 29.805,
  "humidity": 58,
  "tempinf": 69.8,
  "humidityin": 46,
  "uv": 1,
  "solarradiation": 192.95,
  "feelsLike": 61.9,
  "dewPoint": 46.96,
  "feelsLikein": 68.6,
  "dewPointin": 48.1,
  "lastRain": "2025-05-26T19:12:00Z",
  "tz": "",
  "date": "2025-05-28T06:45:00Z"
}

And also the format required by Choria Metric watchers:

$ ambientctl query 4C:EB:D6:20:XX:XX --choria --label location:talsi
{
  "labels": {
    "location": "talsi"
  },
  "metrics": {
    "dewpoint_indoor_celsius": 48.3,
    "dewpoint_outdoor_celsius": 46.96,
    "feelslike_indoor_celsius": 20.500000000000004,
    "feelslike_outdoor_celsius": 16.88888888888889,
    "humidity_indoor_percent": 46,
    "humidity_outdoor_percent": 57,
    "last_rain_seconds": 128324.325252,
    "pressure_absolute_inhg": 29.811,
    "pressure_inhg": 29.997,
    "rain_daily_mm": 0,
    "rain_hourly_mm": 0,
    "rain_monthly_mm": 0.7874,
    "rain_total_mm": 0.7874,
    "rain_weekly_mm": 0.7874,
    "solar_radiation_watts_sqm": 198.81,
    "temperature_indoor_celsius": 21.11111111111111,
    "temperature_outdoor_celsius": 16.88888888888889,
    "uv_index": 1,
    "wind_direction_degrees": 138,
    "wind_gust_kph": 7.1937498,
    "wind_max_daily_gust_kph": 14.757647799999999,
    "wind_speed_kph": 6.485640200000001
  }
}

Contact?

R.I. Pienaar / rip@devco.net / devco.net

About

Interact with Ambient Weather weather stations

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages