How to remove non-functional devices when scanning for new

I’m trying to remove an Ikea Tradfri motion sensor and LED bulb as they are not functioning correctly (interestingly, the accompanying Tradfri power outlet worked out of the box).
After ‘…’ + ‘remove’ they are gone from the home page but reappear when I scan for new devices (needless to say, the devices are powered down so aren’t being re-identified). How can I purge them completely?

I followed a previous post using SSH to remote in and tried:-
sqlite3 ~/.mozilla-iot/config/db.sqlite3
select id from things;
but only see one device (the functioning power outlet zb-000d6ffffea5d2cf)

Gateway = RPi Zero W + Conbee 2 on powered USB hub

Those are actually being cached by the add-on, not the gateway. See here for instructions on fixing it: Problem deleting ZigBee things - cached in adapter?

Thank you for the quick reply.

I located the file but am unsure which lines of code constitute a node for deleting (newbie). Is deleting the file an option and starting afresh, or will this cause other problems?

Unfortunately it seems I can’t upload the .json file being a new user so I pasted it below:-

{
“driver”: {
“macAddress”: “00212effff0542db”,
“networkPanId16”: “e589”,
“networkAddr16”: “0000”,
“networkPanId64”: “00212effff0542db”,
“apsDesignatedCoordinator”: 1,
“scanChannels”: “00008000”,
“apsPanId64”: “0000000000000000”,
“trustCenterAddr64”: “00212effff0542db”,
“securityMode”: 3,
“networkKey”: “49e76b62d54d37e6811b63d18df3cf00”,
“operatingChannel”: 15,
“protocolVersion”: 267,
“networkUpdateId”: 0,
“permitJoin”: 0,
“watchDogTTL”: 3600,
“version”: “264a0700”
},
“nodes”: {
“000d6ffffea5d2cf”: {
“addr64”: “000d6ffffea5d2cf”,
“addr16”: “e011”,
“activeEndpoints”: {
“1”: {
“profileId”: “0104”,
“deviceId”: “010a”,
“deviceVersion”: 0,
“inputClusters”: [
“0000”,
“0003”,
“0004”,
“0005”,
“0006”,
“0008”,
“fc7c”
],
“outputClusters”: [
“0005”,
“0019”,
“0020”
],
“classifierAttributesPopulated”: true
},
“2”: {
“profileId”: “c05e”,
“deviceId”: “0010”,
“deviceVersion”: 0,
“inputClusters”: [
“1000”
],
“outputClusters”: [
“1000”
],
“classifierAttributesPopulated”: true
},
“242”: {
“profileId”: “a1e0”,
“deviceId”: “0061”,
“deviceVersion”: 0,
“inputClusters”: [
“0021”
],
“outputClusters”: [
“0021”
],
“classifierAttributesPopulated”: true
}
},
“properties”: {
“on”: {
“name”: “on”,
“value”: false,
“visible”: true,
“title”: “On/Off”,
“type”: “boolean”,
@type”: “OnOffProperty”,
“profileId”: 260,
“endpoint”: 1,
“clusterId”: 6,
“attr”: “onOff”,
“attrId”: 0,
“fireAndForget”: false,
“bindNeeded”: false,
“configReportNeeded”: false,
“initialReadNeeded”: false
}
},
“name”: “zb-000d6ffffea5d2cf-undefined”,
@type”: [
“OnOffSwitch”
],
“defaultName”: “zb-000d6ffffea5d2cf-undefined”,
“extendedTimeout”: true,
“activeEndpointsPopulated”: true,
“nodeInfoEndpointsPopulated”: true,
“modelId”: “TRADFRI control outlet”,
“powerSource”: 1,
“rxOnWhenIdle”: 1
},
“14b457fffe26538a”: {
“addr64”: “14b457fffe26538a”,
“addr16”: “0aa8”,
“activeEndpoints”: {
“1”: {
“profileId”: “0104”,
“deviceId”: “0101”,
“deviceVersion”: 1,
“inputClusters”: [
“0000”,
“0003”,
“0004”,
“0005”,
“0006”,
“0008”,
“1000”
],
“outputClusters”: [
“0005”,
“0019”,
“0020”,
“1000”
],
“classifierAttributesPopulated”: true
},
“242”: {
“profileId”: “a1e0”,
“deviceId”: “0061”,
“deviceVersion”: 0,
“inputClusters”: [
“0021”
],
“outputClusters”: [
“0021”
],
“classifierAttributesPopulated”: true
}
},
“properties”: {
“level”: {
“name”: “level”,
“visible”: true,
“title”: “Brightness”,
“type”: “number”,
@type”: “BrightnessProperty”,
“unit”: “percent”,
“minimum”: 0,
“maximum”: 100,
“profileId”: 260,
“endpoint”: 1,
“clusterId”: 8,
“attr”: “currentLevel”,
“attrId”: 0,
“fireAndForget”: false,
“bindNeeded”: true,
“configReportNeeded”: true,
“initialReadNeeded”: true
},
“on”: {
“name”: “on”,
“visible”: true,
“title”: “On/Off”,
“type”: “boolean”,
@type”: “OnOffProperty”,
“profileId”: 260,
“endpoint”: 1,
“clusterId”: 6,
“attr”: “onOff”,
“attrId”: 0,
“fireAndForget”: false,
“bindNeeded”: true,
“configReportNeeded”: true,
“initialReadNeeded”: true
}
},
“name”: “zb-14b457fffe26538a-undefined”,
@type”: [
“Light”,
“OnOffSwitch”
],
“defaultName”: “zb-14b457fffe26538a-undefined”,
“extendedTimeout”: true,
“activeEndpointsPopulated”: true,
“nodeInfoEndpointsPopulated”: true,
“modelId”: “TRADFRI bulb E26 WW 806lm”,
“powerSource”: 1
},
“ccccccfffec6c2c2”: {
“addr64”: “ccccccfffec6c2c2”,
“addr16”: “37d9”,
“activeEndpoints”: {
“1”: {
“profileId”: “0104”,
“deviceId”: “0850”,
“deviceVersion”: 1,
“inputClusters”: [
“0000”,
“0001”,
“0003”,
“0009”,
“0020”,
“1000”,
“fc7c”
],
“outputClusters”: [
“0003”,
“0004”,
“0006”,
“0008”,
“0019”,
“1000”
],
“classifierAttributesPopulated”: true
}
},
“properties”: {
“on”: {
“name”: “on”,
“value”: true,
“visible”: true,
“title”: “On/Off”,
“type”: “boolean”,
@type”: “BooleanProperty”,
“readOnly”: true,
“profileId”: 260,
“endpoint”: 1,
“clusterId”: 6,
“attr”: “”,
“fireAndForget”: true,
“bindNeeded”: true,
“configReportNeeded”: false,
“initialReadNeeded”: false
},
“level”: {
“name”: “level”,
“value”: 0,
“visible”: true,
“title”: “Level”,
“type”: “number”,
@type”: “LevelProperty”,
“unit”: “percent”,
“minimum”: 0,
“maximum”: 100,
“readOnly”: true,
“profileId”: 260,
“endpoint”: 1,
“clusterId”: 8,
“attr”: “”,
“fireAndForget”: true,
“bindNeeded”: true,
“configReportNeeded”: false,
“initialReadNeeded”: false
},
“voltage”: {
“name”: “voltage”,
“visible”: true,
“title”: “Voltage”,
“type”: “number”,
@type”: “VoltageProperty”,
“unit”: “volt”,
“readOnly”: true,
“multipleOf”: 0.1,
“profileId”: 260,
“endpoint”: 1,
“clusterId”: 1,
“attr”: “batteryVoltage”,
“attrId”: 32,
“fireAndForget”: false,
“bindNeeded”: true,
“configReportNeeded”: true,
“initialReadNeeded”: true
}
},
“name”: “zb-ccccccfffec6c2c2-button”,
“type”: “multiLevelSwitch”,
@type”: [
“OnOffSwitch”,
“MultiLevelSwitch”,
“PushButton”
],
“defaultName”: “zb-ccccccfffec6c2c2-multiLevelSwitch”,
“extendedTimeout”: true,
“activeEndpointsPopulated”: true,
“nodeInfoEndpointsPopulated”: true,
“modelId”: “TRADFRI motion sensor”,
“powerSource”: 3,
“checkinInterval”: 2400,
“longPollInterval”: 1160,
“shortPollInterval”: 4,
“fastPollTimeout”: 40,
“pollCtrlBindingNeeded”: true,
“rxOnWhenIdle”: 0
}
}

If you look at the modelId field for the different entries, it tells you which is which.

Mission accomplished. It’s an education understanding exactly which lines to delete that capture a ‘node’ but I did manage.