Skip to content

Add current outside temperature and humidity to an InfluxDB database. Written in Go.

License

Notifications You must be signed in to change notification settings

chalverson/weathertoinflux

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Simple utility to add current temperature and humidity to an existing SmartThings Influx database so that I can overlay outside info with the inside info. This utilizes the ST database structure that is outlined here

Uses:

https://github.com/influxdata/influxdb/tree/master/client

https://github.com/briandowns/openweathermap

You will need an Open Weathermap API key.

Create a config file in ~/.weathertoinflux called weathertoinflux.yml and make it look like:

#
# Make the cities fields strings (ie. put them in quotes). It's too variable to parse otherwise.
#
openweather:
  apiKey: YOUR_KEY_HERE
  cities:
    - type: "id"
      id: "5039080"
      label: "Outside"
    - type: "latlon"
      lat: "10.1735"
      lon: "-84.733"
      label: "San Buenas"
    - type: "zip"
      zip: "50533"
      countryCode: "US"
      label: "Eagle Grove"

db:
  address: http://localhost:8086
  name: SmartThings
  username: username
  password: password

Obviously change things as needed. The cities array can be any mix of things, just make them all strings, I'm converting in the code. It's just easier to do it that way and I don't want to complicate this any more than is needed for a quick and dirty utility.

This puts the data into a InfluxDB database that also aggregates some SmartThings data, therefore the fields and such are already defined for the thermostats. In particular:

  • Series name: temperature

    • tagKey

      • deviceId
      • deviceName
      • groupId
      • groupName
      • hubId
      • hubName
      • locationId
      • locationName
      • unit
    • fieldKey

      • value: float
  • Series name: humidity

    • tagKey

      • deviceId
      • deviceName
      • groupId
      • groupName
      • hubId
      • hubName
      • locationId
      • locationName
      • unit
    • fieldKey

      • value: float

About

Add current outside temperature and humidity to an InfluxDB database. Written in Go.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages