So you have a state change node capturing all entities state changes and that is the trigger to your notification.
That looks bad…
I mean unless you only have one entity then that should trigger pretty much all the time.
I purpose the follwing.
In my previous picture I just had it on timestamp, because I don’t use that message, but I suppose you need to pass on the message you got.
But I would advice on a trigger state node instead since that will only capture changes on one specific entity.
The difference here is that we use the same nodes to do all the processing and then at the last step we split the data on “on” and “off”.
[{"id":"d06a390a.b924b8","type":"inject","z":"2227cef1.c55b22","name":"Manual reset trigger & block node","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":290,"y":520,"wires":[["80348ea6.8cb16"]]},{"id":"80348ea6.8cb16","type":"function","z":"2227cef1.c55b22","name":"Payload = reset","func":"msg.payload = \"reset\"\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":560,"y":600,"wires":[["d1005302.ec98f"]]},{"id":"d1005302.ec98f","type":"trigger","z":"2227cef1.c55b22","name":"","op1":"","op2":"0","op1type":"pay","op2type":"str","duration":"0","extend":false,"units":"ms","reset":"reset","bytopic":"all","topic":"topic","outputs":1,"x":460,"y":740,"wires":[["f8044561.ebdf08","1357fc50.c1c5c4"]]},{"id":"99f5c391.e8777","type":"trigger-state","z":"2227cef1.c55b22","name":"","server":"4bbca37b.1700ec","exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityid":"some_entity","entityidfiltertype":"exact","debugenabled":false,"constraints":[],"constraintsmustmatch":"all","outputs":2,"customoutputs":[],"outputinitially":false,"state_type":"str","x":210,"y":740,"wires":[["d1005302.ec98f"],["d1005302.ec98f"]]},{"id":"f8044561.ebdf08","type":"delay","z":"2227cef1.c55b22","name":"","pauseType":"delay","timeout":"10","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":340,"y":600,"wires":[["80348ea6.8cb16"]]},{"id":"617bb401.b288ac","type":"api-call-service","z":"2227cef1.c55b22","name":"Send notification, Armed","server":"4bbca37b.1700ec","version":1,"debugenabled":false,"service_domain":"","service":"","entityId":"","data":"","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":730,"y":680,"wires":[[]]},{"id":"1357fc50.c1c5c4","type":"switch","z":"2227cef1.c55b22","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"on","vt":"str"},{"t":"eq","v":"off","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":650,"y":740,"wires":[["617bb401.b288ac"],["2d4461d0.11cace"]]},{"id":"2d4461d0.11cace","type":"api-call-service","z":"2227cef1.c55b22","name":"Send notification, Disarmed","server":"4bbca37b.1700ec","version":1,"debugenabled":false,"service_domain":"","service":"","entityId":"","data":"","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":720,"y":800,"wires":[[]]},{"id":"4bbca37b.1700ec","type":"server","z":"","name":"Home Assistant","addon":true}]