forked from HeyuX10Automation/heyu
-
Notifications
You must be signed in to change notification settings - Fork 0
/
heyu.1
2218 lines (2032 loc) · 81.3 KB
/
heyu.1
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
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
.TH HEYU 1 local
.SH NAME
.B Heyu\^
- a control program for the X-10 CM11A serial interface
.SH USAGE
.B heyu [options] command [parameter(s)]
.br
Run \'heyu help\' for a description of the Heyu options and commands available
in the current version.
.SH DESCRIPTION
.I Heyu
is a program for controlling an X-10 CM11A 2-Way Computer Interface.
This is the control device manufactured by X-10 (USA) Inc.
and found in their ActiveHome(TM) CK11A kit. Equivalent (rebranded)
devices have been sold as the IBM HD11A Home Director and the RCA HC60CRX
Home Control Interface. 220 Volt versions of the CM11A are sold in Europe as
variously named CM11x models (depending on AC plug style) and in the UK
as the CM12U.
.PP
The CM11A can remotely control lights and appliances in your house by
signaling over the AC house wiring. It can store lists of X10 signals and
send them at scheduled times. It can respond to some X10 signals
by sending out other X10 signals. With Heyu, it can respond to X10 signals
by executing an arbitrary command or script selected by the user.
.PP
Limited support is provided for the IBM HD16A, an earlier version of the Home
Director without clock or battery backup and known as the CM10A - see
special CM10A configuration instructions in the TTY directive section of
man page x10config(5).
.PP
Heyu supports an auxiliary input device on a second serial port for X10
RF signals. Supported devices are the WGL W800RF32A, the X-10 MR26A,
and the RFXCOM X10 RF Receivers. A network version of the RFXCOM receiver,
RFXLAN, is also supported.
.PP
The W800RF32A is manufactured by WGL & Associates (http://www.wgldesigns.com).
It is available in both a 310 MHz version for operation in the USA and Canada
and a 433.92 MHz version (W800RF32AE) for European and other countries.
It can receive signals from standard, entertainment, and security X10
transmitters.
.PP
The X-10 MR26A is usually bundled with a univeral remote in a package
by X-10 but is also available individually. It can receive standard and
entertainment X10 signals but not security X10 signals.
.PP
The RFXCOM X10 receiver is supported in W800RF32 emulation mode and
has the same capabilities. It is a USB device but has a built-in
FTDI USB-to-Serial converter and communication with it is the same
as with a serial port (assuming your OS supports the FTDI chipset, as
does Linux).
.PP
Heyu also supports the X-10 CM17A "Firecracker", a small serial dongle which
can transmit X10 commands via RF signals to a transceiver plugged into the
power line. The CM17A and CM11A coexist on the same serial port - no
additional serial port is required.
.br
As far as can be determined there is no version of the CM17A which
transmits at an RF frequency other than the 310 MHz used for X10
transceivers in North America. A compile option is provided to
compile Heyu without CM17A support for users outside North America or those
who simply have no interest in this device. (See the file "README" included
in the Heyu distribution directory.)
.PP
Except for being able to communicate with home automation devices
over dedicated hardware interfaces, Heyu can optionally process home
automation signals received over a LAN
in the form of xPL protocol messages.
In the current implementation,
X10 RF Standard
in RFFORWARD mode (signal source RCVA)
and X10 RF Security
signals comming from RFXLAN receivers flashed with xPL firmware
are supported.
For this to work, the xPL support must be enabled explicitly in Heyu at
build time.
See the file "README" for details on how to build Heyu with xPL enabled.
See also x10xpl(7), x10aux(5), x10config(5) and x10scripts(5) man pages
for more information on Heyu xPL functionality.
.PP
Heyu depends on a configuration file to tell it on what serial port
the CM11A is connected and to provide it with various other user options.
Heyu will not run without the configuration file.
See x10config(5) for more information. The standard pathnames
Heyu assumes for this file are either $HOME/.heyu/x10config or /etc/heyu/x10.conf,
in that order, but the user can specify a non-standard pathname at the
command line or with an environment variable. (Operating systems other
than Linux may store the configuration file in a different directory
by default.) The directory where Heyu finds the configuration file
is Heyu\'s "base" directory. Heyu requires that this directory be writable.
.PP
The CM11A connects to a computer via an RS232 serial port (or a
USB-to-Serial adapter for newer systems without an RS232 serial port).
It can store about 128 events; each event can turn on, turn off, or dim
one or more X10 modules. The CM11A box has a battery backed clock
which the computer can read. The data is stored in an EEPROM.
.PP
You could just put a bunch of Heyu commands in your crontab, but
this doesn\'t work if your system is down for backups, or has crashed,
or if someone\'s tripped over the RS232 cable and unplugged it, and it
clutters up the crontab. For most users, it\'s much
easier to upload a schedule of events into the CM11A\'s EEPROM.
.PP
Special note: If you have chosen to locate the Heyu configuration
file under your home directory and then run Heyu commands in crontab,
Heyu won\'t be able to automatically find the configuration file since
it will be running as user 'root'. In this situation, specify the
full path to the configuration file with either the '-c' Heyu command
line switch or with the environment variable X10CONFIG.
.br
Also, specify the full Heyu executable pathspec, e.g., /usr/local/bin/heyu,
if your crontab path does not include the directory where the Heyu executable
is located.
.PP
The timers and macros to be uploaded the the CM11A\'s EEPROM are stored
in a file. The default is $HOME/.heyu/x10.sched
or /etc/heyu/x10.sched. See x10sched(5) for the layout of the file.
.PP
X10 modules are identified by a one-letter housecode ranging from A to P
(for 16 different codes) and a number from 1 to 16, for a total of 256
possible unit codes. The character \'*\' is interpreted to mean
all units 1-16 (but must be escaped if entered on the command line).
.PP
Heyu spawns a relay daemon that gathers the CM11A output
for any process that wants it. This allows running the monitor while sending
on/off commands. Just as important is that it also catches power fail
messages and responds to them immediately.
.PP
As of version 2, a state engine daemon may optionally
be started which will maintain a record of the state of each module on
the system, and which has the capability of executing scripts.
.PP
Heyu supports multiple CM11A units connected to different serial
ports on the same computer. The configuration files for each CM11A
must be stored in different directories - it\'s usually most convenient to
store them in subdirectories /0 through /9 of the normal locations.
Each CM11A operates independently of the others (except for
communication via the house wiring) and has its own set of associated files.
.SH OPTIONS
.PP
.IP -v
Enable verbose mode
.PP
.IP -c\ <pathname>
Specify full configuration file pathname
.PP
.IP -s\ <pathname>
Specify full schedule file pathname
.PP
.IP -0\ ...\ -9
Look for config file in subdirectory /0 ... /9
of standard location, e.g., $HOME/.heyu/3/x10config
.PP
Additional options are available if Heyu was built with xPLLib:
.PP
.IP -interface\ <if>
Change the default interface xPLLib uses; can be specified as
either a network interface name, like 'eth0', or an IP address
.PP
.IP -xpldebug
Enable xPLLib debugging
.PP
.SH COMMANDS
.PP
Heyu\'s commands are divided into Administrative, State, Direct, and
CM17A "Firecracker" commands.
.PP
Administrative commands generally control some feature of the CM11A or display
information from the CM11A, or display information about Heyu or about the
user\'s configuration.
.PP
State commands return in various formats information about the state of
modules on the user\'s system which has already been stored in the tables
maintained by Heyu Engine. They don\'t attempt to update these tables.
They are primarily intended to be called by scripts.
Note however that scripts launched by the Heyu state engine (excluding heyuhelper)
are passed an environment which already contains most all the state information. Any of the
state commands require that the Heyu state engine daemon (heyu_engine) be running.
.PP
Direct commands are used to transmit specific module control instructions
out over the AC power line through the CM11A interface.
.PP
CM17A "Firecracker" commands transmit X10 RF signals if there is a CM17A
device connected to the serial port.
.SH ADMINISTRATIVE COMMANDS
.PP
.IP \fBdate\fP
Gets current date and time from the CM11A clock/calendar and displays
it in a form suitable for feeding to \fIdate(1)\fP as input.
.PP
.IP \fBerase\fP
Erases the CM11A\'s EEPROM. All events, macros, etc are permanently gone.
.PP
.IP \fBinfo\fP
Displays the current setting of CM11A\'s clock, base housecode, battery timer,
and monitored housecode registers. It also displays the status of
the uploaded timer schedule, if any.
.PP
.IP \fBhelp\fP
Displays a list of the commands that are available. If executed with the
name of a command as a parameter, it will display the the syntax for that
command only. If executed with the parameter \'admin\', \'state\',
\'direct\', \'cm17a\', \'shutter\', \'rfxsensor\', or \'rfxmeter\'
it will display only the commands of that type.
.PP
.IP \fBsyn\fB
Displays built-in synonyms for many of the common direct commands.
.PP
.IP \fB<scene_label>\fP
Executes a scene or user-defined synonym (usersyn) from the user\'s
configuration file.
.PP
.IP \fBshow\fP
Display various information from the user\'s configuration file
or about the state of the system. Run \'heyu show\' with no other
parameters to see the options available in the current release.
.br
al[iases] Aliases defined in config file
.br
ar[med] Armed status of Heyu
.br
sc[enes] Scenes defined in config file
.br
se[nsors] Sensor health report.
.br
u[sersyns] Usersyns defined in config file
.br
m[odules] H Module attributes, housecode H
.br
l[aunchers] [H] Launcher attributes, all, or housecode H (or -p -s -r -t)
.br
h[ousemap] [H] Overall system state, or details housecode H (*)
.br
da[wndusk] Dawn and Dusk used for \'night\' and \'dark\' flags (*)
.br
dim[levels] Dim levels of modules as percent brightness (*)
.br
r[awlevels] Native levels of modules (0-210, 1-31, 0-63) (*)
.br
f[lags] Software flags (*)
.br
ti[mers] Countdown times for active timers (*)
.br
ts[tamp] Hu Data and time of last signal to address Hu (*)
.br
g[roups] H Extended code group assignments and levels (*)
.br
x[10sensors] Tabular display of X10 Security sensors (*)
.br
dig[imax] Tabular display of DigiMax sensors (*)
.br
rfxs[ensors] Tabular display of RFXSensor sensors (*)
.br
rfxm[eters] Tabular display of RFXMeter sensors (*)
.br
or[egon] Tabular display of Oregon sensors (*)
.br
ot[hers] Cumulative received address map (*) - clear with
\'heyu initothers\' or \'heyu initstate\'
.br
(*) Require the heyu state engine to be running
.PP
.IP \fBupload [check | croncheck | status | cronstatus]\fP
By itself (heyu upload), the upload command reads timers, triggers, and
macros from the user\'s schedule file, processes it and creates a binary
memory image, and uploads this image into the CM11A\'s EEPROM.
.br
Upon successful completion, the following files are written to the
hard drive in Heyu\'s base directory.
.br
x10record - Heyu\'s memory of the mode and time of the most recent
uploaded schedule. (This _must_ remain intact for Heyu to know how to
reset the CM11A clock when required.)
.br
x10macroxref - A listing of the EEPROM addresses of uploaded macros for
use by Heyu\'s state engine and monitor.
.br
x10image - The 1024 byte binary image of the EEPROM. It\'s also
used by Heyu\'s state engine and monitor
.br
report.txt - The full details of Heyu\'s processing of data
uploaded to the EEPROM.
.br
If there are errors in the schedule file, the load will abort without
changing anything.
.br
The upload command with the check option (heyu upload check) will check
the config file and report any errors. The only file written to the
hard drive is the same \'report.txt\' mentioned above. (A configuration
file directive can be used to force writing the other files with
a ".check" extension.)
.br
The upload command with the croncheck option (heyu upload croncheck)
is only applicable when Heyu is configured to operate in HEYU mode
(see \fix10config(5)\fR for a description of the MODE directive). It
repeats the data processing Heyu would do if \'heyu upload check\' were
executed daily for the next 366 days and writes a file \'cronreport.txt\' to the
hard drive with a daily summary. (Its purpose is to prevent unpleasant
surprises if 'heyu upload' is to be executed automatically as a cron job.)
.br
The upload command with the status option (heyu upload status) or the
cronstatus option (heyu upload cronstatus) reports the number of days
before the currently uploaded schedule will expire. These options are
useful primarily when Heyu is configured to operate in HEYU mode,
where the period of validity of the schedule is variable at the user\'s
option. The difference between the two, i.e., status and cronstatus,
is that \'status\' displays a human-readable message whereas \'cronstatus\'
displays only the number of days (or an error code) for convenient
parsing in a cron script. The codes are:
.br
>= 0 Number of days until expiration (0 = Today is last day)
.br
-1 SCHEDULE_EXPIRED (Schedule must be reloaded)
.br
-2 NO_EXPIRATION (Schedule contains no timers)
.br
-3 NO_RECORD_FILE (No schedule has been uploaded)
.br
-4 BAD_RECORD_FILE (File x10record is corrupted.)
.br
.PP
.IP \fBcatchup\fP
Reads the EEPROM image binary file x10image saved when a schedule is
uploaded and immediately executes in chronological order the commands
in the macros for each timed event scheduled for today\'s date, beginning
at 00:00 hours and continuing up until the current system time.
.PP
.IP \fBtrigger\fP
An uploaded macro can only be executed by an uploaded timer or if
triggered by a powerline command. The 'heyu trigger Hu on|off' command
emulates a powerline trigger by looking up the trigger condition and
macro commands in the x10image and x10macroxref files saved by Heyu when a
schedule is uploaded. It then executes them as direct commands.
Macro delays are ignored.
.PP
.IP \fBmacro\fP
Using the x10macroxref and x10image files saved when a schedule
is uploaded, \'heyu macro <label>\' looks up the commands comprising
the macro with the argument label and immediately executes them as
direct commands. Macro delays are ignored.
.PP
.IP \fBmonitor\fP
When executed in a separate terminal window, all X10 events sent and received
by the CM11A interface will be displayed in this window. The output goes to
stdout and may be redirected to a file (however the log file generated
by the Heyu state engine process contains the same information, and more).
The events are time-stamped and identified as to their source with the
following codes:
.br
\fIsndc\fP - Sent from the Heyu command line.
.br
\fIsnda\fP - Transceived from RF by the heyu_aux daemon.
.br
\fIsnds\fP - Sent by Heyu from within a script. (*)
.br
\fIsndp\fP - Sent by Heyu from within a power-fail script. (*)
.br
\fIsndm\fP - Sent by an uploaded macro when initiated by a Timer.
.br
\fIsndt\fP - Sent by an uploaded macro when initiated by a Trigger.
.br
\fIrcvi\fP - Received over the AC power line.
.br
\fIrcvt\fP - A Trigger signal which initiated an uploaded macro.
.br
\fIrcva\fP - RF signals received from the heyu_aux daemon.
.br
(*) When that script is launched by the Heyu state engine daemon.
.PP
.IP \fBstart\fP
Starts the Heyu relay daemon and other configured daemons, i.e., it
will also start the Heyu Engine daemon if the directive \'START_ENGINE AUTO\'
appears in the configuration file and will start the Heyu Auxilliary daemon
if the \'TTY_AUX ...\' directive appears in the configuration file.
.PP
.IP \fBrestart\fP
Directs all running Heyu background processes - heyu_relay, heyu_engine,
heyu_aux - plus Heyu monitors, to re-read the configuration file and
incorporate any changes since these processes were started.
.PP
.IP \fBstop\fP
Kills the heyu_relay daemon that gathers input from the tty port. This will also
cause heyu_engine, heyu_aux, and any monitors to stop. It can only kill the
processes that you have permissions to stop.
.PP
.IP \fBengine\fP
Starts the Heyu state engine daemon, heyu_engine, a background process which
maintains a record of the state of each module based on X10 signals sent
or received, and which can launch scripts based on these signals. If so
enabled in the configuration file, its output, similar to that of the monitor,
is written to a log file.
.br
This command will not be needed if the directive "START_ENGINE AUTO" is
included in the configuration file and Heyu's background processes are
initiated by running \'heyu start\'.
.br
Whenever changes are made to the configuration file, the engine must
be restarted for the changes to be incorporated. (Run \'heyu restart\'
to restart it.)
.br
Warning: The record of module states maintained by the state engine can be
in disagreement with reality for any number of reasons and should never
be relied on for critical applications.
.PP
.IP \fBaux\fP
Starts the auxiliary daemon heyu_aux, a background process which
allows X10 commands to be input to Heyu via RF signals from a W800RF32A,
MR26A, or RFXCOM serial receiver, or from an RFXLAN network receiver.
The serial port to which the receiver is connected, or the network address
in case of RFXLAN, and the receiver device type must be specified in the
configuration file with the TTY_AUX directive.
.br
This command will not be needed if Heyu's background processes are
initiated with the \'heyu start\' command.
.PP
.IP \fBscript_ctrl\fP
Globally disables (\'heyu script_ctrl disable\') or enables
(\'heyu script_ctrl enable\') launching of scripts by Heyu. This
command overrides the configuration directive SCRIPT_CTRL (or its
default value of ENABLE).
.PP
.IP \fBinitstate\fP
If no housecode is specified, initializes the entire X10 state table to zero.
With a housecode (heyu initstate H), initializes the state table to zero for
just that housecode.
.PP
.IP \fBinitothers\fP
Initialize the cumulative received address state table to zero.
.PP
.IP \fBreset\fP
The default action for \fIreset\fR is to clear the registers in the the CM11A
and to set it to the default housecode defined in the configuration file.
The CM11A will then track state changes for that housecode in its internal
registers. If a housecode is specified as an argument, the CM11A will be set
to track state changes on that housecode instead. Note that the state recorded
in the CM11A internal registers is completely independent of the all-housecode
states tracked by the Heyu state engine.
.PP
.IP \fBsetclock\fP
Reads the system clock and loads it into the CM11A. This is adjusted for local
daylight savings time and for the mode of an uploaded schedule, if any. As of
Heyu version 2, the CM11A clock is maintained on local Standard Time throughout
the year.
.PP
.IP \fBreadclock\fP
Displays the date and time for the CM11A and system clocks. The raw data from
the CM11A clock is adjusted for local daylight savings time and for the mode
of an uploaded schedule, if any.
.PP
.IP \fBnewbattery\fP
Resets the CM11A battery timer to zero.
.PP
.IP \fBpurge\fP
Cancel any pending delayed macros, i.e., delayed macros which have been called
by a timer or trigger but have not yet been executed.
.PP
.IP \fBclear\fP
Clear the CM11A unit status registers for the monitored housecode.
.PP
.IP \fButility\fP
Several infrequently-used options are available:
.br
\'heyu utility syscheck\' displays clock/calendar/timezone information obtained
from the system by Heyu. Use this to make sure that your system\'s time
configuration is what you think it ought to be.
.br
\'heyu utility dawndusk\' displays the times of Dawn and Dusk for today.
.br
\'heyu utility suntable [-r|-c|-n|-a|-o [-]\fInn\fP] [-s] [-w] [\fIyyyy\fP]\'
writes a file to the hard drive containing a daily table of Dawn and Dusk as
computed by Heyu for your Longitude, Latitude, and Timezone, for the current
year or for year \fIyyyy\fP. By default, Dawn and Dusk are as defined by the
DAWNDUSK_DEF directive in your configuration file, times displayed are Civil
(i.e., wall-clock) times, and the table is 80 columns wide.
.br
Switches -r, -c, -n, -a or -o [-]\fInn\fP direct Heyu to use the definition of
Dawn and Dusk as either Sunrise/Sunset, or Civil, Nautical or Astronomical
Twilight, or a specified position of the Sun centre in angle minutes below the
horizon (actually above the horizon if \fb-\fInn\fP), respectively, overriding
the definition of Dawn and Dusk from your configuration file.
.br
Switch -s displays times as Standard Time throughout the year instead of
Civil Time.
.br
Switch -w writes the table in wide (135 column) format instead of the default
80 columns. (Printing this table on US Letter or A4 size
paper requires landscape orientation and an 8-point fixed font.)
.br
\'heyu utility calibrate\' provides the timing loop calibration needed for
CM17A Firecracker "fast" commands and some experimental commands.
.br
\'heyu utility masks\' displays the numerical value of the mask environment
variables for Heyu and Xtend environments. (For use with \'heyu heyu_state\',
\'heyu heyu_rawstate\', and \'heyu xtend_state\'.)
.PP
.IP \fBlogmsg\fP
Writes its quoted-text argument (max length 80 characters) as a time-stamped
entry in the Heyu logfile and on the monitor screen. (There\'s no checking
to see whether either the engine or monitor is actually running.)
This is primarily intended for making occasional notes while testing and
may or may not play well if executed in the midst of X10 power line activity.
It will also increase the size of the spool file by a few bytes more than
the length of the text, so should be used sparingly.
.br
Example:
.br
heyu logmsg "Awaiting signals from my new wall switch and transceiver."
.PP
.IP \fBcm10a_init\fP
Manually re-initialize a CM10A interface provided Heyu has been configured
for a CM10A instead of a CM11A. Note that when thus configured, the Heyu relay
should handle this automatically after a power interruption.
.PP
.IP \fBwait\fP
Wait until execution of an uploaded macro has completed before returning.
This is primarily intended for use when a script or shell command is launched
by an X10 command executed within an uploaded macro, i.e., with launch source
SNDM or SNDT, when it\'s important to be certain that the execution of the
macro has been completed. If the timeout parameter is omitted, the default
timeout is 30 seconds. This command operates by repeatedly pinging the CM11A
once a second until it echoes back the ping character.
.PP
.PP
.IP \fBrestore_groups\fP
Primarily intended for use following an interruption of AC power, this
command sends the X10 signals to all modules defined as supporting
extended code groups to restore the group assignments and xconfig mode
to the settings preserved in the X10 state file. (Run \'heyu show
groups H\' to display the group settings.)
.PP
.IP \fBlogtail\fP
Calls the system \'tail\' command to display the last N lines of the
Heyu log file. If parameter N is omitted, the default for the system
tail command, typically 10 lines, is displayed. The directory where
the log file is maintained must have been specified with the LOG_DIR
directive in the Heyu configuration file.
.PP
.IP \fBlaunch\fP
Launches a script defined by a SCRIPT directive provided a restricted
subset of the launch conditions are satisfied. For all scripts, the
sources, keywords, and flags other than global flags are disregarded
in the launch conditions.
.IP
For a Normal script, function tokens on, off, dim, and changed are
interpreted as representing the on/off/dim/changed state of the
specified module addresses rather than signals. All other function
tokens are disregarded. The launch condition is satisfied if any
one of the state comparisons is TRUE and all the global flags are
TRUE.
.br
For an Address script the launch conditions are satisfied
when a module is in the addressed state and the global flags are true.
.br
The syntax is:
.br
heyu launch [-e] [-L<n>] <script_label>
.br
For a Normal or Address script, the -e switch instructs Heyu to ignore
the functions and addresses and test only the global flags in the
launch conditions, as if it were an -exec script.
.br
Each set of launch conditions for a script is tested in the same order
as for a script launched by an X10 signal. For a script with multiple
launchers, the testing can be confined to a single launcher by providing
the launcher number <n> with the -L<n> switch. Launcher numbers start
at 0 for each script and are displayed in square "[]" brackets following
the script label in \'heyu show launchers\' command when there is more
than one. (If there is only one set of launch conditions, the launcher
number will always be 0 and is not displayed.)
.br
Examples:
.br
For the directive:
SCRIPT -l CheckLights A1-16 on notnight nosrc; B1-16 on notnight nosrc :: ...
.br
heyu launch CheckLights
.br
heyu launch -L1 CheckLights
.PP
.IP \fBversion\fP
Prints the version number and then exits.
.SH STATE COMMANDS
These commands are primarily intended for external scripts or programs
to obtain state information from Heyu which has previously been stored in
the state tables maintained by the Heyu engine. Scripts and programs launched
by the Heyu engine already have access to complete state information
via the environment variables passed to them. For a more human-readable
display, use the \'heyu show housemap [H]\' command.
.PP
These commands will display the various states of a module. The parameter
is a single-unit housecode|unit string \'Hu\' or just a housecode \'H\'.
(An alias is also accepted.) For the flagstate command, the parameter
is just the number of the flag (1-N).
.PP
The format for some of the state commands has been changed to the
following. See below for the older formats, which are still available.
.PP
enginestate State engine daemon is running (1) or not running (0)
.br
armedstate Bitmap: 1 = Armed, 2 = Home, 4 = ArmPending, 8 = tamper
.br
sensorfault Bitmap: 1 = Low battery, 2 = Inactive, 8 = tamper
.br
flagstate n State of flag n as either 1 (set) or 0 (clear)
.br
nightstate State of night flag as 1 (night) or 0 (notnight)
.br
darkstate State of dark flag as 1 (dark) or 0 (notdark)
.br
(Dark is defined by config directive ISDARK_OFFSET)
.br
sunstate Bitmap: 1 = Night, 2 = Dark
.PP
In the following, specifying a housecode|unit (Hu) will display the
boolean value 1 or 0 representing that Hu is in or not in that state,
respectively. Specifying only the Housecode will display a unit bitmap
(as an integer) of the units which are in that state, with bit 0
corresponding to unit 1, bit 1 to unit 2, bit 2 to unit 3, etc.
.br
onstate H[u] On state
.br
offstate H[u] Off state (not On)
.br
dimstate H[u] Dim state
.br
addrstate H[u] Addressed state
.br
chgstate H[u] Changed state
.br
fullonstate H[u] Fully On state (On and not Dim)
.br
alertstate H[u] Alert state
.br
clearstate H[u] Clear state
.br
auxalertstate H[u] AuxAlert state
.br
auxclearstate H[u] AuxClear state
.br
lobatstate H[u] Low Battery state for sensors
.br
validstate H[u] Function processed state (*)
.br
activestate H[u] Active state for sensors
.br
inactivestate H[u] Inactive state for sensors
.br
spendstate H[u] Status-pending flags (**)
.br
statusstate H[u] Deprecated - same as spendstate H[u]
.PP
(*) validstate H[u] indicates that a signal supported by the module
type at H[u] has been sent or received in the Heyu State Engine since
Heyu was started.
.PP
(**) When Heyu sends or receives a status or xstatus signal, the Heyu
State Engine sets a status-pending flag for the addressed unit in its
state table. When it receives a StatusOn, StatusOff, or xStatusAck return
signal from a 2-way module, it resets this flag for the addressed unit.
.br
If the status-pending flag remains set after an expected response
time (which may be a few seconds), it\'s an indication that something
is wrong - possibly a missed signal, a tripped circuit breaker or GFI,
or a 2-way module unplugged or simply gone bad.
.br
Note that most common modules are only 1-way and don\'t respond to a
status request. The state of the status-pending flag is therefore
meaningless for those modules. Note also that the status-pending flag
will NOT be reset for 2-way modules (like many SwitchLinc and LampLinc
modules) which return a brightness level rather than a StatusOn/StatusOff
signal.
.PP
The \'sensorfault\' command provides a quick check of sensors defined
by their module types in an ALIAS directive as being security sensors.
.br
A displayed value of 0 indicates all security sensors are operating
normally, otherwise the consolidated bitmap with 1 indicates a low
battery in one or more sensors, and the bitmap with 2 indicates one or
more sensors haven\'t reported in the elapsed time defined by the
INACTIVE_TIMEOUT configuration directive. Run \'heyu show sensors\'
for a detailed report identifying the individual sensors with
problems.
.PP
The old format is available for compatibility by setting the configuration
directive OLD_STATE_FORMAT to YES. The commands require a housecode|unit
parameter Hu and display the output in the heyuhelper style. Example
outputs are shown in parentheses for Hu = B8.
.PP
onstate Hu State of Hu as either On or Off (b8On, b8Off)
.br
dimstate Hu State of Hu as Dim, On, or Off (b8Dim, b8On, b8Off)
.br
addrstate Hu Addressed state of Hu (b8Addr, b8Unaddr)
.br
chgstate Hu Changed state of Hu (b8Chg, b8Unchg)
.br
.PP
The following command displays the state of all units on housecode H
as a 16 character ASCII string. Characters 1-16 represent respectively
the states of Units 1-16, each as a (lower-case) hexadecimal digit
0-0xf formed by adding together the state values On = 8, Dimmed = 4,
Changed = 2, Addressed = 1.
.br
statestr H (8c30000000000000)
.br
The above example indicates H1 is On, H2 is On and Dimmed,
H3 was changed to Off by the most recent command on housecode H
and remains addressed, and H4-16 are all Off and unaddressed.
.br
The following return the current brightness or native level
of module Hu as recorded by the Heyu state engine. (For Hu addresses
of X10 security sensors, the security data byte is returned.)
.br
dimlevel Hu Brighness level of Hu as 0-100% (50)
.br
rawlevel Hu Native level (0-210, 1-32, or 0-63) of Hu (32)
.PP
The following return respectively the stored brightness level 0-100%
and stored native level for modules which retain the memory of a
previous setting, e.g., lamp modules which support the Resume or
On-Level feature, or shutter controllers which store a limit value.
The level returned for modules without a memory feature will be just
the maximum level for that module type. (For Hu addresses of two-channel
X10 security sensors configured in dual mode, the security data byte
for the Aux channel is returned.)
.br
memlevel Hu Stored brightness level of Hu as 0-100%
.br
rawmemlevel Hu Stored native level of Hu
.PP
counter N Value of counter N
.PP
The following return the state bitmap of a module as a decimal integer.
See x10scripts(5) for the meaning of each bit, which differs for Heyu
and Xtend bitmaps. These are the values of the variables provided
in the script environment as \'X10_Hu\'.
.br
heyu_state Hu Heyu script environment state bitmap with dimlevel
as a percentage of full brightness.
.br
heyu_rawstate Hu Heyu script environment state bitmap with
native level (0-210, 1-32, 0-63, 0-15, 0-255).
.br
heyu_vflagstate Hu Heyu script environment vFlag state bitmap
.br
xtend_state Hu Xtend script environment state bitmap
.PP
rcstemp H Retrieves the stored value of temperature from an
RCS compatible thermometer which has previously been stored in
the Heyu Engine state tables by either an automatic report or
resulting from a query of the thermometer.
.PP
The following command directs the state engine to write an updated
state file to the hard drive.
.br
fetchstate
.br
This command should be required only if the configuration directive
AUTOFETCH has been changed to NO, _and_ it\'s important to know the
addressed/unaddressed state of a module. Here\'s why:
.br
The state engine automatically updates the state file whenever an
X10 function is sent or received, but not when an X10 address is
sent or received until the X10 function which normally follows.
The state file is used only when a state command, e.g., \'onstate\' or
\'dimstate\' command is issued from the command line. (The environment
variables supplied by Heyu when a script is launched by the state
engine are created directly from the engine\'s memory record and not
the state file.)
Of the state commands, only \'addrstate\', \'heyu_state\',
\'xtend_state\' report the addressed state of a module or modules.
If the configuration directive AUTOFETCH retains its default value
of YES, these commands will automatically call for an update of the
state file. If AUTOFETCH is changed to NO _and_ an X10 address is
sent or received without a following X10 function, then it will be
necessary to execute \'heyu fetchstate\' before the any of the above
mentioned state commands in order for the reported addressed state
to be correct.
.br
Example: If AUTOFETCH is set to NO and the following sequence of
X10 signals is received:
.br
address unit 1 : housecode A
.br
function On : housecode A
.br
address unit 2 : housecode A
.br
Then the command \'heyu addrstate An\' will incorrectly show
A1 as addressed and A2 as unaddressed unless \'heyu fetchstate\'
is run first.
.br
(The above may be a little confusing but the vast majority of users can
safely ignore both the \'fetchstate\' command and the AUTOFETCH
configuration directive.)
.PP
The following state commands retrieve data received from RFXSensors
and stored in Heyu\'s state tables. See man page x10rfxsensors(5)
for details.
.PP
rfxtemp Hu Stored Temperature
.br
rfxrh Hu Stored Relative Humidity
.br
rfxbp Hu Stored Barometric Pressure
.br
rfxvs Hu Stored Supply Voltage
.br
rfxvad Hu Stored A/D Voltage
.br
rfxvadi Hu Stored internal A/D Voltage
.br
rfxpot Hu Stored Potentiometer setting
.br
rfxtemp2 Hu Stored Second Temperature
.br
rfxlobat Hu Stored Low Battery status (1 = Low, 0 = Normal)
.PP
The following state commands retrieve data received from RFXMeters
and stored in Heyu's state tables. See man page x10rfxmeters(5)
for details.
.PP
rfxpower Hu Stored Watt-Hour meter reading.
.br
rfxpanel [N] Stored total Watt-Hour reading for power panel N
.br
rfxwater Hu Stored Water meter reading
.br
rfxgas Hu Stored Gas meter reading
.br
rfxpulse Hu Stored Pulse meter reading
.br
rfxcount Hu Stored raw counter reading
.PP
The following state commands retrieve data received from the
DigiMax 210 Thermostat. See man page x10digimax(5) for details.
.PP
dmxtemp Hu Stored current temperature (C)
.br
dmxsetpoint Hu Stored setpoint temperature (C)
.br
dmxstatus Hu Stored On/Off status (1 = On)
.br
dmxmode Hu Stored Heat/Cool mode (1 = Heat)
.PP
The following state commands retrieve data received from Oregon
Temperature/Relative Humidity/Barometric Pressure sensors, Wind or Rain
sensors, or Radio Clocks. See man page x10oregon(5) for details.
.PP
oretemp Hu Stored temperature reading.
.br
orerh Hu Stored Relative Humidity.
.br
orebp Hu Stored Barometric Pressure.
.br
oredt Hu Stored Date and Time.
.br
orewindavsp Hu Stored Wind Average Speed.
.br
orewindsp Hu Stored Wind Instantaneous Speed.
.br
orewinddir Hu Stored Wind Direction angle.
.br
orerainrate Hu Stored Rainfall Rate.
.br
oreraintot Hu Stored Rainfall Total Accumulation.
.br
elscurr Hu Stored Electrisave Current reading.
.PP
The following command allows an external program to store Temp/RH/BP data
in the state table for a emulation (dummy) Oregon module for processing
by Heyu, just as if the data were received from an actual Oregon sensor.
.PP
heyu ore_emu Hu <func> <value>
.PP
See section "OREGON SENSOR EMULATION" in man page x10oregon(5) for
details.
.PP
The following command allows an external program to emulate a signal
from an X10 Security sensor or remote, as if the signal were received
from an actual device.
.PP
heyu sec_emu Hu <func> <flags>
.PP
where <funct> must be one which is transmitted by the physical
security sensor or remote mapped to Hu. Like other Heyu function names
it must be entered in all lower case.
.br
<func> may be: alert, clear, sectamper, panic, arm, disarm,
test, slightson, slightsoff, sdusk, sdawn, akeyon, akeyoff, bkeyon, or
bkeyoff.
.PP
The <flags> must be specified as they would appear in the monitor/logfile
when an actual RF transmission is received, although they are not case
sensitive and can appear in any order after the <func>. There are
no defaults, e.g., for a door/window sensor with a Min/Max switch, either
swmin or swmax must be specified.
.br
<flags> may be: swmin, swmax, swhome, swaway, main, aux, and lobat as
supported by the particular sensor. Do not specify the tamper flag as it
is handled differently from the other flags.
.SH DIRECT COMMANDS
Heyu version 2 greatly expands the number of commands which can be executed
directly from the command line. All commands which the CM11A is capable
of sending are now available, although many of them will be of little use
to the average user.
.br
Enter \'heyu help\' for a complete up-to-date listing of the
commands and their syntax. A number of commands have synonyms which some
users may find easier to remember. Enter \'heyu syn\' to see the
synonyms for each command.
.br
Although a few commands are different, the command syntax in general
is as follows:
.br
heyu \<command\> Housecode|Units [\<data\>]
.PP
The usual Housecode|Units address is comprised of a case-insensitive
housecode letter A through P, followed with no intervening spaces by a
list of the particular unit codes to be addressed, ranging from 1 through 16.
Unit code 0 is acceptable (but not necessary) for commands which don\'t
require any unit codes.
.br
An \'alias\' defined in the configuration file can be used in place of
a Housecode|Units string.
.br
For any command, using an underscore (\'_\') in place of the housecode letter
will direct Heyu to substitute the default housecode defined in the
configuration file.
.br
The units list may consist of a single unit, multiple units delimited
by commas, a range of units separated with a \'-\' sign, or a combination
of the foregoing.
.br
The following are examples of valid Housecode|Unit addresses:
.br
A7