steve228uk / homebridge-dash

A quick and dirty Homebridge plugin for Amazon Dash
MIT License
13 stars 4 forks source link

libpcap-dev #1

Closed samsonrosen closed 7 years ago

samsonrosen commented 7 years ago

Hello!

I have just ordered an Amazon Dash. Can I use this with my Homebridge Mac Mini setup? I've not seen reference to the: libpcap-dev before.

Thanks,

Sam

samsonrosen commented 7 years ago

Hello,

I have this setup, I had to use the command below as I got lots of X-Code errors.

sudo npm install -g --unsafe-perm homebridge

I also have to run homebridge in Sudo mode to prevent homebridge from crashing. I have got the MAC address of the Dash but nothing seems to happen when I press it!

The 'Switch' has appeared in my Home application, but I am expecting the Switch to toggle on and off when the Dash is clicked. Is this expected behaviour?

Thanks,

Sam

{
   "bridge":{
      "name":"Homebridge",
      "username":"CC:22:3D:E3:CE:30",
      "port":51826,
      "pin":"031-45-154"
   },
   "description":"Homebridge",
   "accessories":[
      {
         "accessory":"WeMo",
         "name":"HP Printer",
         "wemo_name":"WeMo Switch"
      },
      {
         "accessory":"Dash",
         "name":"Light Dash",
         "protocol":"udp",
         "mac":"08:86:3B:C9:42:15"
      }
   ],
   "platforms":[
      {
         "platform":"Camera-ffmpeg",
         "cameras":[
            {
               "name":"Sam's Room",
               "videoConfig":{
                  "source":"-re -f avfoundation -framerate 30 -video_size 1280x720 -i 0:0",
                  "maxStreams":2,
                  "maxWidth":1280,
                  "maxHeight":720,
                  "maxFPS":30
               }
            }
         ]
      },
      {
         "platform":"People",
         "threshold":15,
         "anyoneSensor":true,
         "nooneSensor":true,
         "webhookPort":51828,
         "cacheDirectory":"./.node-persist/storage",
         "pingInterval":10000,
         "ignoreReEnterExitSeconds":0,
         "people":[
            {
               "name":"Sam",
               "target":"192.168.1.86",
               "threshold":15,
               "pingInterval":10000,
               "ignoreReEnterExitSeconds":0
            },
            {
               "name":"Stuart",
               "target":"192.168.1.217",
               "threshold":15,
               "pingInterval":10000,
               "ignoreReEnterExitSeconds":0
            },
            {
               "name":"Kit",
               "target":"192.168.1.125",
               "threshold":15,
               "pingInterval":10000,
               "ignoreReEnterExitSeconds":0
            },
            {
               "name":"Laurence",
               "target":"192.168.1.115",
               "threshold":15,
               "pingInterval":10000,
               "ignoreReEnterExitSeconds":0
            }
         ]
      },
      {
         "platform":"cmdSwitch2",
         "switches":[
            {
               "name":"Kettle",
               "on_cmd":"/Users/churchserver/iBrew/ibrewlegacy heat 192.168.1.5",
               "off_cmd":"/Users/churchserver/iBrew/ibrewlegacy stop 192.168.1.5",
               "state_cmd":"/Users/churchserver/iBrew/ibrewlegacy status 192.168.1.5 | grep 'Heating water 100ºC selected'",
               "polling":true,
               "interval":10
            },
            {
               "name":"TV",
               "on_cmd":"python /Users/churchserver/python-broadlink/BlackBeanControl/BlackBeanControl.py -c PowerToshiba"
            },
            {
               "name":"Amp",
               "on_cmd":"python /Users/churchserver/python-broadlink/BlackBeanControl/BlackBeanControl.py -c PowerAmplifier"
            },
            {
               "name":"Mute TV",
               "on_cmd":"python /Users/churchserver/python-broadlink/BlackBeanControl/BlackBeanControl.py -c MuteTV"
            },
            {
               "name":"Wake ATV",
               "on_cmd":"python /Users/churchserver/python-broadlink/BlackBeanControl/BlackBeanControl.py -c WakeATV"
            },
            {
               "name":"Mute Amp",
               "on_cmd":"python /Users/churchserver/python-broadlink/BlackBeanControl/BlackBeanControl.py -c MuteAmp"
            }
         ]
      }
   ]
}
Church-Server:~ churchserver$ sudo homebridge
[1/13/2017, 3:56:23 PM] Loaded plugin: homebridge-camera-ffmpeg
[1/13/2017, 3:56:23 PM] Registering platform 'homebridge-camera-ffmpeg.Camera-ffmpeg'
[1/13/2017, 3:56:23 PM] ---
[1/13/2017, 3:56:23 PM] Loaded plugin: homebridge-cmdswitch2
[1/13/2017, 3:56:23 PM] Registering platform 'homebridge-cmdswitch2.cmdSwitch2'
[1/13/2017, 3:56:23 PM] ---
[1/13/2017, 3:56:23 PM] Loaded plugin: homebridge-dash
[1/13/2017, 3:56:23 PM] Registering accessory 'homebridge-dash.Dash'
[1/13/2017, 3:56:23 PM] ---
[1/13/2017, 3:56:23 PM] Loaded plugin: homebridge-milight
[1/13/2017, 3:56:23 PM] Registering platform 'homebridge-milight.MiLight'
[1/13/2017, 3:56:23 PM] ---
[1/13/2017, 3:56:23 PM] Loaded plugin: homebridge-people
[1/13/2017, 3:56:23 PM] Registering platform 'homebridge-people.People'
[1/13/2017, 3:56:23 PM] Registering accessory 'homebridge-people.PeopleAccessory'
[1/13/2017, 3:56:23 PM] Registering accessory 'homebridge-people.PeopleAllAccessory'
[1/13/2017, 3:56:23 PM] ---
[1/13/2017, 3:56:23 PM] Loaded plugin: homebridge-wemo
[1/13/2017, 3:56:23 PM] Registering accessory 'homebridge-wemo.WeMo'
[1/13/2017, 3:56:23 PM] ---
[1/13/2017, 3:56:23 PM] Loaded config.json with 2 accessories and 3 platforms.
[1/13/2017, 3:56:23 PM] ---
[1/13/2017, 3:56:23 PM] Loading 3 platforms...
[1/13/2017, 3:56:23 PM] Initializing Camera-ffmpeg platform...
[1/13/2017, 3:56:23 PM] Initializing People platform...
[1/13/2017, 3:56:23 PM] Initializing platform accessory 'Sam'...
[1/13/2017, 3:56:23 PM] Initializing platform accessory 'Stuart'...
[1/13/2017, 3:56:23 PM] Initializing platform accessory 'Kit'...
[1/13/2017, 3:56:23 PM] Initializing platform accessory 'Laurence'...
[1/13/2017, 3:56:23 PM] Initializing platform accessory 'Anyone'...
[1/13/2017, 3:56:23 PM] Initializing platform accessory 'No One'...
[1/13/2017, 3:56:23 PM] WebHook: Started server on port '51828'.
[1/13/2017, 3:56:23 PM] Initializing cmdSwitch2 platform...
[1/13/2017, 3:56:23 PM] Loading 2 accessories...
[1/13/2017, 3:56:23 PM] [HP Printer] Initializing WeMo accessory...
[1/13/2017, 3:56:23 PM] [HP Printer] Searching for WeMo device with exact name 'WeMo Switch'...
[1/13/2017, 3:56:23 PM] [Light Dash] Initializing Dash accessory...
Scan this code with your HomeKit App on your iOS device to pair with Homebridge:

    ┌────────────┐     
    │ 031-45-154 │     
    └────────────┘     

[1/13/2017, 3:56:23 PM] Initializing platform accessory 'Kettle'...
[1/13/2017, 3:56:23 PM] Initializing platform accessory 'TV'...
[1/13/2017, 3:56:23 PM] Initializing platform accessory 'Amp'...
[1/13/2017, 3:56:23 PM] Initializing platform accessory 'Mute TV'...
[1/13/2017, 3:56:23 PM] Initializing platform accessory 'Wake ATV'...
[1/13/2017, 3:56:23 PM] Initializing platform accessory 'Mute Amp'...
[1/13/2017, 3:56:23 PM] Homebridge is running on port 51826.
[1/13/2017, 3:56:23 PM] Sam's Room is running on port 63712.
[1/13/2017, 3:56:23 PM] Mute Amp is off.
[1/13/2017, 3:56:23 PM] Wake ATV is off.
[1/13/2017, 3:56:23 PM] Mute TV is off.
[1/13/2017, 3:56:23 PM] Amp is off.
[1/13/2017, 3:56:23 PM] TV is off.
[1/13/2017, 3:56:24 PM] [HP Printer] Found 'WeMo Switch' device at 192.168.1.227
[1/13/2017, 3:56:35 PM] Kettle is off.
[1/13/2017, 3:56:35 PM] [HP Printer] Getting power state on the 'WeMo Switch'...
[1/13/2017, 3:56:35 PM] Wake ATV is off.
[1/13/2017, 3:56:35 PM] TV is off.
[1/13/2017, 3:56:35 PM] Mute Amp is off.
[1/13/2017, 3:56:35 PM] Amp is off.
[1/13/2017, 3:56:35 PM] Mute TV is off.
[1/13/2017, 3:56:35 PM] [HP Printer] Power state for the 'WeMo Switch' is 1
samsonrosen commented 7 years ago

Ignore me! I realised that libpcap-dev is installed by default and that I couldn't trust the Mac address I got from my AirPort Extreme ;)

Thanks!s