node-red-contrib-ui-time-scheduler
node-red-contrib-ui-time-scheduler copied to clipboard
Function of top output
Is the top output supposed to send out a JSON summary of all timers whenever a setting is changed via the node's input?
I am not seeing any output on this line except for very occasionally(?) and I have not identified a pattern for its behaviour, apart from when injecting a msg.getStatus into the node.
Thanks
I have worked out the issue:
- If you change any timer settings via the dashboard, the top output sends out a JSON payload of all current settings.
- If you inject any new settings into the node, it does not send out a JSON payload.
This is maybe by design and just means that if, for example, you read in some settings from a save fle, modify them and inject them into the node, you have to arrange for the updated into to be written to the save file - you can't rely on it come out of the top output.
Example:
Hi @linker3000,
it's actually by design and well documented (see the docs here) but I think I understand why you would expect the node to trigger the output when you change its values via payload.
I've implemented a fix - would you mind testing before I create an official update? You only need to replace your time-scheduler.js with the one here in this repo.
EDIT: the change makes sure to only output actual changes, so there is no output at the top when you inject the same payload twice
EDIT: Also see my next post for a snag.
Hi @fellinga,
Thanks for the quick response.
With the updated code, I am seeing a payload on the top output for dashboard and injected changes so that's perfect.
Now I just have to change my flows to remove the file save operation from my function outputs to stop a (harmless) double file write.
Cheers!
Just spotted an issue:
if I push a new payload with an added config for an output (say 0), that is for a time period of 'now' to 'now+2hr' (a heating boost), I see this reflected in the dashboard, but if I then delete the 'boost' selectively by pushing a new config or through the dashboard, or by loading an empty config, the dashboard updates, but there's no top output AND the device output does not send out a new value.
This situation happens if "Output "off" payloads only at the defined end time" is ticked. If it is unticked then the relevant output/s update,
It seems that the timer outputs are not re-evaluated fully if there's a config update and existing 'live' end times are changed or deleted.