I have a button next to my furnace air filter. When I change the filter, I press the button which updates a input_datetime helper to the current date/time.
I would like an efficient way to check this date to current date/time and have an alert sent to me if the two are more than 45 days apart.
For other things, I’ve just used a trigger node and had it wait, but that was for hours, not days. I feel like its not good to have a trigger node counting for 45 days.
Is there some sort of compare I can do? And if it passes the compare, it would then send my phone an alert. I can handle the alert part, I just need help with the compare part.
[{"id":"df526c3aff47686a","type":"tab","label":"Flow 1","disabled":false,"info":"","env":[]},{"id":"98701981c0ba49b4","type":"inject","z":"df526c3aff47686a","name":"Simulate button press","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":985,"y":225,"wires":[["f2597808097bf36e"]]},{"id":"ffa393f8100d7dcf","type":"debug","z":"df526c3aff47686a","name":"debug 6","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":1590,"y":330,"wires":[]},{"id":"f2597808097bf36e","type":"moment","z":"df526c3aff47686a","name":"","topic":"","input":"payload","inputType":"msg","inTz":"ETC/UTC","adjAmount":0,"adjType":"days","adjDir":"add","format":"YYYY-MM-DD HH:mm:ss","locale":"en","output":"payload","outputType":"msg","outTz":"America/Chicago","x":1220,"y":225,"wires":[["6371f7bd722fabf8"]]},{"id":"6371f7bd722fabf8","type":"api-call-service","z":"df526c3aff47686a","name":"Set input_datetime to current date & time","server":"ab3e2c53.e3491","version":5,"debugenabled":false,"domain":"input_datetime","service":"set_datetime","areaId":[],"deviceId":[],"entityId":["input_datetime.hvac_filter_last_changed"],"data":"{\"datetime\":\"{{payload}}\"}","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1540,"y":225,"wires":[[]]},{"id":"07f4164a677307ec","type":"inject","z":"df526c3aff47686a","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":960,"y":330,"wires":[["59de48367b1b0db5"]]},{"id":"59de48367b1b0db5","type":"api-current-state","z":"df526c3aff47686a","name":"","server":"ab3e2c53.e3491","version":3,"outputs":1,"halt_if":"","halt_if_type":"str","halt_if_compare":"is","entity_id":"input_datetime.hvac_filter_last_changed","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"for":"0","forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":1270,"y":330,"wires":[["ffa393f8100d7dcf"]]},{"id":"ab3e2c53.e3491","type":"server","name":"AvilaSmartHome","version":5,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"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}]