node-red-contrib-sun-position: Rule of clock-timer does not match on end of the day

Describe the bug The clock timer with from date civilDusk and untilDate civilSet as the two rules, does not match the rule from date civilDusk if the time is around 23:23. A short debug shows me that the rule gets the day of tomorrow on validation, which is at that time not correct.

To Reproduce Steps to reproduce the behavior:

  1. Use this flow [{"id":"b3d46b12.0cd328","type":"debug","z":"fa2cb05e.65849","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":870,"y":880,"wires":[]},{"id":"232b5b83.34cc84","type":"clock-timer","z":"fa2cb05e.65849","name":"","topic":"","positionConfig":"873fdd2c.6a528","outputs":2,"autoTrigger":false,"autoTriggerTime":1200000,"storeName":"","overwriteExpire":"","rules":[{"index":0,"name":"","isValid":false,"valid":{},"timeValue":"sunriseEnd","timeType":"pdsTime","timeOp":0,"timeOpText":"↥ bis","offsetValue":"","offsetType":"none","multiplier":60000,"timeDays":"*","timeMonths":"*","timeOnlyEvenDays":false,"timeOnlyOddDays":false,"timeMinValue":"","timeMinType":"none","offsetMinValue":"","offsetMinType":"none","multiplierMin":60000,"timeMaxValue":"","timeMaxType":"none","offsetMaxValue":"","offsetMaxType":"none","multiplierMax":60000,"payloadValue":"true","payloadType":"bool","payloadOffsetValue":"","payloadOffsetType":"none","payloadOffsetMultiplier":60000,"payloadFormat":99,"topic":"","validOperandAValue":"","validOperandAType":"none","validOperator":"true","validOperatorText":"ist true","validOperandBValue":"","validOperandBType":"num","valid2LogOperator":0,"valid2LogOperatorText":"N/A","valid2OperandAValue":"","valid2OperandAType":"msg","valid2Operator":"true","valid2OperatorText":"ist true","valid2OperandBValue":"","valid2OperandBType":"num","description":"<div><i class=\"fa fa-clock-o\" aria-hidden=\"true\"></i> ↥ bis <var>Sonnenaufgang Ende</var></div><div><div class=\"indent-payload-text\"><i class=\"fa fa-step-backward\" aria-hidden=\"true\"></i> <span>Payload:</span> <var>true</var></div></div>","timeMinOp":0,"timeMaxOp":0},{"index":1,"name":"","isValid":false,"valid":{},"timeValue":"civilDusk","timeType":"pdsTime","timeOp":1,"timeOpText":"↧ von","offsetValue":"","offsetType":"none","multiplier":60000,"timeDays":"*","timeMonths":"*","timeOnlyEvenDays":false,"timeOnlyOddDays":false,"timeMinValue":"","timeMinType":"none","offsetMinValue":"","offsetMinType":"none","multiplierMin":60000,"timeMaxValue":"","timeMaxType":"none","offsetMaxValue":"","offsetMaxType":"none","multiplierMax":60000,"payloadValue":"true","payloadType":"bool","payloadOffsetValue":"","payloadOffsetType":"none","payloadOffsetMultiplier":60000,"payloadFormat":99,"topic":"","validOperandAValue":"","validOperandAType":"none","validOperator":"true","validOperatorText":"ist true","validOperandBValue":"","validOperandBType":"num","valid2LogOperator":0,"valid2LogOperatorText":"N/A","valid2OperandAValue":"","valid2OperandAType":"msg","valid2Operator":"true","valid2OperatorText":"ist true","valid2OperandBValue":"","valid2OperandBType":"num","description":"<div><i class=\"fa fa-clock-o\" aria-hidden=\"true\"></i> ↧ von <var>bürgerliche Abenddämmerung</var></div><div><div class=\"indent-payload-text\"><i class=\"fa fa-step-backward\" aria-hidden=\"true\"></i> <span>Payload:</span> <var>true</var></div></div>","timeMinOp":0,"timeMaxOp":0}],"payloadDefault":"false","payloadDefaultType":"bool","payloadDefaultTimeFormat":0,"payloadDefaultOffset":0,"payloadDefaultOffsetType":"none","payloadDefaultOffsetMultiplier":60000,"x":700,"y":880,"wires":[[],["b3d46b12.0cd328"]]},{"id":"b88757ba.4b66f8","type":"change","z":"fa2cb05e.65849","name":"","rules":[{"t":"set","p":"ts","pt":"msg","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":510,"y":880,"wires":[["232b5b83.34cc84"]]},{"id":"b4fe02d0.0a642","type":"inject","z":"fa2cb05e.65849","name":"2323","topic":"","payload":"1582323780000","payloadType":"num","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":330,"y":880,"wires":[["b88757ba.4b66f8"]]},{"id":"873fdd2c.6a528","type":"position-config","z":"","name":"Home","isValide":"true","longitude":"0","latitude":"0","angleType":"deg","timeZoneOffset":99,"timeZoneDST":0,"stateTimeFormat":"3","stateDateFormat":"12"}]

  2. Start the injection

  3. clock-timer does not match any rule

Expected behavior The clock-timer should match with rule 2, because from date civilDusk (Rule 2) is valid with the time 23:23.

Screenshots image

System information:

  • Version 1.0.4
  • Node-Red Version 1.0.3
  • Hardware RaspberryPi 4

Best regards Chris

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 19

Commits related to this issue

Most upvoted comments

I have implemented this in node-red-contrib-sun-position@1.0.6, This is a test release and needs to be installed explicit over command line.