# \[APP\]\[Pro\] TP-Link Deco

**URL:** <https://community.homey.app/t/app-pro-tp-link-deco/115521>\
**Category:** Apps\
**Tags:** app, homey-pro\
**Created:** [September 4, 2024, 9:31pm UTC](https://community.homey.app/t/app-pro-tp-link-deco/115521 "2024-09-04T21:31:36Z")\
**Posts on this page:** 20\
**Page:** 8

<div class="post-metadata">

**Author:** ![Jiri\_Pech](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/jiri_pech/32/48190_2.png) [@Jiri\_Pech](https://community.homey.app/u/Jiri_Pech)\
**Post date:** [November 4, 2024, 10:36am UTC](https://community.homey.app/t/app-pro-tp-link-deco/115521/142 "2024-11-04T10:36:45Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Piet\_Bax](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/piet_bax/32/41150_2.png) [@Piet\_Bax](https://community.homey.app/u/Piet_Bax)\
**Post date:** [November 7, 2024, 7:11am UTC](https://community.homey.app/t/app-pro-tp-link-deco/115521/143 "2024-11-07T07:11:19Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![Jiri\_Pech](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/jiri_pech/32/48190_2.png) [@Jiri\_Pech](https://community.homey.app/u/Jiri_Pech)\
**Post date:** [November 7, 2024, 7:32pm UTC](https://community.homey.app/t/app-pro-tp-link-deco/115521/144 "2024-11-07T19:32:35Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![MathiasT](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/mathiast/32/84876_2.png) [@MathiasT](https://community.homey.app/u/MathiasT)\
**Post date:** [November 7, 2024, 9:13pm UTC](https://community.homey.app/t/app-pro-tp-link-deco/115521/145 "2024-11-07T21:13:09Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![MathiasT](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/mathiast/32/84876_2.png) [@MathiasT](https://community.homey.app/u/MathiasT)\
**Post date:** [November 7, 2024, 9:13pm UTC](https://community.homey.app/t/app-pro-tp-link-deco/115521/146 "2024-11-07T21:13:17Z")

</div>

I will check

---

<div class="post-metadata">

**Author:** ![MathiasT](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/mathiast/32/84876_2.png) [@MathiasT](https://community.homey.app/u/MathiasT)\
**Post date:** [November 7, 2024, 9:18pm UTC](https://community.homey.app/t/app-pro-tp-link-deco/115521/147 "2024-11-07T21:18:14Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Jiri\_Pech](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/jiri_pech/32/48190_2.png) [@Jiri\_Pech](https://community.homey.app/u/Jiri_Pech)\
**Post date:** [November 8, 2024, 6:08am UTC](https://community.homey.app/t/app-pro-tp-link-deco/115521/148 "2024-11-08T06:08:34Z")

</div>

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… 😃

---

<div class="post-metadata">

**Author:** ![MathiasT](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/mathiast/32/84876_2.png) [@MathiasT](https://community.homey.app/u/MathiasT)\
**Post date:** [November 8, 2024, 6:46am UTC](https://community.homey.app/t/app-pro-tp-link-deco/115521/149 "2024-11-08T06:46:55Z")

</div>

Feel free to review the code of the app on GitHub

> **[GitHub - mathiastornblom/net.tornbloms.deco](https://github.com/mathiastornblom/net.tornbloms.deco)**
>
> Contribute to mathiastornblom/net.tornbloms.deco development by creating an account on GitHub.

And ser if you find if i have made an error

---

<div class="post-metadata">

**Author:** ![Jiri\_Pech](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/jiri_pech/32/48190_2.png) [@Jiri\_Pech](https://community.homey.app/u/Jiri_Pech)\
**Post date:** [November 11, 2024, 8:52am UTC](https://community.homey.app/t/app-pro-tp-link-deco/115521/150 "2024-11-11T08:52:25Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Robotto](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/robotto/32/78909_2.png) [@Robotto](https://community.homey.app/u/Robotto)\
**Post date:** [November 17, 2024, 4:58pm UTC](https://community.homey.app/t/app-pro-tp-link-deco/115521/151 "2024-11-17T16:58:24Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![MathiasT](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/mathiast/32/84876_2.png) [@MathiasT](https://community.homey.app/u/MathiasT)\
**Post date:** [November 19, 2024, 9:26am UTC](https://community.homey.app/t/app-pro-tp-link-deco/115521/152 "2024-11-19T09:26:14Z")

</div>

Please execute the binary from my github repo [go-deco/bin at main · mathiastornblom/go-deco · GitHub](https://github.com/mathiastornblom/go-deco/tree/main/bin). 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.

---

<div class="post-metadata">

**Author:** ![Robotto](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/robotto/32/78909_2.png) [@Robotto](https://community.homey.app/u/Robotto)\
**Post date:** [November 19, 2024, 9:49am UTC](https://community.homey.app/t/app-pro-tp-link-deco/115521/153 "2024-11-19T09:49:05Z")

</div>

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

zsh: bad CPU type in executable: ./decotest

---

<div class="post-metadata">

**Author:** ![MathiasT](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/mathiast/32/84876_2.png) [@MathiasT](https://community.homey.app/u/MathiasT)\
**Post date:** [November 19, 2024, 10:04am UTC](https://community.homey.app/t/app-pro-tp-link-deco/115521/154 "2024-11-19T10:04:13Z")

</div>

what architecture M or Intel?

---

<div class="post-metadata">

**Author:** ![Robotto](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/robotto/32/78909_2.png) [@Robotto](https://community.homey.app/u/Robotto)\
**Post date:** [November 19, 2024, 10:18am UTC](https://community.homey.app/t/app-pro-tp-link-deco/115521/155 "2024-11-19T10:18:15Z")

</div>

Intel

---

<div class="post-metadata">

**Author:** ![DanielvanBreda](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/danielvanbreda/32/79186_2.png) [@DanielvanBreda](https://community.homey.app/u/DanielvanBreda)\
**Post date:** [November 21, 2024, 9:49pm UTC](https://community.homey.app/t/app-pro-tp-link-deco/115521/156 "2024-11-21T21:49:04Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Gerben\_Plantinga](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/gerben_plantinga/32/63606_2.png) [@Gerben\_Plantinga](https://community.homey.app/u/Gerben_Plantinga)\
**Post date:** [November 22, 2024, 9:51am UTC](https://community.homey.app/t/app-pro-tp-link-deco/115521/157 "2024-11-22T09:51:04Z")

</div>

Just installed for my X90 and it works like a charm

---

<div class="post-metadata">

**Author:** ![Kees\_Smaling](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/kees_smaling/32/80323_2.png) [@Kees\_Smaling](https://community.homey.app/u/Kees_Smaling)\
**Post date:** [November 22, 2024, 12:38pm UTC](https://community.homey.app/t/app-pro-tp-link-deco/115521/158 "2024-11-22T12:38:22Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![DanielvanBreda](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/danielvanbreda/32/79186_2.png) [@DanielvanBreda](https://community.homey.app/u/DanielvanBreda)\
**Post date:** [November 22, 2024, 1:04pm UTC](https://community.homey.app/t/app-pro-tp-link-deco/115521/159 "2024-11-22T13:04:56Z")

</div>

Hi Kees

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

 ![IMG_6473](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/e/f/ef38b2cc4cfb852f81260dbe2c1865c01037df15.png)

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

 ![IMG_6474](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/e/0/e072dbfa10ea98c3a15950a676befcd9b94ea157.jpeg)

---

<div class="post-metadata">

**Author:** ![Kees\_Smaling](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/kees_smaling/32/80323_2.png) [@Kees\_Smaling](https://community.homey.app/u/Kees_Smaling)\
**Post date:** [November 22, 2024, 1:08pm UTC](https://community.homey.app/t/app-pro-tp-link-deco/115521/160 "2024-11-22T13:08:13Z")

</div>

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) .

---

<div class="post-metadata">

**Author:** ![Luna\_Monkey](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/luna_monkey/32/101805_2.png) [@Luna\_Monkey](https://community.homey.app/u/Luna_Monkey)\
**Post date:** [November 23, 2024, 4:41am UTC](https://community.homey.app/t/app-pro-tp-link-deco/115521/161 "2024-11-23T04:41:01Z")

</div>

Hello, I can’t connect

I tested my email address and password.

Where do we find this information?

Thank you very much

 ![IMG_1128](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/3/2/32ed8ac6e773d3d7c9112cd03fc8c5e71d6335e8.jpeg)

[Previous page](https://community.homey.app/t/app-pro-tp-link-deco/115521.md?page=7)

[Next page](https://community.homey.app/t/app-pro-tp-link-deco/115521.md?page=9)
