NRCHKB / node-red-contrib-homekit-bridged

Node-RED Contribution - HomeKit Bridged : Node-RED nodes to simulate Apple HomeKit devices.
https://nrchkb.github.io
MIT License
419 stars 52 forks source link

[BUG] Temperature sensor does not properly round (not adhere to minStep as well) #173

Closed mbrackjr closed 4 years ago

mbrackjr commented 5 years ago

Describe the bug Temperature sensor seems to round down on integer value and not adhere to minStep value

To Reproduce

  1. Created temperature sensor with Characteristic Property of: { "CurrentTemperature": { "minStep": 0.5 } }
  2. manual inject input of { "CurrentTemperature": 21.6 }, gives read-out in home app of 21 degrees. Also, node in NodeRed briefly indicates in yellow value 21 when injected.

Expected behavior Node status and IOS home app to indicate 21.5 degrees.

Flow [{"id":"9ed2de11.2ef49","type":"inject","z":"73bf98f4.3a7e88","name":"","topic":"","payload":"{\"CurrentTemperature\":21.6}","payloadType":"json","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":390,"y":740,"wires":[["a5aca228.d3eda"]]},{"id":"a5aca228.d3eda","type":"homekit-service","z":"73bf98f4.3a7e88","isParent":true,"bridge":"57c85859.fd6818","accessoryCategory":"OTHER","parentService":"","name":"Name","serviceName":"TemperatureSensor","topic":"","filter":false,"manufacturer":"Manufacturer","model":"Model","serialNo":"SerialNo","cameraConfigVideoProcessor":"ffmpeg","cameraConfigSource":"","cameraConfigStillImageSource":"","cameraConfigMaxStreams":2,"cameraConfigMaxWidth":1280,"cameraConfigMaxHeight":720,"cameraConfigMaxFPS":10,"cameraConfigMaxBitrate":300,"cameraConfigVideoCodec":"libx264","cameraConfigAudioCodec":"libfdk_aac","cameraConfigAudio":false,"cameraConfigPacketSize":1316,"cameraConfigVerticalFlip":false,"cameraConfigHorizontalFlip":false,"cameraConfigMapVideo":"0:0","cameraConfigMapAudio":"0:1","cameraConfigVideoFilter":"scale=1280:720","cameraConfigAdditionalCommandLine":"-tune zerolatency","cameraConfigDebug":false,"cameraConfigSnapshotOutput":"disabled","characteristicProperties":"{\n \"CurrentTemperature\": \n {\n \"minStep\": 0.5\n }\n}","x":550,"y":740,"wires":[[],[]]},{"id":"57c85859.fd6818","type":"homekit-bridge","z":"","bridgeName":"Node-RED","pinCode":"111-11-111","port":"","allowInsecureRequest":false,"manufacturer":"Node-RED","model":"homekit-bridge","serialNo":"1.0","customMdnsConfig":false,"mdnsMulticast":true,"mdnsInterface":"","mdnsPort":"","mdnsIp":"","mdnsTtl":"","mdnsLoopback":true,"mdnsReuseAddr":true,"allowMessagePassthrough":true}]

Screenshots n/a

Additional context n/a

Shaquu commented 5 years ago

It is due an error KhaosT/HAP-NodeJS#729 It will be fixed at NRCHKB in 0.9 or any future version.

If you are in a hurry then you can test it already on the dev version: npm i node-red-contrib-homekit-bridged@dev

Remember that it can cause other errors and it's not recommended for stable production environment.

Shaquu commented 4 years ago

If you are keen to help then please install latest dev version on separate node-red environment and try if it's solved for your problem.

mbrackjr commented 4 years ago

hi @Shaquu

Took a while to test and respond, but i can confirm this is resolved. Thanks.