This flow will output a count of messages that has not received 2 signals, or the time difference between two signal.
The time can be set in the trigger, at moment set to 5 seconds for testing
[{"id":"33b84309.734ebc","type":"inject","z":"bf9e1e33.030598","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"{\"payloadType\":\"TELEMETRY\",\"version\":1,\"timestamp\":1649416376555,\"entityType\":\"SENSOR\",\"name\":\"temp_Sensor\",\"id\":\"86b4456a-927e-4231-94a2-a9110b6da3e1\",\"model\":\"AV200\",\"serialNumber\":\"00147A107700FE73\",\"telemetry\":{\"temperature\":{\"value\":8.86,\"unit\":\"centigrade\"},\"humidity\":{\"value\":59.51,\"unit\":\"percentage\"},\"battery\":{\"value\":3,\"unit\":\"volt\"}},\"loraParameters\":{\"fPort\":6,\"rawPayload\":\"00147A777710FE73000000\",\"rssi\":{\"value\":-95,\"unit\":\"dBm\"},\"snr\":{\"value\":12,\"unit\":\"dB\"},\"fCnt\":100},\"asset\":{}}","payloadType":"json","x":110,"y":280,"wires":[["40b22621.120db"]]},{"id":"40b22621.120db","type":"change","z":"bf9e1e33.030598","name":"simulate incoming msg","rules":[],"action":"","property":"","from":"","to":"","reg":false,"x":310,"y":280,"wires":[["cf041f61.2f768"]]},{"id":"cf041f61.2f768","type":"change","z":"bf9e1e33.030598","name":"","rules":[{"t":"set","p":"topic","pt":"msg","to":"payload.id","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":330,"y":340,"wires":[["11b19158.6b52ef","e63fc3d0.c1c64"]]},{"id":"11b19158.6b52ef","type":"change","z":"bf9e1e33.030598","name":"","rules":[{"t":"set","p":"sensor_count[msg.topic]","pt":"flow","to":"$append(\t $exists($flowContext('sensor_count[\"' & $$.topic & '\"]')) ?\t $flowContext('sensor_count[\"' & $$.topic & '\"]') :\t [],\t \t $millis()\t)","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":630,"y":340,"wires":[["7f9c978c.052cd"]]},{"id":"e63fc3d0.c1c64","type":"trigger","z":"bf9e1e33.030598","name":"","op1":"","op2":"","op1type":"nul","op2type":"payl","duration":"5","extend":false,"overrideDelay":false,"units":"s","reset":"","bytopic":"topic","topic":"topic","outputs":1,"x":330,"y":400,"wires":[["3d6c4e60.401112"]]},{"id":"7f9c978c.052cd","type":"switch","z":"bf9e1e33.030598","name":"","property":"$count($flowContext('sensor_count[\"' & $$.topic & '\"]'))","propertyType":"jsonata","rules":[{"t":"eq","v":"2","vt":"num"}],"checkall":"true","repair":false,"outputs":1,"x":910,"y":340,"wires":[["93d00904.0c735"]]},{"id":"3d6c4e60.401112","type":"change","z":"bf9e1e33.030598","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"sensor_count[msg.topic]","tot":"flow"}],"action":"","property":"","from":"","to":"","reg":false,"x":520,"y":400,"wires":[["47d9fc1.6fc7204"]]},{"id":"93d00904.0c735","type":"change","z":"bf9e1e33.030598","name":"set reset","rules":[{"t":"set","p":"reset","pt":"msg","to":"true","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":1080,"y":340,"wires":[["e63fc3d0.c1c64","9a915b56.f2c9c8"]]},{"id":"47d9fc1.6fc7204","type":"switch","z":"bf9e1e33.030598","name":"","property":"$count(msg.payload) ","propertyType":"jsonata","rules":[{"t":"eq","v":"1","vt":"num"}],"checkall":"true","repair":false,"outputs":1,"x":700,"y":400,"wires":[["9d5aff10.3606a"]]},{"id":"9a915b56.f2c9c8","type":"change","z":"bf9e1e33.030598","name":"2 messgaes received","rules":[{"t":"set","p":"payload","pt":"msg","to":"sensor_count[msg.topic]","tot":"flow"},{"t":"set","p":"payload","pt":"msg","to":"($$.payload[1] - $$.payload[0]) / 1000","tot":"jsonata"},{"t":"delete","p":"sensor_count[msg.topic]","pt":"flow"}],"action":"","property":"","from":"","to":"","reg":false,"x":1320,"y":340,"wires":[["b1c6df8.dd1112"]]},{"id":"9d5aff10.3606a","type":"change","z":"bf9e1e33.030598","name":"1 message received","rules":[{"t":"set","p":"sensor_count.signal_missed","pt":"flow","to":"($exists($flowContext(\"sensor_count.signal_missed\")) ?\t $flowContext(\"sensor_count.signal_missed\") :\t 0) + 1","tot":"jsonata"},{"t":"set","p":"payload","pt":"msg","to":"sensor_count.signal_missed","tot":"flow"},{"t":"delete","p":"sensor_count[msg.topic]","pt":"flow"}],"action":"","property":"","from":"","to":"","reg":false,"x":910,"y":400,"wires":[["27d744d5.78b004"]]},{"id":"b1c6df8.dd1112","type":"debug","z":"bf9e1e33.030598","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":1550,"y":340,"wires":[]},{"id":"27d744d5.78b004","type":"debug","z":"bf9e1e33.030598","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":1150,"y":400,"wires":[]},{"id":"46b445c4.48d02c","type":"inject","z":"bf9e1e33.030598","name":"reset count","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":200,"y":480,"wires":[["9954ba69.3aae68"]]},{"id":"9954ba69.3aae68","type":"change","z":"bf9e1e33.030598","name":"","rules":[{"t":"set","p":"sensor_count.signal_missed","pt":"flow","to":"0","tot":"num"}],"action":"","property":"","from":"","to":"","reg":false,"x":470,"y":480,"wires":[[]]}]
The flow also clears up the context store after trigger time.
[edit] changed so output for two messages is immediate.