Closed CharmingCheung closed 6 months ago
Thanks!
Updated battery sensor and added entities
{
# https://home.miot-spec.com/spec/xiaomi.sensor_occupy.03
18051: ["Xiaomi", "Occupancy Sensor", "XMOSB01XS", "xiaomi.sensor_occupy.03"],
"spec": [
# main sensors
BoolConv("occupancy", "binary_sensor", mi="2.p.1078"),#Tested
BaseConv("illuminance", "sensor", mi="2.p.1005"),#Tested
# other sensors
BaseConv("battery", "sensor", mi="3.p.1003"),
BaseConv("has_someone_duration", "sensor", mi="2.p.1081"),
BaseConv("no_one_duration", "sensor", mi="2.p.1082"),
],
},
Updated battery sensor and added entities
{ # https://home.miot-spec.com/spec/xiaomi.sensor_occupy.03 18051: ["Xiaomi", "Occupancy Sensor", "XMOSB01XS", "xiaomi.sensor_occupy.03"], "spec": [ # main sensors BoolConv("occupancy", "binary_sensor", mi="2.p.1078"),#Tested BaseConv("illuminance", "sensor", mi="2.p.1005"),#Tested # other sensors BaseConv("battery", "sensor", mi="3.p.1003"), BaseConv("has_someone_duration", "sensor", mi="2.p.1081"), BaseConv("no_one_duration", "sensor", mi="2.p.1082"), ], },
I also noticed the has_someone_duration
and no_one_duration
parameters. However, this is because the device is battery-powered and provides Mi Home users with a rough time estimate as a reference. Since HA integrates this device through XiaomiGateway3 and receives real-time status updates, it is entirely possible to calculate a more precise duration by fetching the last_changed
attribute of occupancy
entity. Therefore, I decided not to include these two parameters initially. As for the battery, I couldn't test it initially due to the low reporting frequency. I later tried adding "sensor" and tested it, and you seem to be correct.