forked from OpenZWave/python-openzwave
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcommand.html
More file actions
745 lines (715 loc) · 44.4 KB
/
command.html
File metadata and controls
745 lines (715 loc) · 44.4 KB
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
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Command documentation — python-openzwave 0.3.0b5 documentation</title>
<link rel="stylesheet" href="_static/default.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: './',
VERSION: '0.3.0b5',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true
};
</script>
<script type="text/javascript" src="_static/jquery.js"></script>
<script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script>
<link rel="top" title="python-openzwave 0.3.0b5 documentation" href="index.html" />
<link rel="up" title="API documentation" href="openzwave.html" />
<link rel="next" title="Group documentation" href="group.html" />
<link rel="prev" title="Node documentation" href="node.html" />
</head>
<body>
<div class="related">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="genindex.html" title="General Index"
accesskey="I">index</a></li>
<li class="right" >
<a href="py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li class="right" >
<a href="group.html" title="Group documentation"
accesskey="N">next</a> |</li>
<li class="right" >
<a href="node.html" title="Node documentation"
accesskey="P">previous</a> |</li>
<li><a href="index.html">python-openzwave 0.3.0b5 documentation</a> »</li>
<li><a href="openzwave.html" accesskey="U">API documentation</a> »</li>
</ul>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body">
<div class="section" id="command-documentation">
<h1>Command documentation<a class="headerlink" href="#command-documentation" title="Permalink to this headline">¶</a></h1>
<p>The commands to use with nodes.</p>
<div class="toctree-wrapper compound">
<ul class="simple">
</ul>
</div>
<span class="target" id="module-openzwave.command"></span><span class="target" id="module-openzwave.command"></span><dl class="docutils">
<dt>This file is part of <strong>python-openzwave</strong> project <a class="reference external" href="https://github.com/OpenZWave/python-openzwave">https://github.com/OpenZWave/python-openzwave</a>.</dt>
<dd><table class="first last docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">platform:</th><td class="field-body">Unix, Windows, MacOS X</td>
</tr>
<tr class="field-even field"><th class="field-name">sinopsis:</th><td class="field-body">openzwave wrapper</td>
</tr>
</tbody>
</table>
</dd>
</dl>
<p>License : GPL(v3)</p>
<p><strong>python-openzwave</strong> is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.</p>
<p><strong>python-openzwave</strong> is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with python-openzwave. If not, see <a class="reference external" href="http://www.gnu.org/licenses">http://www.gnu.org/licenses</a>.</p>
<dl class="class">
<dt id="openzwave.command.ZWaveNodeBasic">
<em class="property">class </em><tt class="descclassname">openzwave.command.</tt><tt class="descname">ZWaveNodeBasic</tt><a class="headerlink" href="#openzwave.command.ZWaveNodeBasic" title="Permalink to this definition">¶</a></dt>
<dd><p>Represents an interface to BasicCommands
I known it’s not necessary as they can be included in the node directly.
But it’s a good starting point.</p>
<p>What I want to do is provide an automatic mapping system hidding
the mapping classes.</p>
<p>First example, the battery level, it’s not a basic command but don’t care.
Its command class is 0x80.</p>
<p>A user should write</p>
<div class="highlight-python"><div class="highlight"><pre><span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">handle_command_class</span><span class="p">(</span><span class="n">class_id</span><span class="p">):</span>
<span class="n">ret</span><span class="o">=</span><span class="n">command_Class</span><span class="p">(</span><span class="o">...</span><span class="p">)</span>
</pre></div>
</div>
<p>The classic way to do it is a classic method of registering. But</p>
<p>Another way : using heritage multiple</p>
<p>ZWaveNode(ZWaveObject, ZWaveNodeBasic, ....)
The interface will implement methods
command_class_0x80(param1,param2,...)
That’s the first thing to do
We also can define a property with a friendly name</p>
<p>handle_command_class will do the rest</p>
<p>Another way to do it :
A node can manage actuators (switch, dimmer, ...)
and sensors (temperature, consummation, temperature)</p>
<p>So we need a kind of mechanism to retrieve commands in a user friendly way
Same for sensors.</p>
<p>A good use case is the AN158 Plug-in Meter Appliance Module
We will study the following command classes :
‘COMMAND_CLASS_SWITCH_ALL’, ‘COMMAND_CLASS_SWITCH_BINARY’,
‘COMMAND_CLASS_METER’,</p>
<p>The associated values are :</p>
<div class="highlight-python"><div class="highlight"><pre><span class="n">COMMAND_CLASS_SWITCH_ALL</span> <span class="p">:</span> <span class="p">{</span>
<span class="il">72057594101481476L</span><span class="p">:</span> <span class="p">{</span>
<span class="s">'help'</span><span class="p">:</span> <span class="s">''</span><span class="p">,</span>
<span class="s">'max'</span><span class="p">:</span> <span class="il">0L</span><span class="p">,</span>
<span class="s">'is_polled'</span><span class="p">:</span> <span class="bp">False</span><span class="p">,</span>
<span class="s">'units'</span><span class="p">:</span> <span class="s">''</span><span class="p">,</span>
<span class="s">'data'</span><span class="p">:</span> <span class="s">'On and Off Enabled'</span><span class="p">,</span>
<span class="s">'min'</span><span class="p">:</span> <span class="il">0L</span><span class="p">,</span>
<span class="s">'writeonly'</span><span class="p">:</span> <span class="bp">False</span><span class="p">,</span>
<span class="s">'label'</span><span class="p">:</span> <span class="s">'Switch All'</span><span class="p">,</span>
<span class="s">'readonly'</span><span class="p">:</span> <span class="bp">False</span><span class="p">,</span>
<span class="s">'data_str'</span><span class="p">:</span> <span class="s">'On and Off Enabled'</span><span class="p">,</span>
<span class="s">'type'</span><span class="p">:</span> <span class="s">'List'</span><span class="p">}</span>
<span class="p">}</span>
<span class="n">COMMAND_CLASS_SWITCH_BINARY</span> <span class="p">:</span> <span class="p">{</span>
<span class="il">72057594093060096L</span><span class="p">:</span> <span class="p">{</span>
<span class="s">'help'</span><span class="p">:</span> <span class="s">''</span><span class="p">,</span>
<span class="s">'max'</span><span class="p">:</span> <span class="il">0L</span><span class="p">,</span>
<span class="s">'is_polled'</span><span class="p">:</span> <span class="bp">False</span><span class="p">,</span>
<span class="s">'units'</span><span class="p">:</span> <span class="s">''</span><span class="p">,</span>
<span class="s">'data'</span><span class="p">:</span> <span class="bp">False</span><span class="p">,</span>
<span class="s">'min'</span><span class="p">:</span> <span class="il">0L</span><span class="p">,</span>
<span class="s">'writeonly'</span><span class="p">:</span> <span class="bp">False</span><span class="p">,</span>
<span class="s">'label'</span><span class="p">:</span> <span class="s">'Switch'</span><span class="p">,</span>
<span class="s">'readonly'</span><span class="p">:</span> <span class="bp">False</span><span class="p">,</span>
<span class="s">'data_str'</span><span class="p">:</span> <span class="bp">False</span><span class="p">,</span>
<span class="s">'type'</span><span class="p">:</span> <span class="s">'Bool'</span><span class="p">}</span>
<span class="p">}</span>
<span class="n">COMMAND_CLASS_METER</span> <span class="p">:</span> <span class="p">{</span>
<span class="il">72057594093273600L</span><span class="p">:</span> <span class="p">{</span>
<span class="s">'help'</span><span class="p">:</span> <span class="s">''</span><span class="p">,</span>
<span class="s">'max'</span><span class="p">:</span> <span class="il">0L</span><span class="p">,</span>
<span class="s">'is_polled'</span><span class="p">:</span> <span class="bp">False</span><span class="p">,</span>
<span class="s">'units'</span><span class="p">:</span> <span class="s">''</span><span class="p">,</span>
<span class="s">'data'</span><span class="p">:</span> <span class="bp">False</span><span class="p">,</span>
<span class="s">'min'</span><span class="p">:</span> <span class="il">0L</span><span class="p">,</span>
<span class="s">'writeonly'</span><span class="p">:</span> <span class="bp">False</span><span class="p">,</span>
<span class="s">'label'</span><span class="p">:</span> <span class="s">'Exporting'</span><span class="p">,</span>
<span class="s">'readonly'</span><span class="p">:</span> <span class="bp">True</span><span class="p">,</span>
<span class="s">'data_str'</span><span class="p">:</span> <span class="bp">False</span><span class="p">,</span>
<span class="s">'type'</span><span class="p">:</span> <span class="s">'Bool'</span><span class="p">},</span>
<span class="il">72057594101662232L</span><span class="p">:</span> <span class="p">{</span>
<span class="s">'help'</span><span class="p">:</span> <span class="s">''</span><span class="p">,</span>
<span class="s">'max'</span><span class="p">:</span> <span class="il">0L</span><span class="p">,</span>
<span class="s">'is_polled'</span><span class="p">:</span> <span class="bp">False</span><span class="p">,</span>
<span class="s">'units'</span><span class="p">:</span> <span class="s">''</span><span class="p">,</span>
<span class="s">'data'</span><span class="p">:</span> <span class="s">'False'</span><span class="p">,</span>
<span class="s">'min'</span><span class="p">:</span> <span class="il">0L</span><span class="p">,</span>
<span class="s">'writeonly'</span><span class="p">:</span> <span class="bp">True</span><span class="p">,</span>
<span class="s">'label'</span><span class="p">:</span> <span class="s">'Reset'</span><span class="p">,</span>
<span class="s">'readonly'</span><span class="p">:</span> <span class="bp">False</span><span class="p">,</span>
<span class="s">'data_str'</span><span class="p">:</span> <span class="s">'False'</span><span class="p">,</span>
<span class="s">'type'</span><span class="p">:</span> <span class="s">'Button'</span><span class="p">},</span>
<span class="il">72057594093273090L</span><span class="p">:</span> <span class="p">{</span>
<span class="s">'help'</span><span class="p">:</span> <span class="s">''</span><span class="p">,</span>
<span class="s">'max'</span><span class="p">:</span> <span class="il">0L</span><span class="p">,</span>
<span class="s">'is_polled'</span><span class="p">:</span> <span class="bp">False</span><span class="p">,</span>
<span class="s">'units'</span><span class="p">:</span> <span class="s">'kWh'</span><span class="p">,</span>
<span class="s">'data'</span><span class="p">:</span> <span class="mf">0.0</span><span class="p">,</span>
<span class="s">'min'</span><span class="p">:</span> <span class="il">0L</span><span class="p">,</span>
<span class="s">'writeonly'</span><span class="p">:</span> <span class="bp">False</span><span class="p">,</span>
<span class="s">'label'</span><span class="p">:</span> <span class="s">'Energy'</span><span class="p">,</span>
<span class="s">'readonly'</span><span class="p">:</span> <span class="bp">True</span><span class="p">,</span>
<span class="s">'data_str'</span><span class="p">:</span> <span class="mf">0.0</span><span class="p">,</span>
<span class="s">'type'</span><span class="p">:</span> <span class="s">'Decimal'</span><span class="p">},</span>
<span class="il">72057594093273218L</span><span class="p">:</span> <span class="p">{</span>
<span class="s">'help'</span><span class="p">:</span> <span class="s">''</span><span class="p">,</span>
<span class="s">'max'</span><span class="p">:</span> <span class="il">0L</span><span class="p">,</span>
<span class="s">'is_polled'</span><span class="p">:</span> <span class="bp">False</span><span class="p">,</span>
<span class="s">'units'</span><span class="p">:</span> <span class="s">'W'</span><span class="p">,</span>
<span class="s">'data'</span><span class="p">:</span> <span class="mf">0.0</span><span class="p">,</span>
<span class="s">'min'</span><span class="p">:</span> <span class="il">0L</span><span class="p">,</span>
<span class="s">'writeonly'</span><span class="p">:</span> <span class="bp">False</span><span class="p">,</span>
<span class="s">'label'</span><span class="p">:</span> <span class="s">'Power'</span><span class="p">,</span>
<span class="s">'readonly'</span><span class="p">:</span> <span class="bp">True</span><span class="p">,</span>
<span class="s">'data_str'</span><span class="p">:</span> <span class="mf">0.0</span><span class="p">,</span>
<span class="s">'type'</span><span class="p">:</span> <span class="s">'Decimal'</span><span class="p">}</span>
<span class="p">}</span>
</pre></div>
</div>
<p>Another example from an homePro dimmer (not configured in openzwave):</p>
<div class="highlight-python"><div class="highlight"><pre><span class="n">COMMAND_CLASS_SWITCH_MULTILEVEL</span> <span class="p">:</span> <span class="p">{</span>
<span class="il">72057594109853736L</span><span class="p">:</span> <span class="p">{</span>
<span class="s">'help'</span><span class="p">:</span> <span class="s">''</span><span class="p">,</span>
<span class="s">'max'</span><span class="p">:</span> <span class="il">0L</span><span class="p">,</span>
<span class="s">'is_polled'</span><span class="p">:</span> <span class="bp">False</span><span class="p">,</span>
<span class="s">'units'</span><span class="p">:</span> <span class="s">''</span><span class="p">,</span>
<span class="s">'data'</span><span class="p">:</span> <span class="s">'False'</span><span class="p">,</span>
<span class="s">'min'</span><span class="p">:</span> <span class="il">0L</span><span class="p">,</span>
<span class="s">'writeonly'</span><span class="p">:</span> <span class="bp">True</span><span class="p">,</span>
<span class="s">'label'</span><span class="p">:</span> <span class="s">'Dim'</span><span class="p">,</span>
<span class="s">'readonly'</span><span class="p">:</span> <span class="bp">False</span><span class="p">,</span>
<span class="s">'data_str'</span><span class="p">:</span> <span class="s">'False'</span><span class="p">,</span>
<span class="s">'type'</span><span class="p">:</span> <span class="s">'Button'</span><span class="p">},</span>
<span class="il">72057594109853697L</span><span class="p">:</span> <span class="p">{</span>
<span class="s">'help'</span><span class="p">:</span> <span class="s">''</span><span class="p">,</span>
<span class="s">'max'</span><span class="p">:</span> <span class="il">255L</span><span class="p">,</span>
<span class="s">'is_polled'</span><span class="p">:</span> <span class="bp">False</span><span class="p">,</span>
<span class="s">'units'</span><span class="p">:</span> <span class="s">''</span><span class="p">,</span>
<span class="s">'data'</span><span class="p">:</span> <span class="mi">69</span><span class="p">,</span>
<span class="s">'min'</span><span class="p">:</span> <span class="il">0L</span><span class="p">,</span>
<span class="s">'writeonly'</span><span class="p">:</span> <span class="bp">False</span><span class="p">,</span>
<span class="s">'label'</span><span class="p">:</span> <span class="s">'Level'</span><span class="p">,</span>
<span class="s">'readonly'</span><span class="p">:</span> <span class="bp">False</span><span class="p">,</span>
<span class="s">'data_str'</span><span class="p">:</span> <span class="mi">69</span><span class="p">,</span>
<span class="s">'type'</span><span class="p">:</span> <span class="s">'Byte'</span><span class="p">},</span>
<span class="il">72057594118242369L</span><span class="p">:</span> <span class="p">{</span>
<span class="s">'help'</span><span class="p">:</span> <span class="s">''</span><span class="p">,</span>
<span class="s">'max'</span><span class="p">:</span> <span class="il">255L</span><span class="p">,</span>
<span class="s">'is_polled'</span><span class="p">:</span> <span class="bp">False</span><span class="p">,</span>
<span class="s">'units'</span><span class="p">:</span> <span class="s">''</span><span class="p">,</span>
<span class="s">'data'</span><span class="p">:</span> <span class="mi">0</span><span class="p">,</span>
<span class="s">'min'</span><span class="p">:</span> <span class="il">0L</span><span class="p">,</span>
<span class="s">'writeonly'</span><span class="p">:</span> <span class="bp">False</span><span class="p">,</span>
<span class="s">'label'</span><span class="p">:</span> <span class="s">'Start Level'</span><span class="p">,</span>
<span class="s">'readonly'</span><span class="p">:</span> <span class="bp">False</span><span class="p">,</span>
<span class="s">'data_str'</span><span class="p">:</span> <span class="mi">0</span><span class="p">,</span>
<span class="s">'type'</span><span class="p">:</span> <span class="s">'Byte'</span><span class="p">},</span>
<span class="il">72057594109853720L</span><span class="p">:</span> <span class="p">{</span>
<span class="s">'help'</span><span class="p">:</span> <span class="s">''</span><span class="p">,</span>
<span class="s">'max'</span><span class="p">:</span> <span class="il">0L</span><span class="p">,</span>
<span class="s">'is_polled'</span><span class="p">:</span> <span class="bp">False</span><span class="p">,</span>
<span class="s">'units'</span><span class="p">:</span> <span class="s">''</span><span class="p">,</span>
<span class="s">'data'</span><span class="p">:</span> <span class="s">'False'</span><span class="p">,</span>
<span class="s">'min'</span><span class="p">:</span> <span class="il">0L</span><span class="p">,</span>
<span class="s">'writeonly'</span><span class="p">:</span> <span class="bp">True</span><span class="p">,</span>
<span class="s">'label'</span><span class="p">:</span> <span class="s">'Bright'</span><span class="p">,</span>
<span class="s">'readonly'</span><span class="p">:</span> <span class="bp">False</span><span class="p">,</span>
<span class="s">'data_str'</span><span class="p">:</span> <span class="s">'False'</span><span class="p">,</span>
<span class="s">'type'</span><span class="p">:</span> <span class="s">'Button'</span><span class="p">},</span>
<span class="il">72057594118242352L</span><span class="p">:</span> <span class="p">{</span>
<span class="s">'help'</span><span class="p">:</span> <span class="s">''</span><span class="p">,</span>
<span class="s">'max'</span><span class="p">:</span> <span class="il">0L</span><span class="p">,</span>
<span class="s">'is_polled'</span><span class="p">:</span> <span class="bp">False</span><span class="p">,</span>
<span class="s">'units'</span><span class="p">:</span> <span class="s">''</span><span class="p">,</span>
<span class="s">'data'</span><span class="p">:</span> <span class="bp">False</span><span class="p">,</span>
<span class="s">'min'</span><span class="p">:</span> <span class="il">0L</span><span class="p">,</span>
<span class="s">'writeonly'</span><span class="p">:</span> <span class="bp">False</span><span class="p">,</span>
<span class="s">'label'</span><span class="p">:</span> <span class="s">'Ignore Start Level'</span><span class="p">,</span>
<span class="s">'readonly'</span><span class="p">:</span> <span class="bp">False</span><span class="p">,</span>
<span class="s">'data_str'</span><span class="p">:</span> <span class="bp">False</span><span class="p">,</span>
<span class="s">'type'</span><span class="p">:</span> <span class="s">'Bool'</span><span class="p">}</span>
<span class="p">}</span>
</pre></div>
</div>
<p>What about the conclusion :</p>
<blockquote>
<div><p>The COMMAND_CLASS_SWITCH_ALL is defined with the same label and
use a list as parameter. This should be a configuration parameter.
Don’t know what to do for this command class</p>
<p>The COMMAND_CLASS_SWITCH_BINARY use a bool as parameter while
COMMAND_CLASS_SWITCH_MULTILEVEL use 2 buttons : Dim and Bright.
Dim and Bright must be done in 2 steps : set the level and activate
the button.</p>
<p>So we must add one or more lines in the actuators :</p>
<p>Switch : {setter:self.set_command_class_0xYZ(valueId, new), getter:}
We must find a way to access the value directly</p>
<p>Bright
Dim</p>
<p>So for the COMMAND_CLASS_SWITCH_BINARY we must define a function called
Switch (=the label of the value). What happen if we have 2 switches
on the node : 2 values I suppose.</p>
<p>COMMAND_CLASS_SWITCH_MULTILEVEL uses 2 commands : 4 when 2 dimmers on the
done ? Don’t know but it can.</p>
<p>COMMAND_CLASS_METER export many values : 2 of them sends a decimal
and are readonly. They also have a Unit defined ans values are readonly</p>
<p>COMMAND_CLASS_METER are used for sensors only. So we would map
every values entries as defined before</p>
<p>Programming :
get_switches : retrieve the list of switches on the node
is_switch (label) : says if the value with label=label is a switch
get_switch (label) : retrieve the value where label=label</p>
</div></blockquote>
<dl class="method">
<dt id="openzwave.command.ZWaveNodeBasic.can_wake_up">
<tt class="descname">can_wake_up</tt><big>(</big><big>)</big><a class="headerlink" href="#openzwave.command.ZWaveNodeBasic.can_wake_up" title="Permalink to this definition">¶</a></dt>
<dd><p>Check if node contain the command class 0x84 (COMMAND_CLASS_WAKE_UP).</p>
<p>Filter rules are :</p>
<blockquote>
<div>command_class = 0x84</div></blockquote>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">True if the node can wake up</td>
</tr>
<tr class="field-even field"><th class="field-name">Return type:</th><td class="field-body">bool</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="method">
<dt id="openzwave.command.ZWaveNodeBasic.get_battery_level">
<tt class="descname">get_battery_level</tt><big>(</big><em>value_id=None</em><big>)</big><a class="headerlink" href="#openzwave.command.ZWaveNodeBasic.get_battery_level" title="Permalink to this definition">¶</a></dt>
<dd><p>The battery level of this node.
The command 0x80 (COMMAND_CLASS_BATTERY) of this node.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>value_id</strong> (<em>int</em>) – The value to retrieve state. If None, retrieve the first value</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">The level of this battery</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body">int</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="method">
<dt id="openzwave.command.ZWaveNodeBasic.get_battery_levels">
<tt class="descname">get_battery_levels</tt><big>(</big><big>)</big><a class="headerlink" href="#openzwave.command.ZWaveNodeBasic.get_battery_levels" title="Permalink to this definition">¶</a></dt>
<dd><p>The command 0x80 (COMMAND_CLASS_BATTERY) of this node.
Retrieve the list of values to consider as batteries.
Filter rules are :</p>
<blockquote>
<div>command_class = 0x80
genre = “User”
type = “Byte”
readonly = True
writeonly = False</div></blockquote>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">The list of switches on this node</td>
</tr>
<tr class="field-even field"><th class="field-name">Return type:</th><td class="field-body">dict()</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="method">
<dt id="openzwave.command.ZWaveNodeBasic.get_power_level">
<tt class="descname">get_power_level</tt><big>(</big><em>value_id=None</em><big>)</big><a class="headerlink" href="#openzwave.command.ZWaveNodeBasic.get_power_level" title="Permalink to this definition">¶</a></dt>
<dd><p>The power level of this node.
The command 0x73 (COMMAND_CLASS_POWERLEVEL) of this node.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>value_id</strong> (<em>int</em>) – The value to retrieve state. If None, retrieve the first value</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">The level of this battery</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body">int</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="method">
<dt id="openzwave.command.ZWaveNodeBasic.get_power_levels">
<tt class="descname">get_power_levels</tt><big>(</big><big>)</big><a class="headerlink" href="#openzwave.command.ZWaveNodeBasic.get_power_levels" title="Permalink to this definition">¶</a></dt>
<dd><p>The command 0x73 (COMMAND_CLASS_POWERLEVEL) of this node.
Retrieve the list of values to consider as power_levels.
Filter rules are :</p>
<blockquote>
<div>command_class = 0x73
genre = “User”
type = “Byte”
readonly = True
writeonly = False</div></blockquote>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">The list of switches on this node</td>
</tr>
<tr class="field-even field"><th class="field-name">Return type:</th><td class="field-body">dict()</td>
</tr>
</tbody>
</table>
</dd></dl>
</dd></dl>
<dl class="class">
<dt id="openzwave.command.ZWaveNodeSwitch">
<em class="property">class </em><tt class="descclassname">openzwave.command.</tt><tt class="descname">ZWaveNodeSwitch</tt><a class="headerlink" href="#openzwave.command.ZWaveNodeSwitch" title="Permalink to this definition">¶</a></dt>
<dd><p>Represents an interface to switches and dimmers Commands</p>
<dl class="method">
<dt id="openzwave.command.ZWaveNodeSwitch.get_dimmer_level">
<tt class="descname">get_dimmer_level</tt><big>(</big><em>value_id</em><big>)</big><a class="headerlink" href="#openzwave.command.ZWaveNodeSwitch.get_dimmer_level" title="Permalink to this definition">¶</a></dt>
<dd><p>The command 0x26 (COMMAND_CLASS_SWITCH_MULTILEVEL) of this node.
Get the dimmer level (using value value_id).</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>value_id</strong> (<em>int</em>) – The value to retrieve level</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">The level : a value between 0-99</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body">int</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="method">
<dt id="openzwave.command.ZWaveNodeSwitch.get_dimmers">
<tt class="descname">get_dimmers</tt><big>(</big><big>)</big><a class="headerlink" href="#openzwave.command.ZWaveNodeSwitch.get_dimmers" title="Permalink to this definition">¶</a></dt>
<dd><p>The command 0x26 (COMMAND_CLASS_SWITCH_MULTILEVEL) of this node.
Retrieve the list of values to consider as dimmers.
Filter rules are :</p>
<blockquote>
<div>command_class = 0x26
genre = “User”
type = “Bool”
readonly = False
writeonly = False</div></blockquote>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">The list of dimmers on this node</td>
</tr>
<tr class="field-even field"><th class="field-name">Return type:</th><td class="field-body">dict()</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="method">
<dt id="openzwave.command.ZWaveNodeSwitch.get_switch_all_item">
<tt class="descname">get_switch_all_item</tt><big>(</big><em>value_id</em><big>)</big><a class="headerlink" href="#openzwave.command.ZWaveNodeSwitch.get_switch_all_item" title="Permalink to this definition">¶</a></dt>
<dd><p>The command 0x27 (COMMAND_CLASS_SWITCH_ALL) of this node.
Return the current value (using value value_id) of a switch_all.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>value_id</strong> (<em>int</em>) – The value to retrieve switch_all value</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">The value of the value</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body">str</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="method">
<dt id="openzwave.command.ZWaveNodeSwitch.get_switch_all_items">
<tt class="descname">get_switch_all_items</tt><big>(</big><em>value_id</em><big>)</big><a class="headerlink" href="#openzwave.command.ZWaveNodeSwitch.get_switch_all_items" title="Permalink to this definition">¶</a></dt>
<dd><p>The command 0x27 (COMMAND_CLASS_SWITCH_ALL) of this node.
Return the all the possible values (using value value_id) of a switch_all.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>value_id</strong> (<em>int</em>) – The value to retrieve items list</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">The value of the value</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body">set()</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="method">
<dt id="openzwave.command.ZWaveNodeSwitch.get_switch_all_state">
<tt class="descname">get_switch_all_state</tt><big>(</big><em>value_id</em><big>)</big><a class="headerlink" href="#openzwave.command.ZWaveNodeSwitch.get_switch_all_state" title="Permalink to this definition">¶</a></dt>
<dd><p>The command 0x27 (COMMAND_CLASS_SWITCH_ALL) of this node.
Return the state (using value value_id) of a switch or a dimmer.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>value_id</strong> (<em>int</em>) – The value to retrieve state</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">The state of the value</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body">bool</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="method">
<dt id="openzwave.command.ZWaveNodeSwitch.get_switch_state">
<tt class="descname">get_switch_state</tt><big>(</big><em>value_id</em><big>)</big><a class="headerlink" href="#openzwave.command.ZWaveNodeSwitch.get_switch_state" title="Permalink to this definition">¶</a></dt>
<dd><p>The command 0x25 (COMMAND_CLASS_SWITCH_BINARY) of this node.
Return the state (using value value_id) of a switch.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>value_id</strong> (<em>int</em>) – The value to retrieve state</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">The state of the value</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body">bool</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="method">
<dt id="openzwave.command.ZWaveNodeSwitch.get_switches">
<tt class="descname">get_switches</tt><big>(</big><big>)</big><a class="headerlink" href="#openzwave.command.ZWaveNodeSwitch.get_switches" title="Permalink to this definition">¶</a></dt>
<dd><p>The command 0x25 (COMMAND_CLASS_SWITCH_BINARY) of this node.
Retrieve the list of values to consider as switches.
Filter rules are :</p>
<blockquote>
<div>command_class = 0x25
genre = “User”
type = “Bool”
readonly = False
writeonly = False</div></blockquote>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">The list of switches on this node</td>
</tr>
<tr class="field-even field"><th class="field-name">Return type:</th><td class="field-body">dict()</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="method">
<dt id="openzwave.command.ZWaveNodeSwitch.get_switches_all">
<tt class="descname">get_switches_all</tt><big>(</big><big>)</big><a class="headerlink" href="#openzwave.command.ZWaveNodeSwitch.get_switches_all" title="Permalink to this definition">¶</a></dt>
<dd><p>The command 0x27 (COMMAND_CLASS_SWITCH_ALL) of this node.
Retrieve the list of values to consider as switches_all.
Filter rules are :</p>
<blockquote>
<div>command_class = 0x27
genre = “System”
type = “List”
readonly = False
writeonly = False</div></blockquote>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">The list of switches on this node</td>
</tr>
<tr class="field-even field"><th class="field-name">Return type:</th><td class="field-body">dict()</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="method">
<dt id="openzwave.command.ZWaveNodeSwitch.set_dimmer">
<tt class="descname">set_dimmer</tt><big>(</big><em>value_id</em>, <em>value</em><big>)</big><a class="headerlink" href="#openzwave.command.ZWaveNodeSwitch.set_dimmer" title="Permalink to this definition">¶</a></dt>
<dd><p>The command 0x26 (COMMAND_CLASS_SWITCH_MULTILEVEL) of this node.
Set switch to value (using value value_id).</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><strong>value_id</strong> (<em>int</em>) – The value to retrieve state</li>
<li><strong>value</strong> (<em>int</em>) – The level : a value between 0-99 or 255. 255 set the level to the last value. 0 turn the dimmer off</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="method">
<dt id="openzwave.command.ZWaveNodeSwitch.set_switch">
<tt class="descname">set_switch</tt><big>(</big><em>value_id</em>, <em>value</em><big>)</big><a class="headerlink" href="#openzwave.command.ZWaveNodeSwitch.set_switch" title="Permalink to this definition">¶</a></dt>
<dd><p>The command 0x25 (COMMAND_CLASS_SWITCH_BINARY) of this node.
Set switch to value (using value value_id).</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><strong>value_id</strong> (<em>int</em>) – The value to retrieve state</li>
<li><strong>value</strong> (<em>bool</em>) – True or False</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="method">
<dt id="openzwave.command.ZWaveNodeSwitch.set_switch_all">
<tt class="descname">set_switch_all</tt><big>(</big><em>value_id</em>, <em>value</em><big>)</big><a class="headerlink" href="#openzwave.command.ZWaveNodeSwitch.set_switch_all" title="Permalink to this definition">¶</a></dt>
<dd><p>The command 0x27 (COMMAND_CLASS_SWITCH_ALL) of this node.
Set switches_all to value (using value value_id).</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><strong>value_id</strong> (<em>int</em>) – The value to retrieve state</li>
<li><strong>value</strong> (<em>str</em>) – A predefined string</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>
</dd></dl>
<dl class="class">
<dt id="openzwave.command.ZWaveNodeSensor">
<em class="property">class </em><tt class="descclassname">openzwave.command.</tt><tt class="descname">ZWaveNodeSensor</tt><a class="headerlink" href="#openzwave.command.ZWaveNodeSensor" title="Permalink to this definition">¶</a></dt>
<dd><p>Represents an interface to Sensor Commands</p>
<dl class="method">
<dt id="openzwave.command.ZWaveNodeSensor.get_sensor_value">
<tt class="descname">get_sensor_value</tt><big>(</big><em>value_id</em><big>)</big><a class="headerlink" href="#openzwave.command.ZWaveNodeSensor.get_sensor_value" title="Permalink to this definition">¶</a></dt>
<dd><p>The command 0x30 (COMMAND_CLASS_SENSOR_BINARY) of this node.
The command 0x31 (COMMAND_CLASS_SENSOR_MULTILEVEL) of this node.
The command 0x32 (COMMAND_CLASS_METER) of this node.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>value_id</strong> (<em>int</em>) – The value to retrieve value</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">The state of the sensors</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body">variable</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="method">
<dt id="openzwave.command.ZWaveNodeSensor.get_sensors">
<tt class="descname">get_sensors</tt><big>(</big><em>type='All'</em><big>)</big><a class="headerlink" href="#openzwave.command.ZWaveNodeSensor.get_sensors" title="Permalink to this definition">¶</a></dt>
<dd><p>The command 0x30 (COMMAND_CLASS_SENSOR_BINARY) of this node.
The command 0x31 (COMMAND_CLASS_SENSOR_MULTILEVEL) of this node.
The command 0x32 (COMMAND_CLASS_METER) of this node.
Retrieve the list of values to consider as sensors.
Filter rules are :</p>
<blockquote>
<div>command_class = 0x30-32
genre = “User”
readonly = True
writeonly = False</div></blockquote>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>type</strong> (<em>‘All’ or PyValueTypes</em>) – the type of value</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">The list of switches on this node</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body">dict()</td>
</tr>
</tbody>
</table>
</dd></dl>
</dd></dl>
</div>
</div>
</div>
</div>
<div class="sphinxsidebar">
<div class="sphinxsidebarwrapper">
<h4>Previous topic</h4>
<p class="topless"><a href="node.html"
title="previous chapter">Node documentation</a></p>
<h4>Next topic</h4>
<p class="topless"><a href="group.html"
title="next chapter">Group documentation</a></p>
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="_sources/command.txt"
rel="nofollow">Show Source</a></li>
</ul>
<div id="searchbox" style="display: none">
<h3>Quick search</h3>
<form class="search" action="search.html" method="get">
<input type="text" name="q" />
<input type="submit" value="Go" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
<p class="searchtip" style="font-size: 90%">
Enter search terms or a module, class or function name.
</p>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="related">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="genindex.html" title="General Index"
>index</a></li>
<li class="right" >
<a href="py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li class="right" >
<a href="group.html" title="Group documentation"
>next</a> |</li>
<li class="right" >
<a href="node.html" title="Node documentation"
>previous</a> |</li>
<li><a href="index.html">python-openzwave 0.3.0b5 documentation</a> »</li>
<li><a href="openzwave.html" >API documentation</a> »</li>
</ul>
</div>
<div class="footer">
© Copyright 2012,2013,2014,2015, bibi21000.
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.2.2.
</div>
</body>
</html>