weather-station

1.0.0 • Public • Published

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

Package Sidebar

Install

npm i weather-station

Weekly Downloads

0

Version

1.0.0

License

MIT

Unpacked Size

8.29 kB

Total Files

8

Last publish

Collaborators

  • chr.vadala