Skip to content

A simple program for periodically GET-ing from an API and dumping the output into a datastore. For now, InfluxDB.

License

Notifications You must be signed in to change notification settings

kloodz-mrioux/polly

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

polly

A simple Go module for periodically GET-ing from an API (For now, a Tesla Gen 3 Wall Connector) and dumping the output into a datastore (for now, InfluxDB).

Prerequisites

Note: these prerequisites will be reduced if and when I genericize this tool.

  • You will need a local instance of InfluxDB running on localhost:8086 with a database called tesla that has no auth.
  • You will need a Tesla HPWC Gen3 installed, provisioned, and joined to your home (or business) wifi.
  • You will need to be able to reach the HPWC from whatever computer you run this code on.

Using polly

polly is a Go module. You need to import it into your Go code to use it. polly's only input is the environment variable HPWC_IP, which you will need to have set in the environment where it is called.

Here's a quick example of how you can run a very simple program using the polly package:

package main

import "github.com/averysmalldog/polly"

func main() {
	polly.Execute()
}

If you were to save that as main.go, you would then follow these steps to get things working:

  1. Set the environment HPWC_IP to be the IP address of your Tesla Gen 3 Wall Connector, e.g. export HPWC_IP="192.168.1.10".
  2. Run it, e.g. go run main.go.

You will see one dot for each successful GET against the Wall Connector, as you can see in the example below.

% go run main.go
...........

If polly can't reach your Gen 3 Wall Connector, you'll get this error for each time the GET fails:

error - during GET of hpwc. Do you have the right IP?

About

A simple program for periodically GET-ing from an API and dumping the output into a datastore. For now, InfluxDB.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Go 100.0%