Ситуация такая: создан сценарий в виде js-скрипта, всё работает, но после перезагрузки сценарий не включается из-за тайм-аутов инициализации датчика. Датчик пробовал другой в параметры подставлять - не помогает.
19-03-2026 10:04:59.732 ERROR: [rule error] [WBSC‑base-mod/bedroom_heating]: Linked controls not ready in 60s: cityron-pu-3_9/Main Temperature
19-03-2026 10:04:59.712 ERROR: [rule error] [WBSC‑base-mod/bedroom_heating]: Controls not ready within timeout: cityron-pu-3_9/Main Temperature
19-03-2026 10:04:00.229 INFO: all rule files are loaded
19-03-2026 10:03:59.256 ERROR: [rule error] Error in getting device: Device with given ID doesn't exist
19-03-2026 10:03:56.032 ERROR: [rule error] failed to SetValue for unexisting control wb-mr6cv3_156/K3: true
19-03-2026 10:03:55.968 ERROR: [rule error] failed to SetValue for unexisting control wb-mr6cv3_156/K2: true
19-03-2026 10:03:55.037 INFO: [rule info] add your rules to /etc/wb-rules/
19-03-2026 10:03:53.433 WARNING: [rule warning] DAC: no config file
19-03-2026 10:03:31.607 INFO: [engine] Starting sync loop
19-03-2026 10:03:31.569 INFO: the engine is ready
19-03-2026 10:03:31.546 INFO: [engine] Starting main loop
19-03-2026 10:03:28.754 INFO: [wbgo_mqtt] wb-rules-engine-wirenboard-AE6KYKQZ-2467: MQTT connection established
19-03-2026 10:03:28.690 INFO: [rule info] using file /var/lib/wirenboard/wbrules-persistent.db for persistent DB
19-03-2026 10:03:28.419 INFO: driver is ready
19-03-2026 10:03:28.309 INFO: wait for driver to become ready
19-03-2026 10:03:28.237 INFO: driver loop is started
19-03-2026 10:03:28.134 INFO: [wbgo_mqtt] rules-wirenboard-AE6KYKQZ-2467: MQTT connection established
19-03-2026 10:03:27.885 INFO: driver is created
19-03-2026 10:03:27.651 INFO: broker URL is default and mosquitto socket detected, trying to connect via it
19-03-2026 10:03:24.488 2026/03/19 10:03:24 ERROR: metrics: disable exposing PSI metrics because of failed init: open /sys/fs/cgroup/system.slice/wb-rules.service/cpu.pressure: no such file or directory
19-03-2026 10:01:33.656 INFO: [engine] Stop main loop
19-03-2026 10:01:33.501 INFO: [engine] Stopping sync loop
defineVirtualDevice('invert-heater-for-bedroom', { title: 'Invert Heater - Bedroom' , cells: { Enabled: { title: "Enabled", type: "switch", value: true, readonly : true }, Enabled_1: { title: "Угол и правое окно", type: "switch", value: !dev["wb-gpio/EXT1_K1"] }, Enabled_2: { title: "Левое окно", type: "switch", value: !dev["wb-gpio/EXT1_K2"] }, Enabled_3: { title: "У входа в гардеробную", type: "switch", value: !dev["wb-gpio/EXT1_K3"] } } })defineRule({
whenChanged: [“invert-heater-for-bedroom/Enabled”],
then: function(newValue, devName, cellName){
dev[“invert-heater-for-bedroom/Enabled_1”] = newValue;
dev[“invert-heater-for-bedroom/Enabled_2”] = newValue;
dev[“invert-heater-for-bedroom/Enabled_3”] = newValue;
dev[“wb-gpio/EXT1_K1”] = !newValue;
dev[“wb-gpio/EXT1_K2”] = !newValue;
dev[“wb-gpio/EXT1_K3”] = !newValue;
}
});/**
- @file: init-heating.js
*/// Step 1: import module
var CustomTypeSc = require(‘thermostat.mod’).ThermostatScenario;function main() {
var scenarioName = ‘bedroom heating’;
log.debug(‘Start init logic for: “{}”’, scenarioName);// Step 2: Create new instance with scenario class
var scenario = new CustomTypeSc();// Step 3: Configure algorithm
var cfg = {
idPrefix: ‘bedroom_heating’,// Не обязательный параметр, можно не указывать
targetTemp: dev[“cityron-pu-3_9/Temperature Setpoint”],
tempLimitsMin: 16,
tempLimitsMax: 29,
hysteresis: 0.2,
tempSensor: ‘cityron-pu-3_9/Main Temperature’,
// tempSensor: ‘wb-msw-v3_170/Temperature’,
actuator: ‘invert-heater-for-bedroom/Enabled’,
};// Step 4: init algorithm
try {
var isInitSuccess = scenario.init(scenarioName, cfg);if (!isInitSuccess) { log.error('Init operation aborted for scenario: "{}"', scenarioName); return; } log.debug('Initialization successful for: "{}"', scenarioName);} catch (error) {
log.error(
‘Exception during scenario initialization: “{}” for scenario: “{}”’,
error.message || error,
scenarioName
);
}
}main();
/*
defineRule({
whenChanged: [“wb-gpio/EXT1_K1”, “wb-gpio/EXT1_K2”, “wb-gpio/EXT1_K3”],
then: function(newValue, devName, cellName) {
devName = !newValue;
}
});
*/defineRule({
whenChanged: [“wbsc_bedroom_heating/target_temperature”],
then: function(newValue, devName, cellName){
dev[“cityron-pu-3_9/Temperature Setpoint”] = newValue;
}
});defineRule({
whenChanged: [“cityron-pu-3_9/Temperature Setpoint”],
then: function(newValue, devName, cellName){
dev[“wbsc_bedroom_heating/target_temperature”] = newValue;
}
});
Если чуть позже передёрнуть правило, то всё заработает:
19-03-2026 10:27:23.337 INFO: [rule info] [WBSC‑base-mod/bedroom_heating]: Scenario "bedroom heating" base initialization completed
19-03-2026 10:27:17.710 ERROR: [rule error] Error in getting device: Device with given ID doesn't exist
19-03-2026 10:27:17.155 INFO: reloading file: /etc/wb-rules/thermostats.js
19-03-2026 10:27:17.147 INFO: LiveRemoveFile: /etc/wb-rules/thermostats.js.disabled
19-03-2026 10:27:14.151 INFO: reloading file: /etc/wb-rules/thermostats.js.disabled
19-03-2026 10:27:14.130 INFO: LiveRemoveFile: /etc/wb-rules/thermostats.js
