NEWS
Будильник
-
Мой вариант) не идеал
////////////////////////////Будильник////////////////////////////////////////// on({time: "* * * * *"}, function () { var otpusk = getState('javascript.0.Scenes.Otpusk').val; if (!otpusk){ var date = new Date(); var day = date.getDay(); // 0-воскр. 6-суббота var hour = date.getHours(); var min = (date.getMinutes()<10?'0':'') + date.getMinutes(); // если минута меньше 10, то добавляем 0 var SetTime = getState('javascript.0.Scenes.Budilnik').val; if (SetTime){ SetTime = SetTime.split(":"); // массив [Часы, Минуты, Секунды] SetHour = SetTime[0]; SetMin = SetTime[1]; var allgone = getState('javascript.0.Scenes.Allgone').val; //Проверяем есть кто дома или нет if (hour == SetHour && min == SetMin && day !== 0 && day !== 6 && (allgone !== 'true' || allgone !== true)){ setState('javascript.0.Scenes.Kodi', 'true'); } } else { log('Будильник - Не задано время!'); } } });
Виджет для vis:
! ````
[{"tpl":"tplJquiInputDatetime","data":{"oid":"javascript.0.Scenes.Budilnik","visibility-cond":"==","visibility-val":1,"size":"4","timeOnly":true,"hideSeconds":true,"gestures-offsetX":0,"gestures-offsetY":0,"filterkey":"control","visibility-groups-action":"hide","signals-cond-0":"==","signals-val-0":true,"signals-icon-0":"/vis/signals/lowbattery.png","signals-icon-size-0":0,"signals-blink-0":false,"signals-horz-0":0,"signals-vert-0":0,"signals-hide-edit-0":false,"signals-cond-1":"==","signals-val-1":true,"signals-icon-1":"/vis/signals/lowbattery.png","signals-icon-size-1":0,"signals-blink-1":false,"signals-horz-1":0,"signals-vert-1":0,"signals-hide-edit-1":false,"signals-cond-2":"==","signals-val-2":true,"signals-icon-2":"/vis/signals/lowbattery.png","signals-icon-size-2":0,"signals-blink-2":false,"signals-horz-2":0,"signals-vert-2":0,"signals-hide-edit-2":false},"style":{"left":"72px","top":"17px","width":"71px","height":"34px","font-size":"","z-index":"5"},"widgetSet":"jqui"}]