When switching the actuator, set the value to the sensor

It is convenient to use when setting up scripts without real devices.
As discrete sensors, you can use virtual motion sensors, door opening sensors, fire sensors, etc.

Script

/** 
* @name Discrete Sensor Emulation  
* @desc  When switching the actuator, set the value to the sensor 
* @version 4
*/
const actor = Device("ActorD", "Actuator"); 
const sensor = Device("SensorD", "Sensor"); 

startOnChange(actor);

script ({
    start() {
        this.assign(sensor, "dval",actor.value ); 
    } 
});
Close Menu