diff --git a/docs/HOME_ASSISTANT.md b/docs/HOME_ASSISTANT.md new file mode 100755 index 00000000..bf7882a5 --- /dev/null +++ b/docs/HOME_ASSISTANT.md @@ -0,0 +1,37 @@ +# Overview + +PiAlert comes with MQTT support, allowing you to show all detected devices as devices in Home Assistant. It also supplies a collection of stats, such as number of online devices. + + +## 🧭 Guide + +> 💡 This guide was tested only with the Mosquitto MQTT broker + +1. Enable Mosquitto MQTT in Home Assistant by following the [documentation](https://www.home-assistant.io/integrations/mqtt/) + +2. Configure a user name and password on your broker. + +3. Note down the following details that you will need to configure PiAlert: + - MQTT host url (usually your Home Assistant IP) + - MQTT broker port + - User + - Password + +4. Ope the `PiAlert` > `Settings` > `MQTT` settings group + - Enable MQTT + - Fill in the details from above + - Fill in remaining settings as per description + + +## 📷 Screenshots + + | ![Screen 1][sensors] | ![Screen 2][history] | + |----------------------|----------------------| + | ![Screen 3][list] | ![Screen 4][overview] | + + + [sensors]: ./docs/img/HOME_ASISSTANT/PiAlert-HomeAssistant-Device-as-Sensors.png "sensors" + [history]: ./docs/img/HOME_ASISSTANT/PiAlert-HomeAssistant-Device-Presence-History "history" + [list]: ./docs/img/HOME_ASISSTANT/PiAlert-HomeAssistant-Devices-List.png "list" + [overview]: ./docs/img/HOME_ASISSTANT/PiAlert-HomeAssistant-Overview-Card.png "overview" + diff --git a/docs/img/HOME_ASISSTANT/PiAlert-HomeAssistant-Device-Presence-History.png b/docs/img/HOME_ASISSTANT/PiAlert-HomeAssistant-Device-Presence-History.png new file mode 100755 index 00000000..ef3b3dfa Binary files /dev/null and b/docs/img/HOME_ASISSTANT/PiAlert-HomeAssistant-Device-Presence-History.png differ diff --git a/docs/img/HOME_ASISSTANT/PiAlert-HomeAssistant-Device-as-Sensors.png b/docs/img/HOME_ASISSTANT/PiAlert-HomeAssistant-Device-as-Sensors.png new file mode 100755 index 00000000..fa23f03f Binary files /dev/null and b/docs/img/HOME_ASISSTANT/PiAlert-HomeAssistant-Device-as-Sensors.png differ diff --git a/docs/img/HOME_ASISSTANT/PiAlert-HomeAssistant-Devices-List.png b/docs/img/HOME_ASISSTANT/PiAlert-HomeAssistant-Devices-List.png new file mode 100755 index 00000000..e2f4b1d7 Binary files /dev/null and b/docs/img/HOME_ASISSTANT/PiAlert-HomeAssistant-Devices-List.png differ diff --git a/docs/img/HOME_ASISSTANT/PiAlert-HomeAssistant-Overview-Card.png b/docs/img/HOME_ASISSTANT/PiAlert-HomeAssistant-Overview-Card.png new file mode 100755 index 00000000..9d90d04b Binary files /dev/null and b/docs/img/HOME_ASISSTANT/PiAlert-HomeAssistant-Overview-Card.png differ diff --git a/pialert/device.py b/pialert/device.py index 38308d48..f712deed 100755 --- a/pialert/device.py +++ b/pialert/device.py @@ -19,10 +19,6 @@ def save_scanned_devices (db, p_arpscan_devices, p_cycle_interval): mylog('debug', ['[ARP Scan] Detected devices:', len(p_arpscan_devices)]) - p_arpscan_devices = conf.arpscan_devices - - mylog('debug', ['[ARP Scan] Detected devices in conf:', len(p_arpscan_devices)]) - # Delete previous scan data sql.execute ("DELETE FROM CurrentScan WHERE cur_ScanCycle = ?", (cycle,)) diff --git a/pialert/scanners/arpscan.py b/pialert/scanners/arpscan.py index e3077a24..14a9a7c6 100755 --- a/pialert/scanners/arpscan.py +++ b/pialert/scanners/arpscan.py @@ -50,7 +50,7 @@ def execute_arpscan_on_interface (interface): result = subprocess.check_output (arpscan_args, universal_newlines=True) except subprocess.CalledProcessError as e: # An error occured, handle it - mylog('none', ['[ARP Scan]', e.output]) + mylog('none', ['[ARP Scan] Error: ', e.output]) result = "" mylog('debug', ['[ARP Scan] on Interface Completed with results: ', result])