Updated Script Cookbook (markdown)

gemu 2019-07-29 10:49:22 +02:00
parent 18af97aac0
commit 45ee78f814
1 changed files with 46 additions and 1 deletions

@ -624,6 +624,7 @@ next
Since I own a magic home with IR receiver I made a script to show how it works 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 I have 2 magic home devices that should be synchronized so I send the commands also to a second magic home via websend
vers1 with if then else
>; define (expand string section to 25 chars) >; define (expand string section to 25 chars)
**>D 25** **>D 25**
istr="" istr=""
@ -692,6 +693,51 @@ endif
> >
>istr="" >istr=""
vers2 with switch case ends
>; define (expand string section to 25 chars)
**>D** 25
istr=""
ws="websend [192.168.178.84]"
>; event section
**>E**
istr=IrReceived#Data
switch istr
; on
case "0x00F7C03F"
=>wakeup
=>%ws% wakeup
;off
case "0x00F740BF"
=>power1 0
=>%ws% power1 0
;white
case "0x00F7E01F"
=>color 000000ff
=>%ws% color 000000ff
;red
case "0x00F720DF"
=>color ff000000
=>%ws% color ff000000
;green
case "0x00F7A05F"
=>color 00ff0000
=>%ws% color 00ff0000
;blue
case "0x00F7609F"
=>color 0000ff00
=>%ws% color 0000ff00
; dimmer up
case "0x00F700FF"
=>dimmer +
=>%ws% dimmer +
; dimmer down
case "0x00F7807F"
=>dimmer -
=>%ws% dimmer -
ends
>
>istr=""
[Back To Top](#top) [Back To Top](#top)
------------------------------------------------------------------------------ ------------------------------------------------------------------------------
@ -826,4 +872,3 @@ endif
[Back To Top](#top) [Back To Top](#top)
------------------------------------------------------------------------------ ------------------------------------------------------------------------------