Giter VIP home page Giter VIP logo

homebridge-servo-switch's Introduction

Homebridge Servo Switch

Control a Servo Motor through Homebridge as a switch. Designed to use with RaspberryPi and Homebridge, it helps to transform a dumb lightswitch to a smart one. Depends on python-shell package.

Installation

$ sudo npm install -g homebridge-servo-switch

Configuration

{
    "platforms": [{
          "platform" : "ServoSwitch",
          "name" : "Servo Switch",
          "switches": [{
            "name" : "Light",
            "gpioPin" : 40,
            "onPulse" : 5.7,
            "offPulse" : 8.3
        }]
    }]

Where

  • name is the name of your choice
  • gpioPin is the pin that the servo motor is connected
  • onPulse is the ammount of degrees to turn the servo for a "On" state *
  • offPulse is the ammount of degrees to turn the servo for a "Off" state *

The period is based on 20 ms (50 Hz)

Using Servo Motor with NodeMCU

I've uploaded a INO file to be used with NodeMCU. It creates a HTTP Server that allows Homebridge to connect and control, through Homebridge HTTP Plugin. I'm using D4, 3v and GND pins to connect the Servo on NodeMCU.

Follows the config.json to configure it EXCLUSIVELY when using NodeMCU

{
    "accessory": "HTTP-RGB",
    "name": "Light Test",

    "switch": {
        "status": "http://<YOUR_IP>/switch/status",
        "powerOn": "http://<YOUR_IP>/switch/1",
        "powerOff": "http://<YOUR_IP>/switch/0"
    }
}

Doubts, suggestions and bugs

Please feel free to report at Issues page

homebridge-servo-switch's People

Contributors

allistoncarlos avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

homebridge-servo-switch's Issues

Question

I there anyway to modify this to make it work with a nocemcu instead of the pi? thank you

I need help to setup

When i add everything to the config and upload the sketch to my nodemcu the homebridge app shows the device ass "not supported" by the home app.
I checked the ip address and everything else i know off.
Did i forgot anything to set it up properly ?
Do i need the "platform" or "python" part ?
The servo is the same ure using and its connected right.

Im relatively new to homebridge so excuse me for any stupid questions. :)

I just need some help.

Hello, I want to use this to build a smart door lock. The Servo turnes the key in the lock kind of thing. The Servo is connected to an ESP8266. I used the ino file on the raspberry and your config.json part on my Homebridge. The problem now is, that whenever i try to controll it via Homebridge, the device says it is offline and Homebridge log says, that no Power_url is defined. If you could help me, it would be really appreciated. Maybe contact me here or via my eMail Adress: [email protected].
Thankyou very much :)

idle time too long

I think that the waiting time is about 7.5 sec is too long. Although I can change by myself with editing the script. But it is better that add an option to config in the config.json.

Thanks for creating such a useful plugin.
Nice work!!

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.