[{"id":"d8efaaa0899b7acd","type":"inject","z":"8c5e3b3055a6baaa","name":"Timestamp","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"60","crontab":"","once":true,"onceDelay":"5","topic":"date-time","payload":"","payloadType":"date","x":110,"y":200,"wires":[["7b1b2c81dd3b8bab","ba4add60e4de3da7","d99ac08d.fdb94","a744227844b59f34","ac84bb62380670e8","5983f248b4210ec9","787bdac64db5d38e","338f344d93d7ab9b"]]},{"id":"a744227844b59f34","type":"ha-sensor","z":"8c5e3b3055a6baaa","name":"Moon Age","entityConfig":"6a7749c3e795a668","version":0,"state":"453000000000","stateType":"num","attributes":[],"inputOverride":"allow","outputProperties":[],"x":160,"y":340,"wires":[[]]},{"id":"ac84bb62380670e8","type":"ha-sensor","z":"8c5e3b3055a6baaa","name":"Moon Density","entityConfig":"0b6cc163cc6279c3","version":0,"state":"3.34","stateType":"num","attributes":[],"inputOverride":"allow","outputProperties":[],"x":180,"y":400,"wires":[[]]},{"id":"5983f248b4210ec9","type":"ha-sensor","z":"8c5e3b3055a6baaa","name":"Moon Gravity","entityConfig":"2a5674e39c5fe24d","version":0,"state":"1.62","stateType":"num","attributes":[],"inputOverride":"allow","outputProperties":[],"x":170,"y":460,"wires":[[]]},{"id":"787bdac64db5d38e","type":"ha-sensor","z":"8c5e3b3055a6baaa","name":"Moon Radius","entityConfig":"ac7d7cfde27b4e50","version":0,"state":"1737.4","stateType":"num","attributes":[],"inputOverride":"allow","outputProperties":[],"x":170,"y":520,"wires":[[]]},{"id":"338f344d93d7ab9b","type":"ha-sensor","z":"8c5e3b3055a6baaa","name":"Moon Apparent Magnitude","entityConfig":"e1e183afd2ebe230","version":0,"state":"-12.74","stateType":"num","attributes":[],"inputOverride":"allow","outputProperties":[],"x":220,"y":580,"wires":[[]]},{"id":"d99ac08d.fdb94","type":"moon-position","z":"8c5e3b3055a6baaa","name":"","positionConfig":"31826811.22a458","rules":[],"topic":"","outputs":1,"x":300,"y":700,"wires":[["01425d6b40433043","4d098cf69c0d1386","ee64561f7d544557","9fed9ae5a7e67ec0","0d3f91975205d04d","8ca42cdafedce756","770ae4c3f5715e54","2cf84b33f3348465","4499d65ead8a0323","f4f1a84c79fb70fa","8037990bab97d27d","c86dba61d4294d46","43902da3a9d9c64b","d8f1dc37a1d445f6","1ede46c7c1abb3c2","37af0e66c01f18bf","1d386581e79cca65","7bc7e846a2cf8486"]]},{"id":"01425d6b40433043","type":"ha-binary-sensor","z":"8c5e3b3055a6baaa","name":"above horizon","entityConfig":"e83de2bfb20f08c8","version":0,"state":"payload.isUp","stateType":"msg","attributes":[],"inputOverride":"allow","outputProperties":[],"x":560,"y":260,"wires":[[]]},{"id":"ee64561f7d544557","type":"ha-sensor","z":"8c5e3b3055a6baaa","name":"azimuth","entityConfig":"b3cdc18e8f681572","version":0,"state":"payload.azimuth","stateType":"msg","attributes":[],"inputOverride":"allow","outputProperties":[],"x":540,"y":320,"wires":[[]]},{"id":"9fed9ae5a7e67ec0","type":"ha-sensor","z":"8c5e3b3055a6baaa","name":"altitude","entityConfig":"ca133e560867ffbb","version":0,"state":"payload.altitude","stateType":"msg","attributes":[],"inputOverride":"allow","outputProperties":[],"x":540,"y":380,"wires":[[]]},{"id":"0d3f91975205d04d","type":"ha-sensor","z":"8c5e3b3055a6baaa","name":"distance","entityConfig":"aed9837121d8389c","version":0,"state":"payload.distance","stateType":"msg","attributes":[],"inputOverride":"allow","outputProperties":[],"x":540,"y":440,"wires":[[]]},{"id":"8ca42cdafedce756","type":"ha-sensor","z":"8c5e3b3055a6baaa","name":"parallacticAngle","entityConfig":"fbee95713584b7e3","version":0,"state":"payload.parallacticAngle","stateType":"msg","attributes":[],"inputOverride":"allow","outputProperties":[],"x":560,"y":500,"wires":[[]]},{"id":"770ae4c3f5715e54","type":"ha-sensor","z":"8c5e3b3055a6baaa","name":"illumination.fraction","entityConfig":"cd8195b35d10427e","version":0,"state":"payload.illumination.fraction","stateType":"msg","attributes":[],"inputOverride":"allow","outputProperties":[],"x":570,"y":560,"wires":[[]]},{"id":"2cf84b33f3348465","type":"ha-sensor","z":"8c5e3b3055a6baaa","name":"illumination.phase.name","entityConfig":"6a26472d3857b1a9","version":0,"state":"payload.illumination.phase.name","stateType":"msg","attributes":[],"inputOverride":"allow","outputProperties":[],"x":590,"y":620,"wires":[[]]},{"id":"4499d65ead8a0323","type":"ha-sensor","z":"8c5e3b3055a6baaa","name":"illumination.phaseValue","entityConfig":"16245a092f465ac3","version":0,"state":"payload.illumination.phaseValue","stateType":"msg","attributes":[],"inputOverride":"allow","outputProperties":[],"x":590,"y":680,"wires":[[]]},{"id":"f4f1a84c79fb70fa","type":"ha-sensor","z":"8c5e3b3055a6baaa","name":"illumination.zenithAngle","entityConfig":"adf4bcd33a0bdfa2","version":0,"state":"payload.illumination.zenithAngle","stateType":"msg","attributes":[],"inputOverride":"allow","outputProperties":[],"x":590,"y":740,"wires":[[]]},{"id":"8037990bab97d27d","type":"ha-sensor","z":"8c5e3b3055a6baaa","name":"times.rise","entityConfig":"795c29977f2fde78","version":0,"state":"payload.times.rise","stateType":"msg","attributes":[],"inputOverride":"allow","outputProperties":[],"x":540,"y":800,"wires":[[]]},{"id":"c86dba61d4294d46","type":"ha-sensor","z":"8c5e3b3055a6baaa","name":"times.set","entityConfig":"ec1cbad4d9505762","version":0,"state":"payload.times.set","stateType":"msg","attributes":[],"inputOverride":"allow","outputProperties":[],"x":540,"y":860,"wires":[[]]},{"id":"d8f1dc37a1d445f6","type":"ha-binary-sensor","z":"8c5e3b3055a6baaa","name":"moon.alwaysUp","entityConfig":"99ef085f01b6abcb","version":0,"state":"payload.times.alwaysUp","stateType":"msg","attributes":[],"inputOverride":"allow","outputProperties":[],"x":560,"y":920,"wires":[[]]},{"id":"43902da3a9d9c64b","type":"ha-binary-sensor","z":"8c5e3b3055a6baaa","name":"moon.AlwaysDown","entityConfig":"14ef7b17b7af197a","version":0,"state":"payload.times.alwaysDown","stateType":"msg","attributes":[],"inputOverride":"allow","outputProperties":[],"x":570,"y":980,"wires":[[]]},{"id":"1ede46c7c1abb3c2","type":"ha-sensor","z":"8c5e3b3055a6baaa","name":"times.highest","entityConfig":"13c87a39444188b0","version":0,"state":"payload.times.highest","stateType":"msg","attributes":[],"inputOverride":"allow","outputProperties":[],"x":550,"y":1040,"wires":[[]]},{"id":"37af0e66c01f18bf","type":"ha-sensor","z":"8c5e3b3055a6baaa","name":"timesNext.rise","entityConfig":"685d8471bbb8bac3","version":0,"state":"payload.timesNext.rise","stateType":"msg","attributes":[],"inputOverride":"allow","outputProperties":[],"x":560,"y":1100,"wires":[[]]},{"id":"1d386581e79cca65","type":"ha-sensor","z":"8c5e3b3055a6baaa","name":"timesNext.set","entityConfig":"05c90a4ef4106306","version":0,"state":"payload.timesNext.set","stateType":"msg","attributes":[],"inputOverride":"allow","outputProperties":[],"x":560,"y":1160,"wires":[[]]},{"id":"7bc7e846a2cf8486","type":"ha-sensor","z":"8c5e3b3055a6baaa","name":"timesNext.highest","entityConfig":"22b2306a5ab0a8af","version":0,"state":"payload.timesNext.highest","stateType":"msg","attributes":[],"inputOverride":"allow","outputProperties":[],"x":570,"y":1220,"wires":[[]]},{"id":"6a7749c3e795a668","type":"ha-entity-config","server":"c879ac61.99cd1","deviceConfig":"cf0cb29df689c97a","name":"Moon Age","version":"6","entityType":"sensor","haConfig":[{"property":"name","value":"Moon Moon Age"},{"property":"icon","value":""},{"property":"entity_picture","value":""},{"property":"entity_category","value":"diagnostic"},{"property":"device_class","value":""},{"property":"unit_of_measurement","value":"years"},{"property":"state_class","value":""}],"resend":false,"debugEnabled":false},{"id":"0b6cc163cc6279c3","type":"ha-entity-config","server":"c879ac61.99cd1","deviceConfig":"cf0cb29df689c97a","name":"Moon Density","version":"6","entityType":"sensor","haConfig":[{"property":"name","value":"Moon Density"},{"property":"icon","value":""},{"property":"entity_picture","value":""},{"property":"entity_category","value":"diagnostic"},{"property":"device_class","value":""},{"property":"unit_of_measurement","value":"g/cm³"},{"property":"state_class","value":""}],"resend":false,"debugEnabled":false},{"id":"2a5674e39c5fe24d","type":"ha-entity-config","server":"c879ac61.99cd1","deviceConfig":"cf0cb29df689c97a","name":"Moon Gravity","version":"6","entityType":"sensor","haConfig":[{"property":"name","value":"Moon Gravity"},{"property":"icon","value":""},{"property":"entity_picture","value":""},{"property":"entity_category","value":"diagnostic"},{"property":"device_class","value":""},{"property":"unit_of_measurement","value":"m/s²"},{"property":"state_class","value":""}],"resend":false,"debugEnabled":false},{"id":"ac7d7cfde27b4e50","type":"ha-entity-config","server":"c879ac61.99cd1","deviceConfig":"cf0cb29df689c97a","name":"Moon Radius","version":"6","entityType":"sensor","haConfig":[{"property":"name","value":"Moon Radius"},{"property":"icon","value":""},{"property":"entity_picture","value":""},{"property":"entity_category","value":"diagnostic"},{"property":"device_class","value":""},{"property":"unit_of_measurement","value":"km"},{"property":"state_class","value":""}],"resend":false,"debugEnabled":false},{"id":"e1e183afd2ebe230","type":"ha-entity-config","server":"c879ac61.99cd1","deviceConfig":"cf0cb29df689c97a","name":"Moon Apparent Magnitude","version":"6","entityType":"sensor","haConfig":[{"property":"name","value":"Moon Apparent Magnitude"},{"property":"icon","value":""},{"property":"entity_picture","value":""},{"property":"entity_category","value":"diagnostic"},{"property":"device_class","value":""},{"property":"unit_of_measurement","value":"(V)"},{"property":"state_class","value":""}],"resend":false,"debugEnabled":false},{"id":"31826811.22a458","type":"position-config","name":"Home Location","isValide":"true","longitude":"0","latitude":"0","angleType":"deg","timeZoneOffset":99,"timeZoneDST":0,"stateTimeFormat":"3","stateDateFormat":"12","contextStore":""},{"id":"e83de2bfb20f08c8","type":"ha-entity-config","server":"c879ac61.99cd1","deviceConfig":"cf0cb29df689c97a","name":"Moon Above Horizon","version":"6","entityType":"binary_sensor","haConfig":[{"property":"name","value":"Above Horizon"},{"property":"icon","value":""},{"property":"entity_picture","value":""},{"property":"entity_category","value":""},{"property":"device_class","value":""}],"resend":true,"debugEnabled":false},{"id":"b3cdc18e8f681572","type":"ha-entity-config","server":"c879ac61.99cd1","deviceConfig":"cf0cb29df689c97a","name":"Moon Azimuth","version":"6","entityType":"sensor","haConfig":[{"property":"name","value":"Azimuth"},{"property":"icon","value":""},{"property":"entity_picture","value":""},{"property":"entity_category","value":""},{"property":"device_class","value":""},{"property":"unit_of_measurement","value":""},{"property":"state_class","value":"measurement"}],"resend":true,"debugEnabled":false},{"id":"ca133e560867ffbb","type":"ha-entity-config","server":"c879ac61.99cd1","deviceConfig":"cf0cb29df689c97a","name":"Moon Altitude","version":"6","entityType":"sensor","haConfig":[{"property":"name","value":"Altitude"},{"property":"icon","value":""},{"property":"entity_picture","value":""},{"property":"entity_category","value":""},{"property":"device_class","value":""},{"property":"unit_of_measurement","value":""},{"property":"state_class","value":"measurement"}],"resend":false,"debugEnabled":false},{"id":"aed9837121d8389c","type":"ha-entity-config","server":"c879ac61.99cd1","deviceConfig":"cf0cb29df689c97a","name":"Moon Distance","version":"6","entityType":"sensor","haConfig":[{"property":"name","value":"Distance"},{"property":"icon","value":""},{"property":"entity_picture","value":""},{"property":"entity_category","value":""},{"property":"device_class","value":"distance"},{"property":"unit_of_measurement","value":"km"},{"property":"state_class","value":"measurement"}],"resend":false,"debugEnabled":false},{"id":"fbee95713584b7e3","type":"ha-entity-config","server":"c879ac61.99cd1","deviceConfig":"cf0cb29df689c97a","name":"Moon Parallactic Angle","version":"6","entityType":"sensor","haConfig":[{"property":"name","value":"Parallactic Angle"},{"property":"icon","value":""},{"property":"entity_picture","value":""},{"property":"entity_category","value":""},{"property":"device_class","value":""},{"property":"unit_of_measurement","value":"deg"},{"property":"state_class","value":"measurement"}],"resend":false,"debugEnabled":false},{"id":"cd8195b35d10427e","type":"ha-entity-config","server":"c879ac61.99cd1","deviceConfig":"cf0cb29df689c97a","name":"Moon Illumination Fraction","version":"6","entityType":"sensor","haConfig":[{"property":"name","value":"Illumination Fraction"},{"property":"icon","value":""},{"property":"entity_picture","value":""},{"property":"entity_category","value":""},{"property":"device_class","value":""},{"property":"unit_of_measurement","value":""},{"property":"state_class","value":"measurement"}],"resend":false,"debugEnabled":false},{"id":"6a26472d3857b1a9","type":"ha-entity-config","server":"c879ac61.99cd1","deviceConfig":"cf0cb29df689c97a","name":"Moon Illumination Phase","version":"6","entityType":"sensor","haConfig":[{"property":"name","value":"Illumination Phase"},{"property":"icon","value":""},{"property":"entity_picture","value":""},{"property":"entity_category","value":""},{"property":"device_class","value":""},{"property":"unit_of_measurement","value":""},{"property":"state_class","value":""}],"resend":false,"debugEnabled":false},{"id":"16245a092f465ac3","type":"ha-entity-config","server":"c879ac61.99cd1","deviceConfig":"cf0cb29df689c97a","name":"Moon Illumination Phase Value","version":"6","entityType":"sensor","haConfig":[{"property":"name","value":"Illumination Phase Value"},{"property":"icon","value":""},{"property":"entity_picture","value":""},{"property":"entity_category","value":""},{"property":"device_class","value":""},{"property":"unit_of_measurement","value":""},{"property":"state_class","value":"measurement"}],"resend":false,"debugEnabled":false},{"id":"adf4bcd33a0bdfa2","type":"ha-entity-config","server":"c879ac61.99cd1","deviceConfig":"cf0cb29df689c97a","name":"Moon Illumination Zenith Angle","version":"6","entityType":"sensor","haConfig":[{"property":"name","value":"Illumination Zenith Angle"},{"property":"icon","value":""},{"property":"entity_picture","value":""},{"property":"entity_category","value":""},{"property":"device_class","value":""},{"property":"unit_of_measurement","value":"deg"},{"property":"state_class","value":"measurement"}],"resend":false,"debugEnabled":false},{"id":"795c29977f2fde78","type":"ha-entity-config","server":"c879ac61.99cd1","deviceConfig":"cf0cb29df689c97a","name":"Moon Rise","version":"6","entityType":"sensor","haConfig":[{"property":"name","value":"Moon Moon Rise "},{"property":"icon","value":""},{"property":"entity_picture","value":""},{"property":"entity_category","value":""},{"property":"device_class","value":"timestamp"},{"property":"unit_of_measurement","value":""},{"property":"state_class","value":""}],"resend":true,"debugEnabled":false},{"id":"ec1cbad4d9505762","type":"ha-entity-config","server":"c879ac61.99cd1","deviceConfig":"cf0cb29df689c97a","name":"Moon Set","version":"6","entityType":"sensor","haConfig":[{"property":"name","value":"Moon Moon Set"},{"property":"icon","value":""},{"property":"entity_picture","value":""},{"property":"entity_category","value":""},{"property":"device_class","value":"timestamp"},{"property":"unit_of_measurement","value":""},{"property":"state_class","value":""}],"resend":false,"debugEnabled":false},{"id":"99ef085f01b6abcb","type":"ha-entity-config","server":"c879ac61.99cd1","deviceConfig":"cf0cb29df689c97a","name":"Moon Always Up","version":"6","entityType":"binary_sensor","haConfig":[{"property":"name","value":"Always Up"},{"property":"icon","value":""},{"property":"entity_picture","value":""},{"property":"entity_category","value":""},{"property":"device_class","value":""}],"resend":false,"debugEnabled":false},{"id":"14ef7b17b7af197a","type":"ha-entity-config","server":"c879ac61.99cd1","deviceConfig":"cf0cb29df689c97a","name":"Moon Always Down","version":"6","entityType":"binary_sensor","haConfig":[{"property":"name","value":"Always Down"},{"property":"icon","value":""},{"property":"entity_picture","value":""},{"property":"entity_category","value":""},{"property":"device_class","value":""}],"resend":true,"debugEnabled":false},{"id":"13c87a39444188b0","type":"ha-entity-config","server":"c879ac61.99cd1","deviceConfig":"cf0cb29df689c97a","name":"Moon Time Highest","version":"6","entityType":"sensor","haConfig":[{"property":"name","value":"Time Highest"},{"property":"icon","value":""},{"property":"entity_picture","value":""},{"property":"entity_category","value":""},{"property":"device_class","value":"timestamp"},{"property":"unit_of_measurement","value":""},{"property":"state_class","value":""}],"resend":false,"debugEnabled":false},{"id":"685d8471bbb8bac3","type":"ha-entity-config","server":"c879ac61.99cd1","deviceConfig":"cf0cb29df689c97a","name":"Moon Next Rise","version":"6","entityType":"sensor","haConfig":[{"property":"name","value":"Next Rise"},{"property":"icon","value":""},{"property":"entity_picture","value":""},{"property":"entity_category","value":""},{"property":"device_class","value":"timestamp"},{"property":"unit_of_measurement","value":""},{"property":"state_class","value":""}],"resend":true,"debugEnabled":false},{"id":"05c90a4ef4106306","type":"ha-entity-config","server":"c879ac61.99cd1","deviceConfig":"cf0cb29df689c97a","name":"Moon Next Set","version":"6","entityType":"sensor","haConfig":[{"property":"name","value":"Next Set"},{"property":"icon","value":""},{"property":"entity_picture","value":""},{"property":"entity_category","value":""},{"property":"device_class","value":"timestamp"},{"property":"unit_of_measurement","value":""},{"property":"state_class","value":""}],"resend":false,"debugEnabled":false},{"id":"22b2306a5ab0a8af","type":"ha-entity-config","server":"c879ac61.99cd1","deviceConfig":"cf0cb29df689c97a","name":"Moon Next Highest","version":"6","entityType":"sensor","haConfig":[{"property":"name","value":"Next Highest"},{"property":"icon","value":""},{"property":"entity_picture","value":""},{"property":"entity_category","value":""},{"property":"device_class","value":"timestamp"},{"property":"unit_of_measurement","value":""},{"property":"state_class","value":""}],"resend":false,"debugEnabled":false},{"id":"c879ac61.99cd1","type":"server","name":"Home Assistant","version":5,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":false,"cacheJson":true,"heartbeat":false,"heartbeatInterval":"30","areaSelector":"friendlyName","deviceSelector":"friendlyName","entitySelector":"friendlyName","statusSeparator":"at: ","statusYear":"hidden","statusMonth":"short","statusDay":"numeric","statusHourCycle":"h23","statusTimeFormat":"h:m","enableGlobalContextStore":true},{"id":"cf0cb29df689c97a","type":"ha-device-config","name":"Moon","hwVersion":"","manufacturer":"Node-RED","model":"node-red-contrib-sun-position","swVersion":"2.2.0-beta3"}]
I’m using it to control the brightness of blue light in my aquarium at night based on whether moon is up, or not…
This is pretty cool! I don’t have a use case for it, but someone is going to be super pumped when they find it.
Hi! This is a very impressive way of getting more information about the moon into HA, and something I have been looking for since 2018.
I imported your configuration into Node-RED, but get this error msg for all the sensor nodes: “This node requires Node-RED custom integration version 1.1.0+ to be installed in Home Assistant for it to function.”.
I am using @frenck’s add-on for Node-RED, v. 17.0.6. While I have been an active HA user for several years, I have just started my exploration of Node-RED (inspired by your way of using it to get more moon sensors).
Any idea why it won’t work?
My bad, sorry! I realised that the error msg were referring to the “Node-RED Companion”, which needs to be installed as an integration in addition to the add-on. After installing this through HACS everything works just fine. Oh, well…
Love this idea!!!
Thanks! It’s too bad HA does not have a sensor like this. It only took me about 2 years of using node-red-contrib-sun-position to realize it had moon info - who’d guess a sun add-on would have moon info? (Note to self: Should read release notes more carefully!) Maybe one day I’ll possess enough knowledge to write a custom integration for HA…