Giter Site home page Giter Site logo

philippeportesppo / airmentorpro2_smartthings Goto Github PK

View Code? Open in Web Editor NEW
6.0 2.0 1.0 1.28 MB

Integration of Co-Asia/Air-Mentor Pro 2 into SmartThings environment over BT-LE using Raspberry Pi and Weather Underground weather forecasts.

PHP 4.61% Groovy 68.58% Python 26.82%
raspberry device-handler smartapp dth php pollution groovy smartthgings airmentor air-quality

airmentorpro2_smartthings's Introduction

Overall Setup Icon

Raspberry Pi 3 side:

1. Apache2 and PHP5 properly installed (see here)

Assign a static IP address to your raspberry on your local network. This project works only if your Hub and raspberry are on same network (otherwise the HubAction won't work and you need to implement external HTTPrequest instead)

Optional: 1 USB dongle BT-LE (Plugable Dual-Mode BT-LE/BT model USB-BT4LE) I didn't make it with the internal BT-LE of the Pi using the oringinal image on it, I used this external one then. Then recently, the Raspberry Pi internal BTLE works fine using Linux raspberrypi 4.4.50-v7+ #970 SMP Mon Feb 20 19:18:29 GMT 2017 armv7l GNU/Linux< image from the Raspberry website (or above)

2. Additional installation on Raspberry:

3. This project files installation:

  • Put in Raspberry /var/www/html folder the file : airmentorpro2.php
  • Put in /home/pi the python script airmentorpro2.py
  • Put in /home/pi the python script ssdp_server.py (this file uses wlan0 as interface. You can change the code to use eth0 or other)
  • Create a folder "lib" in /home/pi
  • Put in /home/pi/lib the 2 files ssdp.py and upnp_http_server.py.
  • This is mandatory the 2 files are in a lib folder and the lib folder at the same location as ssdp_server.py
  • In /etc/rc.local, just before the exit 0 (last line):
  • add: sudo /usr/bin/python /home/pi/airmentorpro2.py [your AirMentor MAC] [your hci#] &

    Example: sudo /usr/bin/python /home/pi/airmentorpro2.py fe:ed:fa:ce:be:ef 0 &ย 

  • add: /usr/bin/python /home/pi/ssdp_server.py &
  • Smarthings IDE side:

  • with a github enabled SmartThings IDE (see here), import the namespace philippeportesppo and repository AirMentorPro2_SmartThings on master branch
  • and the following device handlers and smartapps:

    SmartApps:

  • AirMentor Pro UPnP Service Manager : the smartapp managing the ssdp discover.
  • IAQ_vent : the smartapp managing vents and AC fans upon air quality notification
  • Notify Me When for AirMentor Pro : the smartapp managing events and notify you about the air quality.
  • Device Handler:

  • Air Mentor Pro 2 : the device handler to access the AirMentor Pro 2
  • If you cannot access github integration, you might have to create the devicehandler and smartapps manually from the code.

    SmartThing Mobile app:

  • Go to Smartapps section and add the AirMentor Pro UPnP Service Manager smartapp from "My Apps"
  • Start the research, few seconds later the pi will be discovered, select it, press next and save.
  • AirMentor Pro 2 will be added

    IMPORTANT:

    use pollster smartapp to cadence the polling (every 5min) otherwise, Smartthing known issue will let the DTH stoping the polling after 24h or so.

    Hope you like it.

    Support via PayPal

  • airmentorpro2_smartthings's People

    Contributors

    philippeportesppo avatar

    Stargazers

     avatar  avatar  avatar  avatar  avatar  avatar

    Watchers

     avatar  avatar

    Forkers

    jac4b

    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.