Open sloukita opened 1 year ago
Note if I override the category to luminance sensor (ldcg), then the sensor works perfectly as a luminance sensor, but stops working as a presence sensor.
Is there a way to have both presence detection and luminance detection?
"category": "ldcg",
"schema": [
{
"code": "illuminance_value",
"newCode": "bright_value"
}
]
My current hacky workaround, override presence sensor as switch, set switch_1 as the presence detections, set switch_2 to true when luminance falls below 100lux
"category": "kg",
"schema": [
{
"code": "presence_state",
"newCode": "switch_1",
"type": "Boolean",
"onGet": "(value === 'presence') ? true : false;",
"onSet": "(value === true) ? 'presence' : 'none';"
},
{
"code": "illuminance_value",
"newCode": "switch_2",
"type": "Boolean",
"onGet": "(value < 100) ? true : false;"
}
]
Device Infomation JSON File
Detail Informations
Some presence sensors also have light sensor that measure illuminance_value however, in homekit, only the presence_state is exposed and not the lux value.