Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch turns on then back off #53

Closed
bobisaperson1 opened this issue Dec 17, 2018 · 7 comments
Closed

Switch turns on then back off #53

bobisaperson1 opened this issue Dec 17, 2018 · 7 comments
Milestone

Comments

@bobisaperson1
Copy link

bobisaperson1 commented Dec 17, 2018

Backstory

just playing around with homebridge and had a sudden thought if i could use it for wol so i found this.

Issue

when I "turn on" my computer it turn itself off agian without actualy turning on my computer

Environment

  • os & os version:raspian & dont know what version as the homebridge host, windows 10 for other computer
  • node version: 8.11.1
  • homebridge version: latest as of writing this
  • homebridge-wol version: latest as of writing this

Configuration

My configuration looks like this:

{
    "bridge": {
        "name": "Homebridge",
        "username": "CC:22:3D:E3:CE:30",
        "port": 51826,
        "pin": "031-45-154"
    },
    "description": "This is an example configuration file with one fake accessory and one fake platform. You can use this as a template for creating your own configuration file containing devices you actually own.",
    "platforms": [
        {
            "platform": "yeelight",
            "name": "Yeelight",
            "transitions": {
                "power": 400,
                "brightness": 400
            },
            "multicast": {
                "interface": "0.0.0.0"
            }
        }
    ],
    "accessories": [
        {
            "accessory": "NetworkDevice",
            "name": "Computer",
            "mac": "<mac-address>",
            "ip": "10.10.0.52",
            "pingInterval": 45,
            "wakeGraceTime": 1
        },
   {
   	"accessory": "WinPC",
   	"name": "My Windows PC",
   	"http_method": "GET",
   	"on_url": "wol://<mac-address>?ip=10.0.0.52",
   	"off_url": "http://10.0.0.52:8000/?action=System.hibernate",
   	"status_url": "http://10.0.0.52:8000/",
   	"sendimmediately": "yes",
   	"poll_status_interval": "1",
   	"username" : "User",
   	"password" : "password",
   	"powerstateOnError" : "0",
   	"powerstateOnConnect" : "1"				
   }
        
    ]
}


Log

When I follow these steps:

  1. Run DEBUG=* homebridge
  2. Let it run for five minutes
  3. Tap a switch
  4. Wait one minute
  5. Tap the same switch

I get the following log:

(node:3773) [DEP0022] DeprecationWarning: os.tmpDir() is deprecated. Use os.tmpdir() instead.
HAP Warning: Characteristic 00000054-0000-1000-8000-0026BB765291 not in required or optional characteristics for service 0000003E-0000-1000-8000-0026BB765291. Adding anyway.
  EventedHTTPServer Server listening on port 51826 +0ms
  EventedHTTPServer [::ffff:10.0.0.24] New connection from client +1s
  EventedHTTPServer [::ffff:10.0.0.24] HTTP server listening on port 42155 +2ms
  EventedHTTPServer [::ffff:10.0.0.24] HTTP request: /pair-verify +23ms
  HAPServer [CC:22:3D:E3:CE:30] HAP Request: POST /pair-verify +2ms
  HAPServer [CC:22:3D:E3:CE:30] Pair verify step 1/2 +18ms
  EventedHTTPServer [::ffff:10.0.0.24] HTTP Response is finished +55ms
  EventedHTTPServer [::ffff:10.0.0.11] New connection from client +3ms
  EventedHTTPServer [::ffff:10.0.0.11] HTTP server listening on port 45415 +1ms
  EventedHTTPServer [::ffff:10.0.0.11] HTTP request: /pair-verify +7ms
  HAPServer [CC:22:3D:E3:CE:30] HAP Request: POST /pair-verify +1ms
  HAPServer [CC:22:3D:E3:CE:30] Pair verify step 1/2 +2ms
  EventedHTTPServer [::ffff:10.0.0.11] HTTP Response is finished +19ms
  EventedHTTPServer [::ffff:10.0.0.24] HTTP request: /pair-verify +4ms
  HAPServer [CC:22:3D:E3:CE:30] HAP Request: POST /pair-verify +0ms
  HAPServer [CC:22:3D:E3:CE:30] Pair verify step 2/2 +4ms
  HAPServer [CC:22:3D:E3:CE:30] Client C681727E-6418-45DB-823C-FC5261D48A88 verification complete +9ms
  EventedHTTPServer [::ffff:10.0.0.24] HTTP Response is finished +1ms
  EventedHTTPServer [::ffff:10.0.0.24] HTTP request: /accessories +17ms
  HAPServer [CC:22:3D:E3:CE:30] HAP Request: GET /accessories +1ms
  EventedHTTPServer [::ffff:10.0.0.24] HTTP Response is finished +6ms
  EventedHTTPServer [::ffff:10.0.0.11] HTTP request: /pair-verify +1ms
  HAPServer [CC:22:3D:E3:CE:30] HAP Request: POST /pair-verify +0ms
  HAPServer [CC:22:3D:E3:CE:30] Pair verify step 2/2 +1ms
  HAPServer [CC:22:3D:E3:CE:30] Client C681727E-6418-45DB-823C-FC5261D48A88 verification complete +7ms
  EventedHTTPServer [::ffff:10.0.0.11] HTTP Response is finished +1ms
  EventedHTTPServer [::ffff:10.0.0.11] HTTP request: /accessories +104ms
  HAPServer [CC:22:3D:E3:CE:30] HAP Request: GET /accessories +1ms
  EventedHTTPServer [::ffff:10.0.0.11] HTTP Response is finished +3ms
  EventedHTTPServer [::ffff:10.0.0.24] HTTP request: /characteristics +293ms
  HAPServer [CC:22:3D:E3:CE:30] HAP Request: PUT /characteristics +1ms
  Accessory [Homebridge] Processing characteristic set: [{"aid":12,"iid":10,"ev":true}] +7ms
  Accessory [Homebridge] Registering Characteristic "On" for events +5ms
  EventedHTTPServer [::ffff:10.0.0.24] HTTP Response is finished +4ms
  EventedHTTPServer [::ffff:10.0.0.24] HTTP request: /characteristics +12ms
  HAPServer [CC:22:3D:E3:CE:30] HAP Request: PUT /characteristics +1ms
  Accessory [Homebridge] Processing characteristic set: [{"aid":14,"iid":10,"ev":true}] +2ms
  Accessory [Homebridge] Registering Characteristic "On" for events +1ms
  EventedHTTPServer [::ffff:10.0.0.24] HTTP Response is finished +3ms
  EventedHTTPServer [::ffff:10.0.0.11] HTTP request: /characteristics +130ms
  HAPServer [CC:22:3D:E3:CE:30] HAP Request: PUT /characteristics +0ms
  Accessory [Homebridge] Processing characteristic set: [{"aid":14,"iid":10,"ev":true}] +2ms
  Accessory [Homebridge] Registering Characteristic "On" for events +0ms
  EventedHTTPServer [::ffff:10.0.0.11] HTTP Response is finished +3ms
  EventedHTTPServer [::ffff:10.0.0.11] HTTP request: /characteristics +12ms
  HAPServer [CC:22:3D:E3:CE:30] HAP Request: PUT /characteristics +1ms
  Accessory [Homebridge] Processing characteristic set: [{"aid":12,"iid":10,"ev":true}] +2ms
  Accessory [Homebridge] Registering Characteristic "On" for events +1ms
  EventedHTTPServer [::ffff:10.0.0.11] HTTP Response is finished +2ms
  EventedHTTPServer [::ffff:10.0.0.11] HTTP request: /characteristics +15ms
  HAPServer [CC:22:3D:E3:CE:30] HAP Request: PUT /characteristics +1ms
  Accessory [Homebridge] Processing characteristic set: [{"aid":12,"iid":10,"ev":true}] +2ms
  Accessory [Homebridge] Registering Characteristic "On" for events +1ms
  EventedHTTPServer [::ffff:10.0.0.11] HTTP Response is finished +2ms
  EventedHTTPServer [::ffff:10.0.0.11] HTTP request: /characteristics +11ms
  HAPServer [CC:22:3D:E3:CE:30] HAP Request: PUT /characteristics +1ms
  Accessory [Homebridge] Processing characteristic set: [{"aid":14,"iid":10,"ev":true}] +2ms
  Accessory [Homebridge] Registering Characteristic "On" for events +0ms
  EventedHTTPServer [::ffff:10.0.0.11] HTTP Response is finished +2ms
  EventedHTTPServer [::ffff:10.0.0.11] HTTP request: /characteristics?id=14.10,12.10 +27s
  HAPServer [CC:22:3D:E3:CE:30] HAP Request: GET /characteristics?id=14.10,12.10 +1ms
  Accessory [Homebridge] Getting value for Characteristic "On" +11ms
  Accessory [Homebridge] Got Characteristic "On" value: false +5ms
  Accessory [Homebridge] Getting value for Characteristic "On" +2ms
  Accessory [Homebridge] Got Characteristic "On" value: false +3s
  EventedHTTPServer [::ffff:10.0.0.11] HTTP Response is finished +5ms
  EventedHTTPServer [::ffff:10.0.0.11] HTTP request: /characteristics?id=14.10,12.10 +4m
  HAPServer [CC:22:3D:E3:CE:30] HAP Request: GET /characteristics?id=14.10,12.10 +1ms
  Accessory [Homebridge] Getting value for Characteristic "On" +2ms
  Accessory [Homebridge] Got Characteristic "On" value: false +1ms
  Accessory [Homebridge] Getting value for Characteristic "On" +0ms
  Accessory [Homebridge] Got Characteristic "On" value: false +3s
  EventedHTTPServer [::ffff:10.0.0.11] HTTP Response is finished +2ms
  EventedHTTPServer [::ffff:10.0.0.11] HTTP request: /characteristics +6s
  HAPServer [CC:22:3D:E3:CE:30] HAP Request: PUT /characteristics +0ms
  Accessory [Homebridge] Processing characteristic set: [{"aid":14,"iid":10,"value":1}] +3ms
  Accessory [Homebridge] Setting Characteristic "On" to value 1 +1ms
  EventedHTTPServer [::ffff:10.0.0.24] Sending HTTP event '14.10' with data: {"characteristics":[{"aid":14,"iid":10,"value":true}]} +18ms
  EventedHTTPServer [::ffff:10.0.0.11] Sending HTTP event '14.10' with data: {"characteristics":[{"aid":14,"iid":10,"value":true}]} +5ms
  EventedHTTPServer [::ffff:10.0.0.11] HTTP Response is finished +17ms
  EventedHTTPServer [::ffff:10.0.0.11] Writing pending HTTP event data +1ms
  EventedHTTPServer [::ffff:10.0.0.24] Sending HTTP event '14.10' with data: {"characteristics":[{"aid":14,"iid":10,"value":false}]} +2s
  EventedHTTPServer [::ffff:10.0.0.11] Sending HTTP event '14.10' with data: {"characteristics":[{"aid":14,"iid":10,"value":false}]} +6ms
  EventedHTTPServer [::ffff:10.0.0.11] HTTP request: /characteristics?id=14.10,12.10 +2m
  HAPServer [CC:22:3D:E3:CE:30] HAP Request: GET /characteristics?id=14.10,12.10 +1ms
  Accessory [Homebridge] Getting value for Characteristic "On" +2ms
  Accessory [Homebridge] Got Characteristic "On" value: false +0ms
  Accessory [Homebridge] Getting value for Characteristic "On" +1ms
  Accessory [Homebridge] Got Characteristic "On" value: false +3s
  EventedHTTPServer [::ffff:10.0.0.11] HTTP Response is finished +2ms
  EventedHTTPServer [::ffff:10.0.0.11] HTTP request: /characteristics +921ms
  HAPServer [CC:22:3D:E3:CE:30] HAP Request: PUT /characteristics +1ms
  Accessory [Homebridge] Processing characteristic set: [{"aid":14,"iid":10,"value":1}] +2ms
  Accessory [Homebridge] Setting Characteristic "On" to value 1 +1ms
  EventedHTTPServer [::ffff:10.0.0.24] Sending HTTP event '14.10' with data: {"characteristics":[{"aid":14,"iid":10,"value":true}]} +6ms
  EventedHTTPServer [::ffff:10.0.0.11] Sending HTTP event '14.10' with data: {"characteristics":[{"aid":14,"iid":10,"value":true}]} +5ms
  EventedHTTPServer [::ffff:10.0.0.11] HTTP Response is finished +9ms
  EventedHTTPServer [::ffff:10.0.0.11] Writing pending HTTP event data +1ms
  EventedHTTPServer [::ffff:10.0.0.24] Sending HTTP event '14.10' with data: {"characteristics":[{"aid":14,"iid":10,"value":false}]} +2s
  EventedHTTPServer [::ffff:10.0.0.11] Sending HTTP event '14.10' with data: {"characteristics":[{"aid":14,"iid":10,"value"

Notes

Please write about things that you did not see fit the above headers.

@AlexGustafsson
Copy link
Owner

It could be the fact that you seem to have two plugins for WoL, try either WinPC or homebridge-wol and see if the issue persists.

@bobisaperson1
Copy link
Author

I tried and it didn’t help.

@AlexGustafsson
Copy link
Owner

Could you go through the debugging steps with debugging in homebridge-wol enabled? There should be an option mentioned in the readme for further logging.

In your output I couldn’t see any issue, but you didn’t seem to turn anything on or off, also try flicking a switch during debugging and post the result.

@Kopertje
Copy link

Kopertje commented Jan 1, 2019

I got the same issue as OP. When i have send the action to shut down a Windows 10 PC, when its shutdown, the button in my HomeKit goes back to "on".

@bobisaperson1
Copy link
Author

bobisaperson1 commented Jan 1, 2019

Yeah I trouble shooted (mind the grammar) and worked out the magic packets weren’t even reaching my computer.

@AlexGustafsson
Copy link
Owner

@koportje Could you follow the debug steps so that I can follow the exact flow on homebridge?

@AlexGustafsson AlexGustafsson added this to the 3.3 milestone Jan 16, 2019
@AlexGustafsson
Copy link
Owner

Closing due to inactivity.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants