I never have used get history node before. I want node red to, every 24 hours, check the last time a switch was turned on. If its been more than 48hrs since it was turned on, send an alert.
I just dont know how to use the info the ‘get history’ node spits out. How would I check to see if the last timestamp was more than 48 hours old?
[{"id":"c6dd4022.7c84","type":"tab","label":"Flow 1","disabled":false,"info":""},{"id":"c64c8ed1.6c8a6","type":"api-get-history","z":"c6dd4022.7c84","name":"","server":"ab3e2c53.e3491","version":0,"startdate":"","enddate":"","entityid":"light.office","entityidtype":"is","useRelativeTime":false,"relativeTime":"","flatten":true,"output_type":"array","output_location_type":"msg","output_location":"payload","x":1060,"y":261,"wires":[["4a6cfb18.98f904"]]},{"id":"7d1a60f.78ff5a","type":"inject","z":"c6dd4022.7c84","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":830,"y":261,"wires":[["c64c8ed1.6c8a6"]]},{"id":"4a6cfb18.98f904","type":"debug","z":"c6dd4022.7c84","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":1279,"y":261,"wires":[]},{"id":"ab3e2c53.e3491","type":"server","name":"AvilaSmartHomeRpi","version":1,"legacy":false,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true}]