Bij 'Switches' linksboven een schakelaar handmatig toevoegen.
Even een copy-paste van een stukje van een
handleiding die ook een virtuele switch gebruikt
To create a virtual switch, you first have to create a virtual hardware device.
Go to Setup > Hardware. Type in a name (I use 'DUMMY'), choose 'Dummy (Does nothing, use for virtual switches only)' from the drop-down. Leave 'Data timeout' disabled. Click on 'Add'
Creating a virtual switch
To create a virtual switch, go to the 'Switches' tab. Click the 'Manual Light/Switch' button in the upper left corner. Choose the dummy hardware from the drop-down. Enter a name ('John Doe smartphone'). Switch type 'On/off'. Type 'X10'. For 'House code' and 'Unit code', choose some random, doesn't really matter. As 'Main Device'.
It is advisable to make the switch 'protected', so the switch can only be operated by the detection script and not by you, by accidentally clicking on it

De naam kun je zelf kiezen, jij kunt dus iets pakken als '15min_voor_zon_onder'

Daarna kan je onder de schakelaar op het knopje 'Timers' klikken, en daar instellen dat hij aan moet gaan xx minuten voor-na zonsondergang/bepaald tijdstip/voor-na zonsopgang etc etc etc.
Daar baseer je dan je event op. Als de virtuele schakelaar = aan, en de lamp uit DO lamp = aan
Volgens mij kun je de lamp ook weer uit zetten als de schakelaar uitgaat door een 'ELSE IF' blok te gebruiken. Dan wordt het volgens mij ELSE IF virtuele_switch = off AND lamp = on DO lamp = off
Voor jou is deze ook wel handig
Blockly examples. Zoals je ziet hebben de meeste events meerdere AND statements. Dat is ook wel noodzakelijk, want stel dat je alleen een check doet of zonsondergang is geweest en daarmee een lamp aanzet. Als je geen check uitvoert of de lamp al aan staat, zal hij dus iedere keer een 'On' commando sturen. Daar merk je zelf misschien niets van, maar het vreet wel resources, en je vervuilt de 433Mhz band.
[
Voor 36% gewijzigd door
ThinkPad op 31-10-2014 08:54
]