SergiuToporjinschi / node-red-contrib-heater-controller

Heater controller for node-red dashboard
GNU General Public License v3.0
18 stars 17 forks source link

Function of calendar schedule in node setting #21

Closed CopyCat73 closed 4 years ago

CopyCat73 commented 5 years ago

I really appreciate your work on this and have a question about the calendar. There is a calendar in the node itself, and I can inject one using setCalendar. If I inject one, the calendar in the node settings does not change, but in the debug I can see the current schedule has changed to my injected one. So I tried to remove the calendar json in the node itself, but then it is not configured correctly. Is it just not updated after a setCalendar message or does it have another function?

SergiuToporjinschi commented 5 years ago

Hi @CopyCat73, thank you for feedback. I don't think is possible to change the calendar from the settings with a message from an input I think are quite separated things. But I will keep this ticket open to do some more research on this.

waako commented 5 years ago

I was just fiddling with this as I wanted ability to turn heating off, or at least set targetTemp to something low like 10ºC as alternative to Off.

The heater controller does register the new schedule (injected using an switch button), however:

Ideally it would update itself, unless I assume target temp is locked?

EDIT: realised that it will update at lot faster if I set my inject node with current temp to happen every 1 second, but injecting setCalendar json object doesn't seem to update the heating controller.

SergiuToporjinschi commented 4 years ago

@CopyCat73 I had a look on this. Unfortunately I cannot see a solution for this problem. Because what you see in administration mode cannot be modified via an input message. or at least I could not find a way to do that. @waako When a new calendar is received, with 'setCalendar', there you need to have already a 'currentTemp' if not, an exception can be seen in logs. as you can see it in docs

currentTemp This controller accepts one main input which has to have topic as "currentTemp" and payload needs to be a float The heater status is recalculated when this message received, or when the user is changing the target temperature. The entire control is not functional until this message is received

So that could happen only when: the node has just been deployed and there is no "currentTemp" value or when you replay the flow and not have currentTemp.

Probably can be solved with some hacks but is not my style. I prefer to keep it simple and live with this problem.