[APP][Pro] TP-Link Deco

Hi, I have allowed debugging this morning after crash, so I will tell you probably tomorrow. Will it show log on app settings page?

1 Like

Iā€™m using HDashboards and want to include the TP-Link Deco, but this app shows no capabilities. So there is nothing to show or do?

Here is diagnostic report bb55d4b9-7d00-4490-b350-d57acb92e758

I started a trial account, and was succeful to add Device and show properties. Please elaborate

I will check

I have checked, and for some reason, it canā€™t find the capabilities and coaches. I have to lift this with Homey to understand. I mean, it works, and then it crashes because it canā€™t find them? that is strange.

There is so much stuff about homey, that I dont understandā€¦ :smiley: My app for spot prices is completely ok on my Homey, but broken on another user homey with same SW version, same HW version, ā€¦ and same settingsā€¦ with no problem in logsā€¦ :smiley:

Feel free to review the code of the app on GitHub

And ser if you find if i have made an error

Hi Mathias,

I am not a developer, just educated power user who runs GPT/Claude to write him a code for Homey app :).
I donā€™t know if there are some limitations for strings used in capabilities, because I have like 35+ connected devices, some with long names.
Also, GPT suggests looking in those areas:

There could be various reasons for intermittent errors in the code when the application sometimes fails to work with ā€œcapabilities.ā€ Here are several key areas to check that may be causing intermittent errors when loading or working with ā€œcapabilitiesā€ in Homey:

Dynamic Adding/Removing of Capabilities Based on Role:

  • If capabilities are dynamically added or removed (e.g., based on the role of ā€œmasterā€ or ā€œslaveā€), ensure that this operation is executed correctly.
  • Check if the calls to addCapability and removeCapability return errors and that they are synchronized with the loaded values from settings.
  • The line of code that adds or removes capabilities based on the deviceā€™s role may be unreliable if settings.role is not always set when onInit is called.

Synchronization of API and Connectivity:

  • Issues can arise if API calls occur asynchronously while the device attempts to make changes to capabilities. For example, during initialization, if the API authentication hasnā€™t been completed yet, the code might throw errors when trying to access unavailable data.
  • Ensure that the variable this.connected correctly indicates the connection status and that no further actions are called until the API connection is fully initialized.

Safe API Calls (safeApiCall):

  • Your code uses the safeApiCall function to make API calls. If errors are poorly caught or if defaultValue doesnā€™t return a suitable structure, capabilities may attempt to access non-existent data.
  • Consider adding more logging in case of failures to help identify the specific location and cause of errors.

Asynchronous Data Handling in updateDeviceMetrics():

  • The updateDeviceMetrics method handles multiple API operations simultaneously, which could lead to conflicts or race conditions, especially with this.setCapabilityValue.
  • I recommend sequentially calling each update using await and handling errors properly within each part, such as using a try-catch block for each individual capability update.

Missing or Unexpected Values in Capabilities:

  • The getCapabilityValue method returns undefined if the capability is not yet available, which can cause errors if the value is not handled. Using something like typeof currentValue !== 'undefined' can help catch unexpected behaviors.

Continuous Overwriting of Capability Values:

  • If updateDeviceMetrics sets capability values too frequently or without sufficient control, it may lead to unreliable behavior.
  • I suggest adding a check for value changes before setting it, such as if (currentValue !== value), to limit unnecessary overwriting of capabilities.

Following these steps should help verify the calling of capabilities and ensure their proper functioning in Homey SDKā€™s dynamic environment.

Hi there! Iā€™m able to add a couple of P9 and they show up but then they never get any data. I couldnā€™t find any post from anyone that had those devices so I was wondering if any log would help to have them added.

Please execute the binary from my github repo go-deco/bin at main Ā· mathiastornblom/go-deco Ā· GitHub. Command line application that will throw some test to your unit and give you output that I would like to see and how we could support P9 devices.

I tried on my Mac but I got the following error:

zsh: bad CPU type in executable: ./decotest

what architecture M or Intel?

Intel

Hi there!

Thanks for making the Deco app!
I have this flow to detect to what deco my iphone is connected, to determine on which floor i am. But for some reason ā€œclient/iphone became onlineā€ triggers on all decoā€™s.

Am i using the trigger wrong?

Thanks,

Best Daniel

Just installed for my X90 and it works like a charm

HI Daniel, What do you exactly mean? Iā€™m searching for the opposite. For detecting presence I was wondering if I need to detect presence for every deco separately to find out of someone is at home or not. Your question seems to imply that connecting to one can be triggered others as well, is that correct?

Hi Kees

Thats correct take a look at this simple flow i made after my advance one was not working properly:

I have one for my living room deco as well: as you can see, both are triggered at the same time:

Ah, for me thatā€™s okay, just want to know if someone is in. I assumed that was the case since all connected devices (#number clients) are only mentioned in the master deco and not the slaves (deco;s) .

Hello, I canā€™t connect

I tested my email address and password.

Where do we find this information?

Thank you very much