node-red-contrib-sun-position
node-red-contrib-sun-position copied to clipboard
Error using inject with "next rise time by elevation": could not evaluate pdsTimeByElevationRise
Describe the bug I'm trying to use the following inject node to inject an event when the sun next rises to 5 deg of elevation.
[{"id":"0f230547e828b5dd","type":"time-inject","z":"7dda3d8b8210ba79","name":"","nameInt":"⏲ \"next rise time by elevation\" =...","positionConfig":"ee18b20eaeb8ee59","props":[{"p":"","pt":"msgPayload","v":"","vt":"date","o":"","oT":"none","oM":"60000","f":0,"fS":0,"fT":"UNIX timestamp (ms)","fI":"0","next":true,"days":"*","months":"*","onlyOddDays":false,"onlyEvenDays":false,"onlyOddWeeks":false,"onlyEvenWeeks":false},{"p":"","pt":"msgTopic","v":"","vt":"str","o":"","oT":"none","oM":"60000","f":0,"fS":0,"fT":"UNIX timestamp (ms)","fI":"0","next":false,"days":"*","months":"*","onlyOddDays":false,"onlyEvenDays":false,"onlyOddWeeks":false,"onlyEvenWeeks":false}],"injectTypeSelect":"time","intervalCount":1,"intervalCountType":"num","intervalCountMultiplier":60000,"cron":"","cronType":"cronexpr","time":"5.0","timeType":"pdsTimeByElevationRise","offset":0,"offsetType":"none","offsetMultiplier":60000,"timeEnd":"","timeEndType":"entered","timeEndOffset":0,"timeEndOffsetType":"none","timeEndOffsetMultiplier":60000,"timeDays":"*","timeOnlyOddDays":false,"timeOnlyEvenDays":false,"timeOnlyOddWeeks":false,"timeOnlyEvenWeeks":false,"timeMonths":"*","timedatestart":"","timedateend":"","property":"","propertyType":"none","propertyCompare":"true","propertyThreshold":"","propertyThresholdType":"num","timeAlt":"","timeAltType":"entered","timeAltDays":"*","timeAltOnlyOddDays":false,"timeAltOnlyEvenDays":false,"timeAltOnlyOddWeeks":false,"timeAltOnlyEvenWeeks":false,"timeAltMonths":"*","timeAltOffset":0,"timeAltOffsetType":"none","timeAltOffsetMultiplier":60000,"once":false,"onceDelay":0.1,"recalcTime":2,"x":480,"y":480,"wires":[[]]},{"id":"ee18b20eaeb8ee59","type":"position-config","name":"MyLoc","isValide":"true","angleType":"deg","timeZoneOffset":"99","timeZoneDST":"0","stateTimeFormat":"3","stateDateFormat":"12","contextStore":""}]
It produces the following error:
21 Jun 19:47:45 - [error] [time-inject:0f230547e828b5dd] Error "could not evaluate [object Object] as a valid Date or time.", could not evaluate pdsTimeByElevationRise.5.0
RED.httpAdmin.get data ERR
Error: Error "could not evaluate [object Object] as a valid Date or time.", could not evaluate pdsTimeByElevationRise.5.0
at positionConfigurationNode.getTimeProp (/opt/node_modules/node-red-contrib-sun-position/nodes/10-position-config.js:1184:27)
Error: could not evaluate [object Object] as a valid Date or time.
at Object.getDateOfText (/opt/node_modules/node-red-contrib-sun-position/nodes/lib/dateTimeHelper.js:1264:11)
at positionConfigurationNode.getTimeProp (/opt/node_modules/node-red-contrib-sun-position/nodes/10-position-config.js:1170:48)
at /opt/node_modules/node-red-contrib-sun-position/nodes/10-position-config.js:1920:37
at Layer.handle [as handle_request] (/opt/node_modules/express/lib/router/layer.js:95:5)
at next (/opt/node_modules/express/lib/router/route.js:137:13)
at /opt/node_modules/@node-red/editor-api/lib/auth/index.js:75:13
at Layer.handle [as handle_request] (/opt/node_modules/express/lib/router/layer.js:95:5)
at next (/opt/node_modules/express/lib/router/route.js:137:13)
at Route.dispatch (/opt/node_modules/express/lib/router/route.js:112:3)
at Layer.handle [as handle_request] (/opt/node_modules/express/lib/router/layer.js:95:5) {
original: Error: could not evaluate [object Object] as a valid Date or time.
at Object.getDateOfText (/opt/node_modules/node-red-contrib-sun-position/nodes/lib/dateTimeHelper.js:1264:11)
at positionConfigurationNode.getTimeProp (/opt/node_modules/node-red-contrib-sun-position/nodes/10-position-config.js:1170:48)
at /opt/node_modules/node-red-contrib-sun-position/nodes/10-position-config.js:1920:37
at Layer.handle [as handle_request] (/opt/node_modules/express/lib/router/layer.js:95:5)
at next (/opt/node_modules/express/lib/router/route.js:137:13)
at /opt/node_modules/@node-red/editor-api/lib/auth/index.js:75:13
at Layer.handle [as handle_request] (/opt/node_modules/express/lib/router/layer.js:95:5)
at next (/opt/node_modules/express/lib/router/route.js:137:13)
at Route.dispatch (/opt/node_modules/express/lib/router/route.js:112:3)
at Layer.handle [as handle_request] (/opt/node_modules/express/lib/router/layer.js:95:5)
}
21 Jun 19:51:13 - [error] [time-inject:0f230547e828b5dd] Error "could not evaluate [object Object] as a valid Date or time.", could not evaluate pdsTimeByElevationRise.5.0
Screenshots
![image](https://user-images.githubusercontent.com/13173423/174933153-b3d16fbe-b998-4fcd-9068-6ee3ce536b35.png)
Expected behavior A clear and concise description of what you expected to happen.
System information (please complete the following information):
- Node Version - current
npm
version and also tried 3.0.0-alpha - Node-Red Version - 2.2.2
Additional context
I downloaded the source to see if I could help debug it. Is there a convenient way to take a node export like above to seed the object for a new test case to run with npm test
?