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
412 stars 52 forks source link

[Feature Request]: Adaptive Lighting support #335

Open sjorge opened 3 years ago

sjorge commented 3 years ago

Is your feature request related to a problem? Please describe. Nope, would just like to use homekits adaptive lighting, I got it working with a complex schedule in node red at the moment but while this is enabled I cannot set a custom override via homekit. Having both would be better.

Describe the solution you'd like Adaptive Lighting support, I think we need to bumb hap-nodejs for starters, en maybe expose some extra services.

Describe alternatives you've considered See above, I have a complex manual schedule and just have the bulbs as brightness expose to homekit. Not idea as I cannot manual override the color like this.

Additional context n/a

crxporter commented 3 years ago

Is it included in HAP-NodeJS yet?

jorschra commented 3 years ago

Looks like it, there is a or open to rename all the reference as they had it as ambient lighting first... so the original seems to be merged a while ago

https://github.com/homebridge/HAP-NodeJS/pull/855

crxporter commented 3 years ago

Using both accounts today, @sjorge ? I thought we had a new user then I saw it's still you.

sjorge commented 3 years ago

Wrong tab container yeah, that was the work one.

Shaquu commented 3 years ago

Okay, looks like HAP-NodeJS has something called Controllers. Adaptive Lightning Controller is still in beta. I will need to look how many of them we have and how to add them in the best way using NRCHKB.

https://github.com/homebridge/HAP-NodeJS/blob/585ede3f85b1989e1097b76f45c72925fa2f236b/src/accessories/Light-AdaptiveLighting_accessory.ts#L116

Probably every controller must be handled separately.

dmitrystarikov commented 3 years ago

I found this: https://developers.homebridge.io/HAP-NodeJS/classes/adaptivelightingcontroller.html I hope this is helpful :)

DedMsk commented 3 years ago

https://github.com/homebridge/homebridge/issues/2765

Shaquu commented 2 weeks ago

Okay guys, check latest dev version 1.7.0-dev.1

sjorge commented 2 weeks ago

There seems to be some sort of race:

21 Jun 00:08:08 - [error] [homekit-service2: 2Test] Failed to configure adaptive lightning due to AssertionError [ERR_ASSERTION]: Lightbulb must have the ColorTemperature characteristic added!
2024-06-20T22:08:08.023Z NRCHKB-Error:ServiceUtils2 [ 2Test:b9a76c3ee5bdc616] Failed to configure adaptive lightning due to AssertionError [ERR_ASSERTION]: Lightbulb must have the ColorTemperature characteristic added!
[
    {
        "id": "b9a76c3ee5bdc616",
        "type": "homekit-service2",
        "z": "bef3f7d0d4dc601f",
        "isParent": true,
        "hostType": "0",
        "bridge": "b8a669c67b5dfb61",
        "accessoryId": "",
        "parentService": "",
        "name": " 2Test",
        "serviceName": "Lightbulb",
        "topic": "",
        "filter": false,
        "manufacturer": "NRCHKB",
        "model": "0.170.1",
        "serialNo": "Default Serial Number",
        "firmwareRev": "0.170.1",
        "hardwareRev": "0.170.1",
        "softwareRev": "0.170.1",
        "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",
        "cameraConfigInterfaceName": "",
        "characteristicProperties": "{\"On\":true,\"Brightness\":true,\"Hue\":true,\"Saturation\":true,\"ColorTemperature\":true}",
        "waitForSetupMsg": false,
        "useEventCallback": false,
        "outputs": 1,
        "adaptiveLightingOptionsEnable": true,
        "adaptiveLightingOptionsMode": "1",
        "adaptiveLightingOptionsCustomTemperatureAdjustment": "",
        "x": 430,
        "y": 660,
        "wires": [
            []
        ]
    },
    {
        "id": "b8a669c67b5dfb61",
        "type": "homekit-bridge",
        "bridgeName": "Bridge",
        "pinCode": "123-45-678",
        "port": "60942",
        "advertiser": "ciao",
        "allowInsecureRequest": false,
        "manufacturer": "Test",
        "model": "NRBridge",
        "serialNo": "1234",
        "firmwareRev": "1.0.0",
        "hardwareRev": "1.0.0",
        "softwareRev": "1.0.2",
        "customMdnsConfig": false,
        "mdnsMulticast": true,
        "mdnsInterface": "",
        "mdnsPort": "",
        "mdnsIp": "",
        "mdnsTtl": "",
        "mdnsLoopback": true,
        "mdnsReuseAddr": true,
        "allowMessagePassthrough": false
    }
]