Как установить время на Wiren Board 5

как установить реле реального времени в Wiren board 5 ( в комплектации есть) как настроить? можете подсказать как настроить включение по времени и отключение

если не трудно можете подсказать как установить включение реле wb-mr6c по времени с 6:00 отключение в 24:00

var motion_timer_1_timeout_ms = 5 * 1000;
var motion_timer_1_id = null;

defineRule(“motion_detector_1”, {
whenChanged: “wb-gpio/A1_IN”,
then: function (newValue, devName, cellName) {
var date = new Date();

// time point marking the beginning of the interval
// i.e. "today, at HH:MM". All dates are in UTC!
var date_start = new Date(date);
date_start.setHours(9);
date_start.setMinutes(30);

// time point marking the end of the interval
var date_end = new Date(date);
date_end.setHours(17);
date_end.setMinutes(10);

// if time is between 09:30 and 17:10 UTC
if ((date > date_start) && (date < date_end)) {
  if (newValue) {
      dev["wb-gpio"]["EXT1_R3A1"] = 1;

      if (motion_timer_1_id) {
        clearTimeout(motion_timer_1_id);
     }

      motion_timer_1_id = setTimeout(function () {
         dev["wb-gpio"]["EXT1_R3A1"] = 0;            
         motion_timer_1_id = null;
      }, motion_timer_1_timeout_ms);              
  }
 }

}
});

это правило писал не работает

предлагаю вариант по проще:

defineRule("start_rele", 
{
  when: cron("0 01 9 * *"),
  then: function () 
{
включить реле

  }
});


defineRule("stop_rele", 
{
  when: cron("0 59 23 * *"),
  then: function () 
{
выключить реле

  }
});


defineRule(“start_rele”,
{
when: cron(“0 01 9 3 0”),
then: function ()
{
dev[“wb-mr6c_25”][“K3”] = 1;
}
});
правильно пишу?

немного далеко от этого, как правильно прописать ? реле Wb-mr6c

defineRule(“start_rele”, {
when: cron(“0 30 6 * *”),
then: function () {
dev[“wb-mr6c_25”][“K3”] = 1;
log(“start_rele_06:30”);
}
});

defineRule(“start_rele”, {
when: cron(“0 59 23 * *”),
then: function () {
dev[“wb-mr6c_25”][“K3”] = 0;
log(“start_rele_23:59”);
}
});
так не работает

1 лайк

еще как в cron выставить время?

так вы правила переименуйте. у вас два правила называются одинаково.

тут не надо ничего придумывать. почитайте как правильно писать правила для cron.