Hi, I have allowed debugging this morning after crash, so I will tell you probably tomorrow. Will it show log on app settings page?
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ā¦ 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ā¦
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
andremoveCapability
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 whenonInit
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 ifdefaultValue
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 withthis.setCapabilityValue
. - I recommend sequentially calling each update using
await
and handling errors properly within each part, such as using atry-catch
block for each individual capability update.
Missing or Unexpected Values in Capabilities:
- The
getCapabilityValue
method returnsundefined
if the capability is not yet available, which can cause errors if the value is not handled. Using something liketypeof 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) .