What you can do in that case is spook provides a sensor.entities
With that you can monitor if an entity goes missing. To get what is missing you would first need to have a stored array of entities.
Use this flow once to create the flow store. You should have storing context to file enabled to protect against data loss during updates/restarts/reinstall.
[{"id":"3c2a41f167326d70","type":"ha-get-entities","z":"0a325c35fc29f44e","name":"","server":"6b1110b5.183a4","version":1,"rules":[{"property":"state","logic":"is","value":".*","valueType":"re"}],"outputType":"array","outputEmptyResults":false,"outputLocationType":"flow","outputLocation":"allEntities","outputResultsCount":1,"x":430,"y":300,"wires":[["69ae8a458e09dfb2"]]},{"id":"abddc0e1ef6c4fe5","type":"inject","z":"0a325c35fc29f44e","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":200,"y":300,"wires":[["3c2a41f167326d70"]]},{"id":"6b1110b5.183a4","type":"server","name":"Home Assistant","version":5,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":false,"heartbeat":false,"heartbeatInterval":"30","areaSelector":"friendlyName","deviceSelector":"friendlyName","entitySelector":"id","statusSeparator":"at: ","statusYear":"hidden","statusMonth":"short","statusDay":"numeric","statusHourCycle":"h23","statusTimeFormat":"h:m","enableGlobalContextStore":true}]
This will trigger when sensor.entities
drops and will return the missing entity.
[{"id":"69ae8a458e09dfb2","type":"debug","z":"0a325c35fc29f44e","name":"debug 203","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":890,"y":380,"wires":[]},{"id":"45c602ac6c7934fd","type":"ha-get-entities","z":"0a325c35fc29f44e","name":"","server":"6b1110b5.183a4","version":1,"rules":[{"property":"state","logic":"is","value":".*","valueType":"re"}],"outputType":"array","outputEmptyResults":false,"outputLocationType":"msg","outputLocation":"payload","outputResultsCount":1,"x":430,"y":380,"wires":[["406da598d134693a"]]},{"id":"cee949d4a515fe6c","type":"trigger-state","z":"0a325c35fc29f44e","name":"","server":"6b1110b5.183a4","version":4,"inputs":0,"outputs":2,"exposeAsEntityConfig":"","entityId":"sensor.entities","entityIdType":"exact","debugEnabled":false,"constraints":[{"targetType":"this_entity","targetValue":"","propertyType":"current_state","propertyValue":"new_state.state","comparatorType":"<","comparatorValueDatatype":"prevEntity","comparatorValue":"state"}],"customOutputs":[],"outputInitially":false,"stateType":"str","enableInput":false,"x":140,"y":380,"wires":[["45c602ac6c7934fd"],[]]},{"id":"406da598d134693a","type":"function","z":"0a325c35fc29f44e","name":"function 25","func":"let arr1 = msg.payload;\nlet arr2 = flow.get(\"allEntities\");\nconst difference = arr2.filter(({ entity_id: id1 }) => !arr1.some(({ entity_id: id2 }) => id2 === id1));\nflow.set(\"allEntities\", arr1);\n\nmsg = {};\nmsg.payload = difference;\nreturn msg;","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":630,"y":380,"wires":[["69ae8a458e09dfb2"]]},{"id":"6b1110b5.183a4","type":"server","name":"Home Assistant","version":5,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":false,"heartbeat":false,"heartbeatInterval":"30","areaSelector":"friendlyName","deviceSelector":"friendlyName","entitySelector":"id","statusSeparator":"at: ","statusYear":"hidden","statusMonth":"short","statusDay":"numeric","statusHourCycle":"h23","statusTimeFormat":"h:m","enableGlobalContextStore":true}]
Finally if the entities sensor increases, store new array.
[{"id":"9e18b8390a1c2110","type":"trigger-state","z":"0a325c35fc29f44e","name":"","server":"6b1110b5.183a4","version":4,"inputs":0,"outputs":2,"exposeAsEntityConfig":"","entityId":"sensor.entities","entityIdType":"exact","debugEnabled":false,"constraints":[{"targetType":"this_entity","targetValue":"","propertyType":"current_state","propertyValue":"new_state.state","comparatorType":">","comparatorValueDatatype":"prevEntity","comparatorValue":"state"}],"customOutputs":[],"outputInitially":false,"stateType":"str","enableInput":false,"x":140,"y":480,"wires":[["7bdd22807d2d8dae"],[]]},{"id":"7bdd22807d2d8dae","type":"ha-get-entities","z":"0a325c35fc29f44e","name":"","server":"6b1110b5.183a4","version":1,"rules":[{"property":"state","logic":"is","value":".*","valueType":"re"}],"outputType":"array","outputEmptyResults":false,"outputLocationType":"flow","outputLocation":"allEntities","outputResultsCount":1,"x":430,"y":480,"wires":[[]]},{"id":"6b1110b5.183a4","type":"server","name":"Home Assistant","version":5,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":false,"heartbeat":false,"heartbeatInterval":"30","areaSelector":"friendlyName","deviceSelector":"friendlyName","entitySelector":"id","statusSeparator":"at: ","statusYear":"hidden","statusMonth":"short","statusDay":"numeric","statusHourCycle":"h23","statusTimeFormat":"h:m","enableGlobalContextStore":true}]