我想在HomeKit中显示电源使用情况。不幸的是,在HomeKit中没有这样做的类别。这就是为什么我的想法不是将其显示为耗电量,而是HomeKit中的温度。这个想法是用假的温度传感器来控制HomeKit场景。
不幸的是,我没有使用node-red的经验,它对我来说是新的。
我从电表中得到了下面的字符串:
success: "true"
response: string
{
"power": 3.040480,
"relay": true
}我将其链接到HomeKit节点,然后返回以下错误:
Characteristic response cannot be written.
Try one of these: Name, CurrentTemperature, StatusActive, StatusFault, StatusLowBattery, StatusTampered, Name不幸的是,经过各种函数和其他调整后,我无法在HomeKit中显示“温度”。
我使用这个:https://flows.nodered.org/node/@plasma2450/node-red-contrib-homekit-bridged
发布于 2018-11-14 12:39:36
我认为您不能直接链接这两个节点。从错误消息中可以看出,您已经将有效负载从仪表输出传递到了HomeKit节点。虽然仪表输出包含response属性,但HomeKit不支持该属性,因此会出现错误。
确保您的有效负载只包含受支持的特征。您可以使用change节点来修改有效负载,也可以简单地使用函数节点
const msg.meterOutput = msg.payload;
// Just a prototype, type checking is required
msg.payload = {
currentTemperature: msg.meterOutput.response.power
}
return msg;https://stackoverflow.com/questions/53223465
复制相似问题