Homey Community Forum

Developer Web API Playground - Notes of geeky oneliners

For the developers and geeks that want to investigate their Homey’s config.

Run from https://developer.athom.com/tools/api-playground

I write this to remember what I did but also to inspire others that I know are better JS developer that can do more magic. (and hope they share to inspire!)

WARNING: Be Careful! you can ruïne your config by deleting the wrong objects from there! Only use it if you know what you are doing !

// Get Trigger counts for Flows
Homey.flow.getFlows().then(f => Object.values(f).reduce((r,b)=>Object.assign(r, {[b.name]:b.triggerCount}), {}));

// Get broken flows
// Run and search for the result true
Homey.flow.getFlows().then(f => Object.values(f).reduce((r,b)=>Object.assign(r, {[b.name]:b.broken}), {}));

// Get Auto Updatelist 
Homey.apps.getApps().then(f => Object.values(f).reduce((r,b)=>Object.assign(r, {[b.name]:b.autoupdate}), {}));

// Get Available Updates for Apps in AppStore
Homey.apps.getApps().then(f => Object.values(f).reduce((r,b)=>Object.assign(r, {[b.name]:b.updateAvailable}), {}));
3 Likes

Cool, thanks for sharing! For the new apps example, is it possible to exclude the ones where there are no updates? (NULL)

Think this would be possible then to set up in Homeyscript to trigger eg. every day(?).

1 Like

Thanks, very usefull!

Used this one in search for disabled flows:

Homey.flow.getFlows().then(f => Object.values(f).reduce((r,b)=>Object.assign(r, {[b.name]:b.enabled}), {}));

1 Like