Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

SDK to access Autogrow hardware and services programmatically

License

NotificationsYou must be signed in to change notification settings

autogrow/go-jelly

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

42 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SDK for Autogrow devices and associated integrations.

Traditionally agricultural providers utilise proprietary products and services which leave little flexibility for the growers to create their own solutions or connect them with existing infrastructure. This SDK is a work in progress and aims to provide customers with programmatic access to Autogrow devices.

Installation

Install as you would any go library:

go get github.com/AutogrowSystems/go-jelly

Usage

IntelliGrow

IntelliDoses and IntelliClimates are supported via the IntelliGrow API when used in conjuction with an IntelliLink.

import"github.com/AutogrowSystems/go-jelly/ig"user:="me"pass:="secret"client:=ig.NewClient(user,pass)devices,err:=client.Devices()iferr!=nil {panic(err)}// print the known devicesfor_,d:=rangedevices {fmt.Printf("%-12s %-18s %-20s %s",d.Type,d.ID,d.DeviceName,d.Growroom)}doser,err:=client.IntelliDose("ASLID17081149")iferr!=nil {panic(err)}fmt.Println("Water is currently %0.2f EC and %0.2f pH",doser.Metrics.Ec,doser.Metrics.PH)// Immediate push to the APIiferr:=doser.ForceIrrigation();err!=nil {panic(err)}// Push all the changes to the API at onceerr:= doser.Transaction(func()error) {doser.ForceIrrigation()// no errors returned in this modedoser.ForcePHDose()doser.ForceNutrientDose()returnnil})iferr!=nil {panic(err)}

You can also find a basic CLI client implementation incmd/ig.

Multigrow

Coming soon!

go-intelli

Currently the IntelliDose is supported when used in combination with thego-intelli gateway for event driven readings over the local network.

import"github.com/AutogrowSystems/go-jelly/sfc"// connect to the IntelliDose on the IntelliLinkidose:=sfc.NewIntelliDose(sn)err:=sfc.ConnectToNATS(idose,"nats://localhost:4222",10)iferr!=nil {panic(err)}for {// block until we get an updateidose.WaitForUpdate()// print out the readingsr:=idose.Readings()log.Printf("EC: %02.f pH: %02.f Temp: %0.2f",r.Ec,r.PH,r.NutTemp)}

You can see some usage examples in this repo:

  • sfc/examples/daynightonoff.go: send a push notification when an IntelliDose transitions from day to night (or vice versa)
  • sfc/examples/printreadings.go: print readings to the terminal every time they change

About

SDK to access Autogrow hardware and services programmatically

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages


[8]ページ先頭

©2009-2025 Movatter.jp