Alexa 智能家居功能相互压倒

2024-02-16

我有一个用于智能家居窗帘的 Alexa 项目,其中包括两个范围控制器、一个亮度控制器和每个端点上的切换控制器。

两个范围控制器、切换控制器和亮度控制器都有不同的实例和友好名称。

当向 Alexa 发出命令时,任何包含百分比的内容都默认为亮度控制器,无论命令的措辞如何。如果我完全删除亮度控制器并尝试发出旋转命令(范围控制器),根据设备的不同,我会得到非常不一致的结果,表明它不知道如何设置设置。有些设备一开始可以正常工作 90% 左右,然后就会突然出现持续故障。其他设备根本无法工作。没有设备能够持续工作。

如果我减少到其中任何一项功能,它几乎 100% 的时间都能工作。

有其他人经历过这种行为吗?有什么解决办法吗?

能力代码:

export const ROTATE_CAPABILITY = {
    type: "AlexaInterface",
    interface: "Alexa.RangeController",
    version: "3",
    instance: "Blind.Rotate",
    properties: {
        supported: [{ name: "rangeValue" }],
        proactivelyReported: false,
        retrievable: true,
    },
    capabilityResources: {
        friendlyNames: [
            {
                "@type": "text",
                value: {
                    text: "Vane",
                    locale: "en-US"
                }
            },
            {
                "@type": "text",
                value: {
                    text: "Tilt",
                    locale: "en-US"
                }
            },
            {
                "@type": "text",
                value: {
                    text: "Angle",
                    locale: "en-US"
                }
            }
        ]
    },
    configuration: {
        supportedRange: {
            minimumValue: 0,
            maximumValue: 100,
            precision: 1,
        },
        unitOfMeasure: "Alexa.Unit.Percent"
    }
}

export const BRIGHTNESS_CAPABILITY = {
    type: "AlexaInterface",
    interface: "Alexa.BrightnessController",
    version: "3",
    instance: "Blind.Brightness",
    properties: {
        supported: [
            {
                name: "brightness"
            }
        ],
        proactivelyReported: false,
        retrievable: true
    }
}

export const BRIGHTNESS_TOGGLE = {
    type: "AlexaInterface",
    interface: "Alexa.ToggleController",
    instance: "Blind.Light",
    version: "3",
    properties: {
        supported: [
            {
                name: "toggleState"
            }
        ],
        proactivelyReported: false,
        retrievable: true,
        nonControllable: false
    },
    capabilityResources: {
        friendlyNames: [
            {
                "@type": "text",
                value: {
                    text: "Shade Light",
                    locale: "en-US"
                }
            },
            {
                "@type": "text",
                value: {
                    text: "Light",
                    locale: "en-US"
                }
            }
        ]
    }
}

export const MAIN_CAPABILITY = {
    type: "AlexaInterface",
    interface: "Alexa.RangeController",
    instance: "Blind.Lift",
    version: "3",
    properties: {
        supported: [{
            name: "rangeValue",
        },],
        proactivelyReported: false,
        retrievable: true,
    },
    capabilityResources: {
        friendlyNames: [
            {
                "@type": "text",
                value: {
                    text: "Shade",
                    locale: "en-US"
                }
            }
        ],
    },
    configuration: {
        supportedRange: {
            minimumValue: 0,
            maximumValue: 100,
            precision: 1,
        },
        unitOfMeasure: "Alexa.Unit.Percent",
    },
    semantics: {
        actionMappings: [{
            "@type": "ActionsToDirective",
            actions: ["Alexa.Actions.Close"],
            directive: {
                name: "SetRangeValue",
                payload: {
                    rangeValue: 0,
                },
            },
        },
        {
            "@type": "ActionsToDirective",
            actions: ["Alexa.Actions.Open"],
            directive: {
                name: "SetRangeValue",
                payload: {
                    rangeValue: 100,
                },
            },
        },
        {
            "@type": "ActionsToDirective",
            actions: ["Alexa.Actions.Lower"],
            directive: {
                name: "AdjustRangeValue",
                payload: {
                    rangeValueDelta: -10,
                    rangeValueDeltaDefault: false,
                },
            },
        },
        {
            "@type": "ActionsToDirective",
            actions: ["Alexa.Actions.Raise"],
            directive: {
                name: "AdjustRangeValue",
                payload: {
                    rangeValueDelta: 10,
                    rangeValueDeltaDefault: false,
                },
            },
        },
        ],
        stateMappings: [{
            "@type": "StatesToValue",
            states: ["Alexa.States.Closed"],
            value: 0,
        },
        {
            "@type": "StatesToRange",
            states: ["Alexa.States.Open"],
            range: {
                minimumValue: 1,
                maximumValue: 100,
            },
        },
        ],
    },
}

None

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

Alexa 智能家居功能相互压倒 的相关文章

随机推荐