forked from falk0069/hue-upnp
-
Notifications
You must be signed in to change notification settings - Fork 1
/
hueUpnp_config.py
executable file
·67 lines (61 loc) · 2.41 KB
/
hueUpnp_config.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
# Some Global Variables
standard = {
#Start with a '-d' to force debug mode
'DEBUG': True,
#Standard Broadcast IP UPNP
'BCAST_IP': "239.255.255.250",
#Standard UPNP Port
'UPNP_PORT': 1900,
# Seconds between upnp broadcast
'BROADCAST_INTERVAL': 200,
# Callback http webserver IP (this machine)
'IP': "192.168.1.200",
# HTTP-port to serve icons, xml, json (80 is most compatible but requires root)
'HTTP_PORT': 8080,
# shouldn't matter but feel free to adjust
'GATEWAYIP': "192.168.1.1",
# shouldn't matter but feel free to adjust
'MACADDRESS': "aa:bb:cc:dd:ee:ff",
# Set default ON state for all device to "true" or "false" when first starting
'DEFAULT_ON_STATE': "false",
# Set default BRIGHTNESS state for all device to a value 0-254 when first starting
'DEFAULT_BRI_STATE': 0,
}
# Define all the devices to be controlled
# E.g. ('Hue Light 1', ('script_handler', './hue-upnp-helper.sh')),
# Where
# 'Hue Light 1' is the name of the device you want
# 'script_handler' is the handler (only script_handler and isy_rest_handler)
# './hue-upnp-helper.sh' is the script to run.
#
# For differences between some commands: on, bri, ct, xy see:
# http://www.developers.meethue.com/documentation/core-concepts
#
# Addition notes on handlers:
# isy_rest_handler: This will send commands to the ISY home automation control
# You need to specify the address as the second parameter
#
# script_handler: This is a basic script to kick off. The second parameter is
# the script to execute. Three parameters will then be passed to it.
# 1) The name of the device
# 2) The directive: on, bri, ct, xy
# 3) The value: Examples: true/false, 0-254, [0.675,0.322]
#devices = {
# #'Floor Lamp': ('isy_rest_handler', '2E 59 94 1'),
# 'PC WOL': ('script_handler', './hue-upnp-helper.sh'),
# 'Wemo Outlet': ('script_handler', './hue-upnp-helper.sh'),
# 'Wemo Light': ('script_handler', './hue-upnp-helper.sh'),
#}
from collections import OrderedDict
devices = OrderedDict([
#('Floor Lamp', ('isy_rest_handler', '2E 59 94 1')),
('PC WOL', ('script_handler', './hue-upnp-helper.sh')),
('Wemo Outlet', ('script_handler', './hue-upnp-helper.sh')),
('Wemo Light', ('script_handler', './hue-upnp-helper.sh')),
])
# If using the ISY calls, set your info here:
isy = {
'ip': '192.168.1.xxx',
'username': 'your_user_name',
'password': 'your_password',
}