lifx_dash(1) -- Toggle LIFX lights with an Amazon Dash button ============================================================= ## SYNOPSIS `lifx_dash` `monitor` -m DASH_MAC_ADDRESS -t LIFX_API_TOKEN
`lifx_dash` `snoop`
`lifx_dash` `config` ## DESCRIPTION **lifx_dash** is a simple command-line tool to monitor your network for Amazon Dash button presses and toggle LIFX lights ON and OFF. The tool provides two commands, `monitor` and `snoop`. Use `snoop` to listen for Dash presses on your network, and identify the button's MAC address. Use `monitor` (with a MAC address and LIFX HTTP API token) to respond to presses, and toggle your lights ON and OFF. You can optionally pass a bulb selector, or choose to daemonize the `monitor` process. A `config` command also exists, allowing you to set default options for `monitor` and `snoop`. ## REQUIREMENTS `lifx_dash` requires at least one LIFX bulb, and any Amazon Dash button. You will also need a wifi network and root access to sniff packets on your network adaptor. Follow Amazon's Dash button setup steps, but **stop** before choosing any particular product to purchase. You aill also need a free LIFX API token from here: [https://cloud.lifx.com/settings](https://cloud.lifx.com/settings) ## OPTIONS The snoop command has one optional flag, the network interface to listen on. * `-i`, `--iface=arg`: Network Interface (default: en0) Wait for the network to quiet down, before pressing the button, since other devices may respond with ARP packets of their own when you press. Take care to choose the MAC address from the ARP packet that occurs only once from a single MAC address. The `monitor` command accepts the following flags, both a mac address and api token are required. * `-m`, `--mac-address=arg`: Dash button MAC Address (required) * `-t`, `--token=arg`: LIFX HTTP API Token (required) * `-s`, `--selector=arg`: LIFX Bulb Selector (default: all) * `-i`, `--iface=arg`: Network Interface (default: en0) * `-d`, `--[no-]daemonize`: Dameonize the monitor process (default: no) * `-l`, `--log-file`: Log file location (when running as a daemon) (default: /tmp/lifx_dash.log) ## EXAMPLES Get help on command options and arguments $ lifx_dash -h $ lifx_dash monitor -h $ lifx_dash snoop --help Snoop for Dash button presses on en1 $ lifx_dash snoop en1 Monitor Dash button presses on en0 with DASH_MAC_ADDRESS and LIFX_API_TOKEN, when pressed, toggle all lights $ lifx_dash monitor -t LIFX_API_TOKEN -m DASH_MAC_ADDRESS Monitor Dash button presses on en1 with a DASH_MAC_ADDRESS and LIFX_API_TOKEN, when pressed toggle the light with id 'd3b2f2d97459' $ lifx_dash monitor --token=LIFX_API_TOKEN --mac-address=DASH_MAC_ADDRESS -s 'd3b2f2d97459' -i en1 Show the current configuration file options $ lifx_dash config -s ## FILES Use the `config` command to set values for the command options. These will be saved to: ~/.lifx_dash.rc.yml and used as defaults. They can still be overridden by any arguments passed on the command line. If running as a daemon (-d switch), the `lifx_dash monitor` command will log to `/tmp/lifx_dash.log` by default. Use the --log-file flag to override this. ## BUGS No known bugs. Please report issues here: [https://github.com/matthutchinson/lifx_dash/issues](https://github.com/matthutchinson/lifx_dash/issues) ## LICENSE The MIT License: [https://raw.githubusercontent.com/matthutchinson/lifx_dash/master/LICENSE.txt](https://raw.githubusercontent.com/matthutchinson/lifx_dash/master/LICENSE.txt) ## COPYRIGHT Copyright (c) 2016 Matthew Hutchinson ## AUTHOR Matthew Hutchinson, [https://matthewhutchinson.net](https://matthewhutchinson.net) ## SEE ALSO * [https://rubygems.org/gems/lifx_dash](https://rubygems.org/gems/lifx_dash) * [https://github.com/matthutchinson/lifx_dash](https://github.com/matthutchinson/lifx_dash) * [https://cloud.lifx.com/settings](https://cloud.lifx.com/settings) * [http://tinyurl.com/zujfkjs](http://tinyurl.com/zujfkjs)