Kitchen switch

defineVirtualDevice(“alarm_kitchen”, {
title: “Alarm Kitchen”,
cells: {
enabled: {
type: “switch”,
value: false
},
}
});

defineRule(“Kitchen_switch”, {
whenChanged: “Kitchen_move/occupancy”,
then: function (newValue, devName, cellName) {
if (dev[“wb-gpio/D1_OUT”] == true){
dev[“alarm_kitchen/enabled”] = dev[“Kitchen_move/occupancy”];}
}});