# Different type in getDeviceTriggerCard

**URL:** <https://community.homey.app/t/different-type-in-getdevicetriggercard/132321>\
**Category:** Developers\
**Tags:** flow, advancedflow\
**Created:** [March 8, 2025, 1:26pm UTC](https://community.homey.app/t/different-type-in-getdevicetriggercard/132321 "2025-03-08T13:26:46Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![makleso6](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/makleso6/32/78907_2.png) [@makleso6](https://community.homey.app/u/makleso6)\
**Post date:** [March 8, 2025, 1:26pm UTC](https://community.homey.app/t/different-type-in-getdevicetriggercard/132321/1 "2025-03-08T13:26:46Z")

</div>

I create app with DeviceTriggerCard, but there is a bug with arg type. when I get args.button.aid in standard flow type is Number, but in advanced flow type is String.

```auto
this.homey.flow.getDeviceTriggerCard('multy_button_clicks')
    .registerArgumentAutocompleteListener('button', async (query, args) => {
        const device = args.device as SprutHubDevice;
        const data = device.getData()
        const services = await (device.driver as SprutHubDriver).getServices(data.aid);
        const filter = services?.filter(service => service.type === 'StatelessProgrammableSwitch')
        for (const value of filter || []) {
            console.log('*** aid', value.aId, typeof value.aId);
            console.log('*** sid', value.sId, typeof value.sId);

        }
        return filter?.map(service => ({
            name: service.name,
            aid: Number(service.aId),
            sid: Number(service.sId)
        })) || [];;

    })
    .registerArgumentAutocompleteListener('click_type', async (query, args) => {
        if (!(args.button)) {
            return [];
        }
        const device = args.device as SprutHubDevice;
        const data = device.getData()
        // console.log('*** data', data);
        console.log('*** aid', args.button.aid, typeof args.button.aid); // Number in standart flow, but string in advanced
        console.log('*** sid', args.button.sid, typeof args.button.sid);
        const service = await (device.driver as SprutHubDriver).getService(args.button.aid, args.button.sid, true);

        return service.characteristics?.flatMap(characteristic => {
            if (getCharacteristicControl(characteristic).type === 'ProgrammableSwitchEvent') {
                const val = getCharacteristicControl(characteristic).validValues
                    ?.filter(value => value.checked === true)
                    ?.map(filteredValue => ({
                        name: filteredValue.name,
                        value: filteredValue,
                        aId: characteristic.aId,
                        sId: characteristic.sId,
                        cId: characteristic.cId
                    })) || [];
                console.log(val);
                return val
            }
            return [];
        }) || [];
    })
    .registerRunListener(async (args, state) => {
        if (state.aId === args.click_type.aId && state.sId === args.click_type.sId && state.cId === args.click_type.cId) {
            return Object.values(state.control.value)[0] === Object.values(args.click_type.value.value)[0];
        }
        return false;
    });

```

---

<div class="post-metadata">

**Author:** ![martijnpoppen](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/martijnpoppen/32/84849_2.png) [@martijnpoppen](https://community.homey.app/u/martijnpoppen)\
**Post date:** [March 9, 2025, 11:44am UTC](https://community.homey.app/t/different-type-in-getdevicetriggercard/132321/2 "2025-03-09T11:44:55Z")

</div>

You can create a issue here: [https://github.com/athombv/homey-apps-sdk-issues/issues](https://github.com/athombv/homey-apps-sdk-issues/issues)
