forked from jollyjinx/homematic
-
Notifications
You must be signed in to change notification settings - Fork 0
/
InformationDump.hms
168 lines (138 loc) · 5.83 KB
/
InformationDump.hms
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
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
!https://github.com/jollyjinx/homematic/blob/master/InformationDump.hms
!
! This script dumps information on Homematic CCU2 connected devices,functions,variables and more.
! It might help you in finding out how to find out things with homematic script.
!
WriteLine("Executing HM Script now");
string itemID;
foreach (itemID, dom.GetObject(ID_PROGRAMS).EnumUsedIDs())
{
WriteLine("Program ID:"#itemID);
var item = dom.GetObject(itemID);
WriteLine("Program:"#item);
WriteLine("Program Last Run:"#item.Variable());
}
foreach (itemID, dom.GetObject(ID_SYSTEM_VARIABLES).EnumUsedIDs())
{
WriteLine("Variable id:"#itemID);
var item = dom.GetObject(itemID);
WriteLine("Variable:"#item);
}
foreach (itemID, dom.GetObject(ID_FUNCTIONS).EnumUsedIDs())
{
WriteLine("Function id:"#itemID);
var item = dom.GetObject(itemID);
WriteLine("Function name:"#item);
}
foreach (itemID, dom.GetObject(ID_CHANNELS).EnumUsedIDs())
{
WriteLine("Channel id:"#itemID);
var item = dom.GetObject(itemID);
WriteLine("Channel:"#item);
}
foreach (itemID, dom.GetObject(ID_INTERFACES).EnumUsedIDs())
{
WriteLine("Interface id:"#itemID);
var item = dom.GetObject(itemID);
WriteLine("Interface:"#item);
}
foreach (itemID, dom.GetObject(ID_DATAPOINTS).EnumUsedIDs())
{
WriteLine("Datapoint id:"#itemID);
var item = dom.GetObject(itemID);
WriteLine("Datapoint:"#item);
}
foreach (itemID, dom.GetObject(ID_ROOMS).EnumUsedIDs())
{
WriteLine("Room ID:"#dom.GetObject(itemID));
var item = dom.GetObject(itemID);
WriteLine("Room:"#item);
}
foreach (itemID, dom.GetObject(ID_STRUCTURE).EnumUsedIDs())
{
WriteLine("Structure ID:"#dom.GetObject(itemID));
var item = dom.GetObject(itemID);
WriteLine("Structure:"#item);
}
string deviceid;
foreach(deviceid, dom.GetObject(ID_DEVICES).EnumUsedIDs())
{
WriteLine("DeviceID:"#deviceid);
var device=dom.GetObject(deviceid);
WriteLine("Device:"#device);
WriteLine("\t device.Address:"#device.Address());
WriteLine("\t device.Name:"#device.Name());
WriteLine("\t device.DataValue:"#device.DataValue());
! WriteLine("\t device.LastDPActionTime:"#device.LastDPActionTime());
! WriteLine("\t device.ChnRoom:"#device.ChnRoom());
WriteLine("\t device.PrgInfo:"#device.PrgInfo());
WriteLine("\t device.PrgInfo:"#device.PrgInfo().Value());
WriteLine("\t device.DestinationChannel:"#device.DestinationChannel());
WriteLine("\t device.DPInfo:"#device.DPInfo());
WriteLine("\t device.HSSID:"#device.HSSID());
WriteLine("\t device.IsTypeOf:"#device.IsTypeOf());
WriteLine("\t device.Operations:"#device.Operations());
string operationid;
foreach(operationid,device.Operations().EnumUsedIDs())
{
var operation=dom.GetObject(operationid);
WriteLine("\t\t device.operation:"#operation);
}
string dpid;
foreach(dpid,device.DPs().EnumUsedIDs())
{
var dp=dom.GetObject(dpid);
WriteLine("\t\t device.dpids:"#dp);
}
string channelid;
foreach(channelid,device.Channels().EnumUsedIDs())
{
var channel=dom.GetObject(channelid);
WriteLine("\t Channel:"#channel#"\t channel.Name:"#channel.Name());
WriteLine("\t\t channel.ChnFunction:"#channel.ChnFunction());
WriteLine("\t\t channel.Address:"#channel.Address());
WriteLine("\t\t channel.ChnLabel:"#channel.ChnLabel());
WriteLine("\t\t channel.ChnFunction:"#channel.ChnFunction());
WriteLine("\t\t channel.ChnArchive:"#channel.ChnArchive());
WriteLine("\t\t channel.ChnDirection:"#channel.ChnDirection());
WriteLine("\t\t channel.DPInfo:"#channel.DPInfo());
WriteLine("\t\t channel.LastDPActionTime:"#channel.LastDPActionTime());
WriteLine("\t\t channel.DestinationDP:"#channel.DestinationDP());
WriteLine("\t\t channel.DataValue:"#channel.DataValue());
WriteLine("\t\t channel.ChnGroupPartnerId:"#channel.ChnGroupPartnerId());
WriteLine("\t\t channel.DestinationChannel:"#channel.DestinationChannel());
WriteLine("\t\t channel.HSSID:"#channel.HSSID());
WriteLine("\t\t channel.IsTypeOf:"#channel.IsTypeOf());
var interface=dom.GetObject(channel.Interface());
WriteLine("\t\t channel.Interface:"#interface);
WriteLine("\t\t channel.Interface.Name:"#interface.Name());
!WriteLine("\t\t channel.Interface.Operations:"#interface.Operations());
!WriteLine("\t\t channel.Interface.Operations.Value:"#interface.Operations().Value());
!WriteLine("\t\t channel.Operations:"#channel.Operations());
!string dpid;
foreach(operationid,channel.DPs().EnumUsedIDs())
{
var datapoint=dom.GetObject(operationid);
Write("\t\t\t channel.datapoint:"#datapoint#"\t"#datapoint.ValueType()#"\t Value:"#datapoint.Value()#"\t LastValue:"#datapoint.LastValue()#"\t Timestamp:"#datapoint.Timestamp()#"\t");
if(OPERATION_READ & datapoint.Operations()) { Write("READ "); }
if(OPERATION_WRITE & datapoint.Operations()) { Write("WRITE "); }
if(OPERATION_EVENT & datapoint.Operations()) { Write("EVENT "); }
WriteLine("");
}
string rid;
foreach(rid,channel.ChnRoom().EnumUsedIDs())
{
var room=dom.GetObject(rid);
WriteLine("\t\t roomid:"#rid#"\t room:"#room#"\t room.Name:"#room.Name());
}
foreach(rid,channel.ChnFunction().EnumUsedIDs())
{
var function=dom.GetObject(rid);
WriteLine("\t\t functionid:"#rid#"\t function:"#function#"\t function.Name:"#function.Name());
}
WriteLine("");
}
var interface=dom.GetObject(device.Interface());
WriteLine("\t device.Interface:"#interface);
WriteLine("\t device.Interface.Name:"#interface.Name());
}