Selenium Script for ADT Pulse

Posted on
Sat Jul 25, 2020 11:34 am
ryanbuckner online
Posts: 350
Joined: Oct 08, 2011

Selenium Script for ADT Pulse

Since there's no open API for ADT Pulse, I wrote a short Selenium script to disarm my alarm each morning. It's flawed, I know, butI thought I'd share in case someone wants to improve it with error handling and better security:

Note: you'll need to download the chrome selenium webdriver exe and place it in the path you declare below

Code: Select all
from selenium import webdriver
from import By
import time

boolSuccess = False
strSuccessMsg = ""
pulseUrl = ''
usr = ''
pwd = 'xxxxxxx'

# indigo.variable.updateValue(1788108465, value="False")

# path to the Chrome webdriver
driver = webdriver.Chrome(executable_path='/Library/Application Support/Perceptive Automation/Python2-includes/chromedriver')
time.sleep(5)  # Let the user actually see something!

# Login
login_box = driver.find_element_by_name('usernameForm')

# Login
pwd_box = driver.find_element_by_name('passwordForm')

# Password
submit_ = driver.find_element_by_name("signin")

indigo.server.log("logged in")

# click the Disarm button if it exists
messages = driver.find_elements_by_class_name("p_boldNormalTextLarge");
for x in messages:
    if (x.text.split()[0] == "Armed"):
        indigo.server.log("logged in. disarming...")
        strSuccessMsg = "Disarm button pressed"
        boolSuccess = True
    elif (x.text.split()[0] == "Disarmed."):
        #indigo.server.log("Alarm is disarmed. arming...")
        strSuccessMsg = "Alarm is already disarmed"
        # use this space to arm in future
        strSuccessMsg = "Message: " + x.text
        boolSuccess = False



driver.close()  # close the focus window

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 0 guests