Coder Social home page Coder Social logo

homebridge-simple-http's Introduction

homebridge_simple_http

This Project tries to deliver a simple, but fail-safe HTTP Switch for HomeBridge

Installation

Just install the NPM Plugin Globally

npm install -g homebridge-http-simple-switch

Usage

Just configure the config.json as usual, the following paramteres are supported:

    // Switch with polling and a On/Off-State
    {
      "accessory" : "SimpleHttpSwitch",
      "http_method" : "GET",                              // The HTTP-Method
      "ignore_https_security" : false                     // Should the HTTPS Certificate (for all https requests) be validated? (Set it to true if you are using a self-signed cert)
      "set_off_url" : "http://localhost/turn/off",        // The JSON-Webservice URL for turning the device on
      "status_url" : "http://localhost/device/status",    // The JSON-Webservice URL for getting the device's status
      "on_if_this_fn" : "(obj)=>obj.status ? obj.status=='ON' : null", //JS Function for evaluating if the device is on, you can alternativly use the following:
      "on_if_this": {"status":"on"},                      // If you don't want to use on_if_this_fn
      "off_if_this": {"status":"off"},                    // If you don't want to use on_if_this_fn
      "set_on_url" : "http://localhost/turn/on",          // The JSON-Webservice URL for turning the device on
      "polling" : true,                                   // Enable Polling/Refreshing of the Status
      "pollingInterval" : 5,                              // Polling Interval in Seconds
      "name" : "Desk Light"                               // Name of your Switch/Accessory
    }

    // Stateless Switch, will automaticly go off a few miliseconds after switched on
    {
      "accessory" : "SimpleHttpSwitch",
      "set_on_url" : "http://localhost/trigger/something",
      "status_url" : "", // Needs to be empty
      "name" : "Desk Light"
    }

ToDo

  • improve TypeScript Typings
  • improve code readability
  • migrate to a platform instead of a single accessory
  • support other HomeKit-Accessories then 'Switch'

homebridge-simple-http's People

Contributors

sinnaj-r avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

lejeko drakkhen

homebridge-simple-http's Issues

More than one switch possible?

Is it possible the create more than one switch with this plugin?

If yes: How do I have to configure it?

If not: Could you please add it? Please-please? Please-please-please? ๐Ÿ˜

Great plugin! ๐Ÿ‘๐Ÿป Simple but effective. (And the only homebridge-http-switch-plugin that worked for me so far ... I just need a few switches calling pushcut webhook-urls for sending push-notifications to my iPhone)

HTTP power function failed

I want with homebridge switch an device (windowopener) with this httplink:
' http://10.0.1.29/open'

So I set my Json with:
{
"accessory" : "SimpleHttpSwitch",
"set_on_url" : "http://10.0.1.29/open",
"status_url" : "", // Needs to be empty
"name" : โ€œAxa open"
}

I get an error 'HTTP power function failed'.

Is it possible to use this plugin for this?
And if yes, what do I wrong?

Comment out (or change log level) for "HTTP power [...] succeeded" messages

Hello -- Great plugin, thank you! I was wondering if you could add an option to suppress the "HTTP power [...] succeeded" messages going to the log. They're super noisy and not helpful most of the time when things are running as expected. The failed messages are great though, of course, when prudent. Thank you.

Error in log when starting Homebridge - tells me to report to the developer

When I start Homebridge, I get this message in the log:

[6.5.2022, 22:22:39] Loaded plugin: [email protected]
[6.5.2022, 22:22:39] Plugin 'homebridge-simple-http' tried to register with an incorrect plugin identifier: 'homebridge-http-simple-switch'. Please report this to the developer!
[6.5.2022, 22:22:39] Registering accessory 'homebridge-simple-http.SimpleHttpSwitch'
[6.5.2022, 22:22:39] ---

I tells me to report this to the developer, so I'll do this. Here and now. Done! Check! ๐Ÿ˜

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.