Giter VIP home page Giter VIP logo

homebridge-sonoff's Introduction

homebridge-sonoff

NPM version

This is a plugin for homebridge which makes it possible to control Sonoff Basic devices with Tasmota firmware through HTTP only

You need Tasmota v5.11.0 or higher if you want to use this plugin!

Demo

Installation

npm i -g homebridge-sonoff

Information

Used HTTP routes:

http://sonoff/cm?cmnd=Power
http://sonoff/cm?cmnd=Power%20On
http://sonoff/cm?cmnd=Power%20Off

Example config

{
  "platform": "Sonoff",
  "name": "Sonoff",
  "devices": [
    {
      "name": "Name of the accessory",
      "hostname": "The hostname or local ip address of the Sonoff device"
    }
  ]
}

Multiple Relays

{
  "platform": "Sonoff",
  "name": "Sonoff",
  "devices": [
    {
      "name": "Name of the accessory",
      "hostname": "The hostname or local ip address of the Sonoff device",
      "relay": "2"
    }
  ]
}

Password specified in Web Interface

{
  "platform": "Sonoff",
  "name": "Sonoff",
  "devices": [
    {
      "name": "Name of the accessory",
      "hostname": "The hostname or local ip address of the Sonoff device",
      "password": "The password from the web interface"
    }
  ]
}

homebridge-sonoff's People

Contributors

alexanderbabel avatar ageorgios avatar alexymik avatar dantheman827 avatar krocko avatar jembach avatar

Stargazers

 avatar Ronnie Salomonsen avatar Oleg Solomko avatar Jan Jastrow avatar  avatar Ahmad avatar Nikita avatar  avatar Jason Lynch avatar

Watchers

James Cloos avatar  avatar  avatar  avatar

homebridge-sonoff's Issues

SyntaxError: Unexpected token R in position 0

Hi!

Set-up : RPI 2 with latest Raspbian image + latest updates
Sonoff basic with Tasmota Version | 5.9.1 installed

Set up done - Reproducing the issue : Start homebridge and unlock Iphone, enter Home and wait for the sonoff device to refresh status of output. That is when the plug-in crashes and the error is the following:

undefined:1
RESULT = "{"POWER" : "OFF"}
^

SyntaxError: Unexpected token R in JSON at position 0
at JSON.parse()
at Request.request [as _callback] (/usr/lib/node_modules/homebridge-sonoff/index.js :155:20)
at Request.self.callback (/usr/lib/node_modules/homebridge-sonoff/node_modules/request/request.js:185:22)
......
............
.....................
................................
............................................
at Object.onceWrapper )events.js:313:30)

This plugin slows down Homebridge

Hi,

i'm getting this message in my logfiles:

[17/05/2021, 13:50:08] [homebridge-sonoff] This plugin slows down Homebridge. The read handler for the characteristic 'On' didn't respond at all!. Please check that you properly call the callback! See https://git.io/JtMGR for more info.
[17/05/2021, 13:50:08] [homebridge-sonoff] This plugin slows down Homebridge. The read handler for the characteristic 'On' didn't respond at all!. Please check that you properly call the callback! See https://git.io/JtMGR for more info.

Any ideas with that?

Thanks,
Stefan

ERROR LOADING PLUGIN homebridge-sonoff

Hi,
thank you for your work. I've encountered a problem while trying to use it. Could you please be so kind and help me?

node: v6.14.4
homebridge: 0.4.45

[10. 1. 2019 9:55:09] ERROR LOADING PLUGIN homebridge-sonoff:
[10. 1. 2019 9:55:09] /usr/local/lib/node_modules/homebridge-sonoff/index.js:100
    .on('get', async (callback) => {
                    ^

SyntaxError: Unexpected token (
    at createScript (vm.js:56:10)
    at Object.runInThisContext (vm.js:97:10)
    at Module._compile (module.js:549:28)
    at Object.Module._extensions..js (module.js:586:10)
    at Module.load (module.js:494:32)
    at tryModuleLoad (module.js:453:12)
    at Function.Module._load (module.js:445:3)
    at Module.require (module.js:504:17)
    at require (internal/module.js:20:19)
    at Plugin.load (/usr/local/lib/node_modules/homebridge/lib/plugin.js:72:23)
[10. 1. 2019 9:55:09] ====================

Thank you very much.

Best regards,
Petr

Switch state

Hi! First of all great work, thank you!
I found out that state not working right now.
With "http://sonoff/?m=1" http command the response is "{t}{t}OFF" or "{t}{t}ON" depending on the current state. It does not require authentication.
Could we refresh this code to make it work?

Sonoff Touch

Hi,

I flashed a Sonoff Touch (1 channel) and filled it in in my config.json file.

Now I can control it but when I push the button I don't get feedback in homekit.

I can't see if the switch is on or off.

Any ideas how I can do this ?

thx

1.0.5 issue

Hi,

I am facing this error on my T1 2-gang. The first button will have a No Response in Apple Home and the second button is ok. I still can use Siri to trigger on/off. When I roll back to 1.0.4 is works fine.

Error : [Sonoff] [Device] Could not retrive power state! Please check your Sonoff and your configuration! Maybe you are using a Sonoff Dual with no replay option or vice versa.

Thank you

Group relays

Could you make an option to group the relays to one accessory?
If the sonoff have 2 relays so we have 1 accessory with 2 switches.
Like it is in the sound touch plugin.

hostname doesn't seem to work

Hi,

If I use the hostname instead of the IP address of my Sonoff the plugin doesn't seem to work anymore. IS this a known issue?

BR, Hanno

Sonoff Mini

Hi,

i have several Sonoff's (POW etc.) included in my homebridge - it works perfect.

Now I want to integrate my new Sonoff Mini.
But I get this error message in the log:
Could not retrive power state! Please check your Sonoff and your configuration! Maybe you are using a Sonoff Dual with no replay option or vice versa.

Any ideas?

Thanks

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.