Giter Site home page Giter Site logo

oregonpi's Introduction

OregonPi with MQTT

433 Sensor Oregon Scientific decoder for Raspberry Pi sending mqtt to a local mqtt server (in my case for OpenHab / OpenHabian 2) to work with this data in a home automation. Works parallel to an RF sniffer to get radio signals from remote controls / door sensors AND oregon.

I'll improve the code style.

Forked from https://github.com/1000io/OregonPi

Code based on disk91 project http://www.disk91.com MQTT code based on https://github.com/Josar/RandomStuff/tree/master/Openhab-related

Support OregonSensorV2

  • THGR122NX
  • THN132N
  • THGRN228NX
  • WGR9180
  • STR928N
  • BTHG968

Hardware Config

https://projects.drogon.net/raspberry-pi/wiringpi/pins/

INPUT GPIO 2

Install wiringPi

  • sudo apt-get install git-core
  • sudo apt-get update
  • sudo apt-get upgrade
  • git clone git://git.drogon.net/wiringPi
  • cd wiringPi
  • git pull origin
  • ./build

Install OregonPi

  • cd ..
  • git clone git://github.com/1000io/OregonPi
  • cd OregonPi
  • make

Execute

sudo ./test

Execute & Save Log Archive

nohup sudo /home/pi/OregonPi/test /home/pi/OregonPi/log_oregon.csv &

Log Example

[chanel number],[temp],[hum]

1,temp19.100000,hum69.000000

Pimatic Integration

You can use it with pimatic-log-reader as I do :)

https://pimatic.org/plugins/pimatic-log-reader/

pimatic config example:

{
  "id": "oregon1",
  "name": "Bedroom Sensor",    //sensor display name
  "class": "LogWatcher",
  "file": "/home/pi/OregonPi/log_oregon.csv",  //log file
  "attributes": [
    {
      "name": "temp",
      "type": "number",
      "unit": "°C"
    },
    {
      "name": "hum",
      "type": "number",
      "unit": "%"
    }
  ],
  "lines": [
    {
      "match": "1,temp(.+),hum(.+)",   // ->1<- Sensor channel number
      "temp": "$1",
      "hum": "$2"
    }
  ]
}

Data Support

Sensor(char * _strval); // construct and decode value

  • bool availableTemp(); // return true if valid && have Temp
  • bool availableHumidity(); // return true if valid && have Humidity
  • bool isBatteryLow(); // return true if valid && haveBattery && flag set.
  • bool hasChannel(); // return true if valid && haveChannel
  • bool isDecoded(); // return true if valide
  • bool availableSpeed(); // return true if valid && speed in km/h
  • bool availableDirection(); // return true if valid && wind direction
  • bool availableRain(); // return true if valid && rain in mm/h
  • bool availablePressure(); // return true if valid && pressure in mb
  • double getTemperature(); // return temperature in C°
  • double getHumidity(); // return humidity in % (base 100)
  • char * getSensorName(); // return sensor name
  • double getRain(); // return Rain
  • double getTrain();
  • double getDirection(); // return wind direction
  • double getSpeed(); // return speed in km/h
  • double getPressure(); // return pressure in mb
  • int getChannel(); // return channel value
  • int getSensClass(); // return sensor class
  • int getSensType(); // return sensor type

Thanks to

@renzo38 & @FunFR

oregonpi's People

Contributors

1000io avatar marcelmeurer avatar funfr avatar

Stargazers

 avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.