Skip to content

The script queries the ha-bridge for configured devices, and determines if they are mqtt or X10 devices. It then gets the state of each mqtt and X10 device and updates the ha-bridge with that on/off and dim state as applicable.

License

Notifications You must be signed in to change notification settings

audiofreak9/ha-bridge-device-state-update

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 

Repository files navigation

ha-bridge-device-state-update

The Python script queries the ha-bridge for configured devices, and determines if they are mqtt or X10 devices. It then gets the state of each X10 device from HEYU‘s state engine and stored mqtt message states from the broker and updates the ha-bridge with that on/off and dim state as applicable.

Prerequisite components

  • Linux box, preferably a Raspberry Pi, with Python installed

  • Complete my Amazon Echo X10 Home Control tutorial

  • Set the directive “START_ENGINE AUTO” in the HEYU configuration file

  • Mosquitto broker (or the like) installed on your RPi, NOTE: Remember to set 'retain' to 'true' for your mqtt devices on HA-Bridge so the broker retains states

Install

  • Copy the devices.py file to your "habridge" directory on the Raspberry Pi.

  • Make the script executable: $ sudo chmod +x devices.py

  • Replace the [IP] variables in the code with your IPs.

  • Replace the [USER] and [PASS] variables in the code with your usernames and passwords.

Usage

  • From the command line: $ python devices.py

  • In a cronjob */10 * * * * python /home/pi/habridge/devices.py > /dev/null 2>&1

About

The script queries the ha-bridge for configured devices, and determines if they are mqtt or X10 devices. It then gets the state of each mqtt and X10 device and updates the ha-bridge with that on/off and dim state as applicable.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages