Hi Node RED newbie here.
I am trying to create a flow that will send me a notification based on the current state of my solar generation - see image below.
I have grouped the state change into 6 broader categories on the right using a switch node. This flow works fine, the only issue is that it triggers with every single state change, which triggers every couple of seconds, sending a new notification.
I would like a notification to only be sent if there is a change from one of the 6 broader categories to another.
My idea is to have the call service / notifcation linked to a change in state node that reads from a custom state change, but would appreciate some guidance in understand if it’s possible, how to get it set-up, or if there is an easier alternative solution.
Apologies if I haven’t explained that very well, but I’ve also attached the JSON below and am happy to clarify any confusing points.
[{“id”:“acce53c80779becd”,“type”:“api-call-service”,“z”:“e5b7524716e32d69”,“name”:“Energy Level 1”,“server”:“790d432d.fb71ac”,“version”:5,“debugenabled”:false,“domain”:“notify”,“service”:“mobile_app_fone”,“areaId”:,“deviceId”:,“entityId”:,“data”:“{\t "title": "Energy Level",\t "message": "",\t "data": {\t "notification_icon": "mdi:numeric-1-box",\t "tag": "energy",\t "channel": "energy" \t } \t}”,“dataType”:“jsonata”,“mergeContext”:“”,“mustacheAltTags”:false,“outputProperties”:,“queue”:“none”,“x”:700,“y”:350,“wires”:[]},{“id”:“6a2c70d3e54c30e1”,“type”:“api-call-service”,“z”:“e5b7524716e32d69”,“name”:“Energy Off”,“server”:“790d432d.fb71ac”,“version”:5,“debugenabled”:false,“domain”:“notify”,“service”:“mobile_app_fone”,“areaId”:,“deviceId”:,“entityId”:,“data”:“{\t "title": "Energy Off",\t "message": "",\t "data": {\t "notification_icon": "mdi:weather-sunny-off",\t "tag": "energy",\t "channel": "energy" \t } \t}”,“dataType”:“jsonata”,“mergeContext”:“”,“mustacheAltTags”:false,“outputProperties”:,“queue”:“none”,“x”:690,“y”:270,“wires”:[]},{“id”:“24c1efddae3c96c9”,“type”:“switch”,“z”:“e5b7524716e32d69”,“name”:“”,“property”:“payload”,“propertyType”:“msg”,“rules”:[{“t”:“lt”,“v”:“1000”,“vt”:“str”},{“t”:“btwn”,“v”:“1001”,“vt”:“num”,“v2”:“1999”,“v2t”:“num”},{“t”:“btwn”,“v”:“2000”,“vt”:“num”,“v2”:“2999”,“v2t”:“num”},{“t”:“btwn”,“v”:“3000”,“vt”:“num”,“v2”:“3999”,“v2t”:“num”},{“t”:“btwn”,“v”:“4000”,“vt”:“num”,“v2”:“4799”,“v2t”:“num”},{“t”:“gte”,“v”:“4800”,“vt”:“str”}],“checkall”:“true”,“repair”:false,“outputs”:6,“x”:430,“y”:520,“wires”:[[“6a2c70d3e54c30e1”],[“acce53c80779becd”],[“6958df5ecb8ad3c9”],[“f9684d8a09c59f0e”],[“c7e8ae5832f6f86c”],[“ae27565b7bf88d8c”]]},{“id”:“15ca9067a03f40bc”,“type”:“server-state-changed”,“z”:“e5b7524716e32d69”,“name”:“”,“server”:“790d432d.fb71ac”,“version”:4,“exposeToHomeAssistant”:false,“haConfig”:[{“property”:“name”,“value”:“”},{“property”:“icon”,“value”:“”}],“entityidfilter”:“sensor.pv_power”,“entityidfiltertype”:“exact”,“outputinitially”:false,“state_type”:“str”,“haltifstate”:“”,“halt_if_type”:“num”,“halt_if_compare”:“gt”,“outputs”:1,“output_only_on_state_change”:true,“for”:“15”,“forType”:“num”,“forUnits”:“minutes”,“ignorePrevStateNull”:false,“ignorePrevStateUnknown”:false,“ignorePrevStateUnavailable”:false,“ignoreCurrentStateUnknown”:false,“ignoreCurrentStateUnavailable”:false,“outputProperties”:[{“property”:“payload”,“propertyType”:“msg”,“value”:“”,“valueType”:“entityState”},{“property”:“data”,“propertyType”:“msg”,“value”:“”,“valueType”:“eventData”},{“property”:“topic”,“propertyType”:“msg”,“value”:“”,“valueType”:“triggerId”}],“x”:190,“y”:520,“wires”:[[“24c1efddae3c96c9”]]},{“id”:“6958df5ecb8ad3c9”,“type”:“api-call-service”,“z”:“e5b7524716e32d69”,“name”:“Energy Level 2”,“server”:“790d432d.fb71ac”,“version”:5,“debugenabled”:false,“domain”:“notify”,“service”:“mobile_app_fone”,“areaId”:,“deviceId”:,“entityId”:,“data”:“{\t "title": "Energy Level",\t "message": "",\t "data": {\t "notification_icon": "mdi:numeric-2-box",\t "tag": "energy",\t "channel": "energy" \t } \t}”,“dataType”:“jsonata”,“mergeContext”:“”,“mustacheAltTags”:false,“outputProperties”:,“queue”:“none”,“x”:700,“y”:450,“wires”:[]},{“id”:“f9684d8a09c59f0e”,“type”:“api-call-service”,“z”:“e5b7524716e32d69”,“name”:“Energy Level 3”,“server”:“790d432d.fb71ac”,“version”:5,“debugenabled”:false,“domain”:“notify”,“service”:“mobile_app_fone”,“areaId”:,“deviceId”:,“entityId”:,“data”:“{\t "title": "Energy Level",\t "message": "",\t "data": {\t "notification_icon": "mdi:numeric-3-box",\t "tag": "energy",\t "channel": "energy" \t } \t}”,“dataType”:“jsonata”,“mergeContext”:“”,“mustacheAltTags”:false,“outputProperties”:,“queue”:“none”,“x”:700,“y”:530,“wires”:[]},{“id”:“c7e8ae5832f6f86c”,“type”:“api-call-service”,“z”:“e5b7524716e32d69”,“name”:“Energy Level 4”,“server”:“790d432d.fb71ac”,“version”:5,“debugenabled”:false,“domain”:“notify”,“service”:“mobile_app_fone”,“areaId”:,“deviceId”:,“entityId”:,“data”:“{\t "title": "Energy Level",\t "message": "",\t "data": {\t "notification_icon": "mdi:numeric-4-box",\t "tag": "energy",\t "channel": "energy" \t } \t}”,“dataType”:“jsonata”,“mergeContext”:“”,“mustacheAltTags”:false,“outputProperties”:,“queue”:“none”,“x”:700,“y”:630,“wires”:[]},{“id”:“ae27565b7bf88d8c”,“type”:“api-call-service”,“z”:“e5b7524716e32d69”,“name”:“Energy Level 5”,“server”:“790d432d.fb71ac”,“version”:5,“debugenabled”:false,“domain”:“notify”,“service”:“mobile_app_fone”,“areaId”:,“deviceId”:,“entityId”:,“data”:“{\t "title": "Energy Level",\t "message": "",\t "data": {\t "notification_icon": "mdi:numeric-5-box",\t "tag": "energy",\t "channel": "energy" \t } \t}”,“dataType”:“jsonata”,“mergeContext”:“”,“mustacheAltTags”:false,“outputProperties”:,“queue”:“none”,“x”:700,“y”:730,“wires”:[]},{“id”:“790d432d.fb71ac”,“type”:“server”,“name”:“Home Assistant”,“addon”:true}]