Logic Machine Forum
External writing to Scheduler - Printable Version

+- Logic Machine Forum (https://forum.logicmachine.net)
+-- Forum: LogicMachine eco-system (https://forum.logicmachine.net/forumdisplay.php?fid=1)
+--- Forum: Scripting (https://forum.logicmachine.net/forumdisplay.php?fid=8)
+--- Thread: External writing to Scheduler (/showthread.php?tid=4459)



External writing to Scheduler - tomnord - 21.12.2022

Hello. Is it possible to control schedulers from GA's? I want loacl scheduler on the LM, but want to be able to modify these over modbus or bacnet. Or as an alternative, have support for Bacnet schedule and calendar?


RE: External writing to Scheduler - Daniel - 21.12.2022

It depend what you mean by control, enabling/disabling a scheduler is there by default.


RE: External writing to Scheduler - tomnord - 22.12.2022

(21.12.2022, 14:24)Daniel Wrote: It depend what you mean by control, enabling/disabling a scheduler is there by default.

I want to modify time and possibly date..


RE: External writing to Scheduler - Daniel - 22.12.2022

This is rather complicated task. Scheduler event can be updated by script but all the event parameters must be provided. In BACnet we don't support time object so all values would have to be converted to numeric format and then back.

Example how to modify event start hour and minute
Code:
id = 123
start_hour = 12
start_min = 30

db:update('scheduler_events', {
  start_hour = start_hour,
  start_min = start_min
}, { id = id })

io.writefile('/tmp/lm-scheduler-clear', '')