# How to fill MySignal.js/commandToDeviceData?

**URL:** <https://community.homey.app/t/how-to-fill-mysignal-js-commandtodevicedata/95992>\
**Category:** Developers\
**Tags:** rf-433, homey-pro-2023\
**Created:** [November 27, 2023, 4:10pm UTC](https://community.homey.app/t/how-to-fill-mysignal-js-commandtodevicedata/95992 "2023-11-27T16:10:24Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![veneszg](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/veneszg/32/79645_2.png) [@veneszg](https://community.homey.app/u/veneszg)\
**Post date:** [November 27, 2023, 4:10pm UTC](https://community.homey.app/t/how-to-fill-mysignal-js-commandtodevicedata/95992/1 "2023-11-27T16:10:24Z")

</div>

In homey-rfdriver/RFDevice.js, onCommandMatch compares currentDeviceData with commandDeviceData.

async onCommandMatch(command) {  
const signal = await this.driver.getRFSignal();  
const currentDeviceData = await this.getData();  
const commandDeviceData = signal.constructor.commandToDeviceData(command);  
return RFUtil.deepEqual(currentDeviceData, commandDeviceData);  
}

IN MY TEST CASE:

commandDeviceData contains:  
2023-11-27T15:56:12.216Z [log] [ManagerDrivers] [Driver:temphum] [Device:533e1d76-2662-4df2-beda-db93baec23b3] { address: 209 }

currentDeviceData contains:  
2023-11-27T15:56:12.218Z [log] [ManagerDrivers] [Driver:temphum] [Device:533e1d76-2662-4df2-beda-db93baec23b3] {  
uuid: ‘6cc3317a-39d9-4db9-b076-5af17952f0b2’,  
address: 209,  
copiedFromRemote: true  
}

From this link ([Home - Homey RFDriver](https://athombv.github.io/node-homey-rfdriver/index.html)) the suggestion is the following for commandToDeviceData:

static commandToDeviceData(command) {  
return {  
address: command.address,  
};  
}

MY QUESTION:

The result of onCommandMatch will never be True. Should I add somehow uuid and copiedFromRemote values? If yes, how?

Please help me someone. I am a beginner for homey and do not have huge programming skills, but working on a 433mhz automation for munths and suffering a lot

Thank you in advance, if you take a few minutes on this.

---

<div class="post-metadata">

**Author:** ![robertklep](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/robertklep/32/160628_2.png) [@robertklep](https://community.homey.app/u/robertklep)\
**Post date:** [November 27, 2023, 5:49pm UTC](https://community.homey.app/t/how-to-fill-mysignal-js-commandtodevicedata/95992/2 "2023-11-27T17:49:43Z")

</div>

> [@veneszg](#):
>
> The result of onCommandMatch will never be True. Should I add somehow uuid and copiedFromRemote values? If yes, how?

Have you tried a simple comparison of addresses (instead of `RFUtil.deepEqual()`)?

```auto
return currentDeviceData.address === commandDeviceData.address;

```

---

<div class="post-metadata">

**Author:** ![veneszg](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/veneszg/32/79645_2.png) [@veneszg](https://community.homey.app/u/veneszg)\
**Post date:** [November 27, 2023, 6:11pm UTC](https://community.homey.app/t/how-to-fill-mysignal-js-commandtodevicedata/95992/3 "2023-11-27T18:11:12Z")

</div>

My intention was not to modify the homey rf driver and find the way how to use, but i give up.  
Thanks Robert, I am going to modify it 🙂

---

<div class="post-metadata">

**Author:** ![robertklep](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/robertklep/32/160628_2.png) [@robertklep](https://community.homey.app/u/robertklep)\
**Post date:** [November 27, 2023, 6:37pm UTC](https://community.homey.app/t/how-to-fill-mysignal-js-commandtodevicedata/95992/4 "2023-11-27T18:37:15Z")

</div>

Oh apologies, I thought it was your own code. In that case, I wouldn’t change it and somehow get retrieve the missing values. It looks like device data (retrievable using [`this.getData()`](https://apps-sdk-v3.developer.homey.app/Device.html#getData) from device instances).

---

<div class="post-metadata">

**Author:** ![veneszg](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/veneszg/32/79645_2.png) [@veneszg](https://community.homey.app/u/veneszg)\
**Post date:** [November 27, 2023, 8:40pm UTC](https://community.homey.app/t/how-to-fill-mysignal-js-commandtodevicedata/95992/5 "2023-11-27T20:40:55Z")

</div>

Thanks a lot Robert, but based on [Home - Homey RFDriver](https://athombv.github.io/node-homey-rfdriver/) Mysignal.js is included in driver.js so If I am right, I can not get data of device instance. Or am I wrong?  
On the other hand I do not think it makes sense to compare the device uuid with the recived payload-\>command content it does not contains it. Tt is very difficult for me to proceed due to insufficient documentation. But a big thank for your support and time!
