Updated Script Cookbook (markdown)

gemu 2019-07-28 19:40:59 +02:00
parent 82f021809a
commit fda6769f36
1 changed files with 60 additions and 60 deletions

@ -625,77 +625,77 @@ next
\>R
------------------------------------------------------------------------------
#### Multiple IR Receiver Synchronization
since i own a magic home with ir receiver i made a script to show how it works
i have 2 magic home devices that should be synchronized so i send the commands also to a second magic home via websend
#### Multiple IR Receiver Synchronization
since i own a magic home with ir receiver i made a script to show how it works
i have 2 magic home devices that should be synchronized so i send the commands also to a second magic home via websend
; define (expand string section to 25 chars)
>D 25
istr=""
ws="websend [192.168.178.84]"
; define (expand string section to 25 chars)
\>D 25
istr=""
ws="websend [192.168.178.84]"
; event section
\>E
; get ir data
istr=IrReceived#Data
; event section
\>E
; get ir data
istr=IrReceived#Data
; on
if istr=="0x00F7C03F"
then
=>wakeup
=>%ws% wakeup
endif
; on
if istr=="0x00F7C03F"
then
=>wakeup
=>%ws% wakeup
endif
; off
if istr=="0x00F740BF"
then
=>power1 0
=>%ws% power1 0
endif
; off
if istr=="0x00F740BF"
then
=>power1 0
=>%ws% power1 0
endif
;white
if istr=="0x00F7E01F"
then
=>color 000000ff
=>%ws% color 000000ff
endif
;white
if istr=="0x00F7E01F"
then
=>color 000000ff
=>%ws% color 000000ff
endif
;red
if istr=="0x00F720DF"
then
=>color ff000000
=>%ws% color ff000000
endif
;red
if istr=="0x00F720DF"
then
=>color ff000000
=>%ws% color ff000000
endif
;green
if istr=="0x00F7A05F"
then
=>color 00ff0000
=>%ws% color 00ff0000
endif
;green
if istr=="0x00F7A05F"
then
=>color 00ff0000
=>%ws% color 00ff0000
endif
;blue
if istr=="0x00F7609F"
then
=>color 0000ff00
=>%ws% color 0000ff00
endif
;blue
if istr=="0x00F7609F"
then
=>color 0000ff00
=>%ws% color 0000ff00
endif
; dimmer up
if istr=="0x00F700FF"
then
=>dimmer +
=>%ws% dimmer +
endif
; dimmer up
if istr=="0x00F700FF"
then
=>dimmer +
=>%ws% dimmer +
endif
;dimmer down
if istr=="0x00F7807F"
then
=>dimmer -
=>%ws% dimmer -
endif
;dimmer down
if istr=="0x00F7807F"
then
=>dimmer -
=>%ws% dimmer -
endif
istr=""
istr=""
[Back To Top](#top)