forked from mysensors/Vera
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathI_Arduino1.xml
140 lines (118 loc) · 4.61 KB
/
I_Arduino1.xml
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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
<?xml version="1.0"?>
<implementation>
<functions>
local p
function startup(lul_device)
luup.log("Arduino plugin: loading library L_Arduino ...")
if (package.path:find ("/etc/cmh-ludl/?.lua;/etc/cmh-lu/?.lua", 1, true) == nil) then
package.path = package.path .. ";/etc/cmh-ludl/?.lua;/etc/cmh-lu/?.lua"
end
package.loaded.L_Arduino = nil
p = require("L_Arduino")
if (package.loaded.L_Arduino == nil)
then
luup.log("Arduino plugin: plugin is not installed correctly. Library L_Arduino cannot be loaded.", 1)
luup.task("Plugin not correctly installed", 2, "Arduino plugin", -1)
return false
end
luup.log("Arduino plugin: library L_Arduino loaded")
return p.startup(lul_device)
end
</functions>
<incoming>
<lua>if (p ~= nil) then p.processIncoming(lul_data) end</lua>
</incoming>
<startup>startup</startup>
<actionList>
<action>
<serviceId>urn:upnp-org:serviceId:SwitchPower1</serviceId>
<name>SetTarget</name>
<run>if (p ~= nil) then p.switchPower(lul_device, lul_settings.newTargetValue) end</run>
</action>
<action>
<serviceId>urn:upnp-org:serviceId:Dimming1</serviceId>
<name>SetLoadLevelTarget</name>
<run>if (p ~= nil) then p.setDimmerLevel(lul_device, lul_settings.newLoadlevelTarget) end</run>
</action>
<action>
<serviceId>urn:micasaverde-com:serviceId:DoorLock1</serviceId>
<name>SetTarget</name>
<run>if (p ~= nil) then p.setLockStatus(lul_device, lul_settings.newTargetValue) end</run>
</action>
<action>
<serviceId>urn:upnp-org:serviceId:TemperatureSetpoint1_Heat</serviceId>
<name>SetCurrentSetpoint</name>
<run>if (p ~= nil) then p.SetTheNewTemp(lul_device, lul_settings.NewCurrentSetpoint) end</run>
</action>
<action>
<serviceId>urn:upnp-org:serviceId:HVAC_UserOperatingMode1</serviceId>
<name>SetModeTarget</name>
<run>if (p ~= nil) then p.SetModeTarget(lul_device, lul_settings.NewModeTarget) end</run>
</action>
<action>
<serviceId>urn:upnp-org:serviceId:WindowCovering1</serviceId>
<name>Up</name>
<run>if (p ~= nil) then p.windowCovering(lul_device, "UP") end</run>
</action>
<action>
<serviceId>urn:upnp-org:serviceId:WindowCovering1</serviceId>
<name>Down</name>
<run>if (p ~= nil) then p.windowCovering(lul_device, "DOWN") end</run>
</action>
<action>
<serviceId>urn:upnp-org:serviceId:WindowCovering1</serviceId>
<name>Stop</name>
<run>if (p ~= nil) then p.windowCovering(lul_device, "STOP") end</run>
</action>
<action>
<serviceId>urn:micasaverde-com:serviceId:SecuritySensor1</serviceId>
<name>SetArmed</name>
<run>if (p ~= nil) then p.setArmed(lul_device, lul_settings.newArmedValue) end</run>
</action>
<action>
<serviceId>urn:upnp-arduino-cc:serviceId:arduino1</serviceId>
<name>SendCommand</name>
<run>if (p ~= nil) then p.sendCommand(lul_settings.radioId, lul_settings.variableId, lul_settings.value) end</run>
</action>
<action>
<serviceId>urn:upnp-arduino-cc:serviceId:arduinonode1</serviceId>
<name>SendNodeCommand</name>
<run>if (p ~= nil) then p.sendNodeCommand(lul_device, lul_settings.variableId, lul_settings.value) end</run>
</action>
<action>
<serviceId>urn:upnp-arduino-cc:serviceId:arduinonode1</serviceId>
<name>FetchChildren</name>
<run>if (p ~= nil) then p.fetchChildren(lul_device) end</run>
</action>
<action>
<serviceId>urn:upnp-arduino-cc:serviceId:arduinonode1</serviceId>
<name>ClearChildren</name>
<run>if (p ~= nil) then p.clearChildren(lul_device) end</run>
</action>
<action>
<serviceId>urn:upnp-arduino-cc:serviceId:arduinonode1</serviceId>
<name>RefreshRelay</name>
<run>if (p ~= nil) then p.refreshRelay(lul_device) end</run>
</action>
<action>
<serviceId>urn:upnp-arduino-cc:serviceId:arduino1</serviceId>
<name>SetUnit</name>
<run>if (p ~= nil) then p.setUnit(lul_settings.unit) end</run>
</action>
<action>
<serviceId>urn:upnp-arduino-cc:serviceId:arduino1</serviceId>
<name>StartInclusion</name>
<run>if (p ~= nil) then p.startInclusion(lul_device) end</run>
</action>
<action>
<serviceId>urn:upnp-arduino-cc:serviceId:arduino1</serviceId>
<name>StopInclusion</name>
<run>if (p ~= nil) then p.stopInclusion(lul_device) end</run>
</action>
<action>
<serviceId>urn:upnp-org:serviceId:ArduinoIr1</serviceId>
<name>SendIrCommand</name>
<run>if (p ~= nil) then p.sendIrCommand(lul_device, lul_settings.irCodeNumber) end</run>
</action>
</actionList>
</implementation>