Skip to content

Incorrect occupancy logic #23

Description

@Tommatheussen

I was trying to figure out why my static presence sensor is not behaving correct (different story), I disabled the static presence sensor for a while to postpone the troubleshooting (needed the room to function mostly correctly in the meantime during troubleshooting ;) )
During this, I noticed the occupancy sensor is not correctly using all other sensors, as I expected occupancy to still be detected when the PIR was off but the tracking sensor at least had a target.

Stated in the documentation (https://docs.everythingsmart.io/s/products/doc/how-to-tune-your-pro-1fSnWR0umV) is that the Occupancy sensors is a complete OR combination of all 3 different sensors.
This is however not the case:
Image

The lambda code at

lambda: |-
if ( id(dfrobot_presence).state or id(pir_motion).state) {
return true;
}
else if (id(dfrobot_presence).state == 0 and id(pir_motion).state == 0) {
return false;
}
else {
return id(ld2450_occupancy).state;
}
indicates different logic however. I believe the final else statement (that actually returns the status of the LD2450) is never reached.
Shouldn't it just be an OR combination of all sensors, or is there specific logic why it would check the tracking and PIR first?

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions