I have no idea what he’s doing and he said he was new. If he’s using yaml, he needs to restart. If he’s using the UI, he may need to restart. I don’t use the UI so I’m not able to answer that question. When in doubt, give an answer that will always work regardless of UI or Yaml 
got it, I am sticking UI and adding entities through integrations or helpers are visible into Alexa after discovery. If you are sticking with YAML, you have to restart it, right.
Thanks both, well I restarted and still not showing 
Script is there and working, even added to a dashboard as a button and it’s working, but not showing in Alexa at all
Scripts may be only usable in the routines section. Try simply saying to her "Execute <script name>" or "Run <script name>"
Finally got it - I’m unsure if scripts are excluded by default, but it was not grabbing it until I explicitly called out the script in the Alexa YAML
Then it discovered it as a scene 
Thanks for your help!
I’m running into the same issue. I’ve tried the specific domains or entities which I want to exclude and for testing just resorted to trying o filter out all lights and switches. Optimally I would like to go with the include filter to only include devices which I add but nothing seems to get filtered. They’re all still working from Alexa and come right back after removing/discovery.
I’ve also been trying to use the Lambda Discovery test script in AWS from the YouTube video referenced in the first post to rule out any potential Alexa issue. Each time the script runs all my devices get pulled into the result.
Any guidance would be appreciated.
This is what I’m using in my configuration.yaml and have been restarting HA each time.
alexa:
smart_home:
filter:
exclude_domains:
- light
- switch
exclude_entities:
- switch.*
- light.*
Edit1:
Issue was the formatting, I have it working now with the following as a test config. The Lambda Discovery test is a quick way of testing the filters before spending time in Alexa to Delete & Discover.
alexa:
smart_home:
filter:
include_domains:
- light
- switch
@alixyz . This is what I am using in my config right now. Just keep in mind, you need to delete all entities you dont want from alexa app or through the web site:
alexa:
smart_home:
endpoint: https://api.amazonalexa.com/v3/events
filter:
include_entities:
- switch.closet
- switch.garage
- switch.kids_bathroom
- switch.kids_lamp
- switch.unifyplug_switch
- switch.zooz_zen15_power_cord_freezer
- input_button.ztest_button_1
- binary_sensor.garagedoor_sensor_iaszone
include_domains:
- climate
- light
- scene
- script
- input_button
- fan
- lock
exclude_entity_globs:
- light.browser_mod_*
exclude_entities:
- light.yard_group
- light.garage
exclude_domains:
- automation
- binary_sensor
- camera
- device_tracker
- media_player
- remote
- sensor
- input_boolean
- input_datetime
- input_number
- input_select
- input_text
- weather
Thanks for the example with the various options.
You are welcome!
In your example, you include entity binary_sensor.garagedoor_sensor_iaszone but afterwards you exclude domain binary_sensor : isn’t this domain exclusion making the prior entity inclusion useless ? (because overridden)
Or is it just for the sake of the example with no real “logic” between lines ?
I think the indentation is still no good and should be :
alexa:
smart_home:
filter:
include_domains:
- light
- switch
(please note the 2 last lines)
Maybe you can try to exclude all switch entities except (include_entities) switch.tasmota_20, etc…
exclude_entities:
- switch.*
include_entities:
- switch.tasmota_20
...
or
exclude_domains:
- switch
include_entities:
- switch.tasmota_20
...
I’m not sure in what order those filters are read/applied (even after reading the documentation)
Note : you might have to delete already imported devices in the Alexa app
The config was totally fine but I guess I could use that code as well. It had something to do with ARN location. As soon as I changed it from NA West 1 (N. California) to NA East 1 (Virginia), it immediately started working.
Thanks.
Filters are applied as follows:
- No filter
- All entities included
- Only includes
- Entity listed in entities include: include
- Otherwise, entity matches domain include: include
- Otherwise, entity matches glob include: include
- Otherwise: exclude
- Only excludes
- Entity listed in exclude: exclude
- Otherwise, entity matches domain exclude: exclude
- Otherwise, entity matches glob exclude: exclude
- Otherwise: include
- Domain and/or glob includes (may also have excludes)
- Entity listed in entities include: include
- Otherwise, entity listed in entities exclude: exclude
- Otherwise, entity matches glob include: include
- Otherwise, entity matches glob exclude: exclude
- Otherwise, entity matches domain include: include
- Otherwise: exclude
Hi,
Just in case that like me you got thousands of devices and scenes generated by Alexa and you dont want take hours to clean all that ******** ![]()
A web browser + a devTools console + simple javascript script + less than 5 minutes ...
Have Fun !!!
DEVICES :
//
//
// BATCH SCRIPT TO CLEAN ALEXA DEVICES BY MANUFACTURER and UNREACHABLE STATE
//
//
// 0. Thanks
/*
based on git hub : https://github.com/Shereef/Python-Delete-Alexa-Devices/issues/9
tks to rPraml - Roland Praml and challs - Chris Halls and off course all other contributors
*/
// 0.process
/*
- (OPTIONNAL) In my case i disconnect my Home assistant skill from Alexa before this batch to avoid conflict
- open a web browser
- log to amazon account ( account lin k to alexa...)
- try the following URLs to get the one who give you a list of devices :
https://alexa.amazon.de/api/behaviors/entities?skillId=amzn1.ask.1p.smarthome
https://alexa.amazon.com/api/behaviors/entities?skillId=amzn1.ask.1p.smarthome
https://layla.amazon.com/api/behaviors/entities?skillId=amzn1.ask.1p.smarthome
https://pitangui.amazon.com/api/behaviors/entities?skillId=amzn1.ask.1p.smarthome
https://alexa.amazon.co.jp/api/behaviors/entities?skillId=amzn1.ask.1p.smarthome
- stay on the page that give you Result
- start dev tools console
- change the manufactureur bellow (MANUFACTURER_FILTER = ...)
- copy, paste and execute the whole script in the console
- if the result look's like what you are looking for , copy/paste the commented delete loop to the console without comments
- have fun
*/
// 1. Filter configuration
const MANUFACTURER_FILTER = "Home Assistant"; // à adapter
// 2. data extraction
devices = await (await fetch('/nexus/v1/graphql', {
method: 'POST',
headers: {
"Content-Type": "application/json",
"Accept": "application/json"
},
body: JSON.stringify({
query: `{
endpoints {
items {
friendlyName
legacyAppliance {
applianceId
manufacturerName
connectedVia
}
features {
name
properties {
... on Reachability { reachabilityStatusValue }
}
}
}
}
}`
})
})).json();
// 3. Filtering : manufacturerName + UNREACHABLE
toProcess = devices.data.endpoints.items
.filter(device => {
const matchesManu = device.legacyAppliance?.manufacturerName === MANUFACTURER_FILTER;
const reachability = device.features
.flatMap(f => f.properties)
.find(p => p?.reachabilityStatusValue !== undefined);
const isUnreachable = reachability?.reachabilityStatusValue === "UNREACHABLE";
return matchesManu && isUnreachable;
})
.sort((a, b) => a.friendlyName.localeCompare(b.friendlyName))
.map(device => ({
friendlyName: device.friendlyName,
applianceId: device.legacyAppliance.applianceId,
manufacturerName: device.legacyAppliance.manufacturerName,
reachabilityStatus: device.features
.flatMap(f => f.properties)
.find(p => p?.reachabilityStatusValue !== undefined)
?.reachabilityStatusValue ?? "unknown"
}));
// 4. Result details
console.log(`Found ${toProcess.length} device(s) to process out of ${devices.data.endpoints.items.length} total.`);
toProcess.forEach(d => console.log(` - ${d.friendlyName}`));
console.log("toProcess:", toProcess);
// 5. Deletion batch (commented to avoid delete process before a verification of the scan :) )
/*
for (const device of toProcess) {
console.log("Deleting:", device.friendlyName, `(reachability: ${device.reachabilityStatus})`, device.applianceId);
let result = await fetch(`/api/phoenix/appliance/${encodeURIComponent(device.applianceId)}`, {
method: "DELETE",
headers: {
"Accept": "application/json",
"Content-Type": "application/json"
}
});
console.log("Result:", result.status, result.statusText);
}
*/
SCENES:
//
//
// BATCH SCRIPT TO CLEAN ALEXA SCENE BY MANUFACTURER
// (Alexa scene can include more than scene ... as example, Home Assistant script, scene, automations are identify as scene by Alexa)
//
//
// 0. Thanks
/*
based on git hub : https://github.com/Shereef/Python-Delete-Alexa-Devices/issues/9
tks to rPraml - Roland Praml and challs - Chris Halls and off course all other contributors
*/
// 0.process
/*
- (OPTIONNAL) In my case i disconnect my Home assistant skill from Alexa before this batch to avoid conflict
- open a web browser
- log to amazon account ( account lin k to alexa...)
- try the following URLs to get the one who give you a list of devices :
https://alexa.amazon.de/api/behaviors/entities?skillId=amzn1.ask.1p.smarthome
https://alexa.amazon.com/api/behaviors/entities?skillId=amzn1.ask.1p.smarthome
https://layla.amazon.com/api/behaviors/entities?skillId=amzn1.ask.1p.smarthome
https://pitangui.amazon.com/api/behaviors/entities?skillId=amzn1.ask.1p.smarthome
https://alexa.amazon.co.jp/api/behaviors/entities?skillId=amzn1.ask.1p.smarthome
- stay on the page that give you Result
- start dev tools console
- change the manufactureur bellow (MANUFACTURER_FILTER = ...)
- copy, paste and execute the whole script in the console
- if the result look's like what you are looking for , copy/paste the commented delete loop to the console without comments
- have fun
*/
// 1. Filter configuration
const MANUFACTURER_FILTER = "Home Assistant";
// 2. Data extraction
devices = await (await fetch('/nexus/v1/graphql', {
method: 'POST',
headers: {
"Content-Type": "application/json",
"Accept": "application/json"
},
body: JSON.stringify({
query: `{
endpoints {
items {
friendlyName
legacyAppliance {
applianceId
manufacturerName
applianceTypes
connectedVia
}
features {
name
properties {
... on Reachability { reachabilityStatusValue }
}
}
}
}
}`
})
})).json();
// 3. Filtering : manufacturerName + SCENE_TRIGGER ou ACTIVITY_TRIGGER
scenesToProcess = devices.data.endpoints.items
.filter(device => {
const matchesManu = device.legacyAppliance?.manufacturerName === MANUFACTURER_FILTER;
const matchesType = device.legacyAppliance?.applianceTypes?.some(t =>
t === "SCENE_TRIGGER" || t === "ACTIVITY_TRIGGER"
);
return matchesManu && matchesType;
})
.sort((a, b) => a.friendlyName.localeCompare(b.friendlyName))
.map(device => ({
friendlyName: device.friendlyName,
applianceId: device.legacyAppliance.applianceId,
type: device.legacyAppliance.applianceTypes[0],
manufacturerName: device.legacyAppliance.manufacturerName
}));
// 4. Result preview — To validate filtering before delete process
console.log(`Found ${scenesToProcess.length} scene(s)/script(s) to process out of ${devices.data.endpoints.items.length} total.`);
scenesToProcess.forEach(d => console.log(` - [${d.type}] ${d.friendlyName}`));
console.log("scenesToProcess:", scenesToProcess);
// 5. Deletion batch — (commented to avoid delete process before a verification of the scan :) )
/*
for (const scene of scenesToProcess) {
console.log("Deleting:", scene.friendlyName, `(${scene.type})`, scene.applianceId);
let result = await fetch(`/api/phoenix/appliance/${encodeURIComponent(scene.applianceId)}`, {
method: "DELETE",
headers: {
"Accept": "application/json",
"Content-Type": "application/json"
}
});
console.log("Result:", result.status, result.statusText);
}
*/
I hope it's can help someone like it's help me ![]()