Skip to content

Connector able to download weather data from an Oregon Scientific EMR211X station, leveraging on Bluetooth Low Energy connection

License

Notifications You must be signed in to change notification settings

chrvadala/weather-station

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

weather-station

Connector able to download weather data from an Oregon Scientific EMR211X station, leveraging on Bluetooth Low Energy connection

chrvadala npm Downloads Donate

Install

yarn add weather-station

Example

Before running the following script, configure your permissions https://github.com/chrvadala/node-ble#provide-permissions

const WeatherStation = require('weather-station')
const ADAPTER = 'hci0'
const ADDRESS = '00:00:00:00:00:00' //Oregon Scientific EMR211X Bluetooth address

async function main() {
  const station = new WeatherStation(ADAPTER, ADDRESS)

  station.on('data', console.log)
  station.on('connect', () => console.log('connected'))
  station.on('disconnect', () => console.log('disconnected'))

  await station.bind()
  await new Promise(resolve => setTimeout(resolve, 5000))
  await station.unbind()
}

main()
  .then(console.log)
  .catch(console.error)
}
connected
{ base_temp: 21.6,
  sensor1_temp: -17.7,
  sensor2_temp: null,
  sensor3_temp: null }
{ base_temp_max: 23.7,
  base_temp_min: 20.3,
  sensor1_temp_max: 25.6,
  sensor1_temp_min: -19.3,
  sensor2_temp_max: null,
  sensor2_temp_min: null,
  sensor3_temp_max: null,
  sensor3_temp_min: null }
disconnected

DEBUG

DEBUG=weather-station node example.js

Changelog

  • 0.x - Beta version
  • 1.0 - First official version

Contributors

References

About

Connector able to download weather data from an Oregon Scientific EMR211X station, leveraging on Bluetooth Low Energy connection

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

Packages

No packages published