Own a SensorPush temp/humidity sensor? Or a whole fleet of them?
This is a JavaScript/TypeScript npm module for the SensorPush API, so you can pull and look at your data from any Node program. For example, you could grab your data and send to external stats services, store in a datbase, trigger your own alerts...whatever.
It is lightweight; this module requires zero external modules, not even node-fetch or request.
It is unofficial and I'm happy to hand ownership over to the sensorpush.com team, or another engineer they approve of.
npm install sensorpush
# or
yarn add sensorpush
constsensorpush=require('sensorpush').apiconstemail='you@foo.com'constpassword='BO000yAH!'asyncfunctionmain(){try{// autorize ourselvesconst{authorization}=awaitsensorpush.oauth.authorize(email,password)const{accesstoken}=awaitsensorpush.oauth.accesstoken(authorization)// get and print some dataconstsensors=awaitsensorpush.devices.sensors(accesstoken)constgateways=awaitsensorpush.devices.gateways(accesstoken)constsamples=awaitsensorpush.samples(accesstoken,newDate(Date.now()-3600000),5)console.log({sensors, gateways, samples})}catch(err){console.error(err)}}main()Enjoy!
