-
-
Notifications
You must be signed in to change notification settings - Fork 40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Override entity prevents switching off #293
Comments
This sounds like expected behaviour. When it goes in override it should stop whatever it's doing because something is overriding the controller. |
I would disagree - if entity controller is active, it's too late to override it - so it should do its thing until its done. In my mind override is used for transition to active state, not for overriding the controller in its functionality. Well, at least it should be configurable, and I'll make a PR soon-ish to provide a flag (or a list of states in which to consult override) for this. BTW, I have the exact scenario that OP posted:
|
Yes, the current behaviour prevents the entity controller to be usable for motion sensors with illuminance control. The light changes the illuminance and that leads to the lights staying on indefinitely |
However, thinking about it more, we already do have a way to set up behaviour for transition to active - it is the sensor property. It's just a matter of making a composite binary sensor of motion and luminance (threshold). I have a feeling that even if we could change override behaviour, it still would be a bad experience, since you would have old bright luminance value cached, and I suspect there could be some weird timing interplay here between when luminance gets updated on next trigger and when motion gets updated. In any case, I'll actually drop the override config, and play with configuring trigger sensor more. |
- trigger:
- platform: state
entity_id: binary_sensor.a_motion_sensor
for:
milliseconds: 100
binary_sensor:
- name: "Motion Light Trigger"
unique_id: "a_motion_light_trigger"
state: >
{% set is_on = is_state('binary_sensor.a_motion_light_trigger', 'on') %}
{% set is_ec_active = is_state('entity_controller.a_motion_light', 'active_timer') %}
{% set is_not_over_luminance_threshold = not is_state('binary_sensor.an_illuminance_upper_threshold_sensor', 'on') %}
{% set is_motion_detected = is_state('binary_sensor.a_motion_sensor') %}
# ignore luminance sensor if trigger itself is already on,
# or if entity controller that is triggered is already active
{% if is_on or is_ec_active %}
{{ is_motion_detected }}
{% else %}
{{ is_motion_detected and is_not_over_luminance_threshold }}
{% endif %} Above is the template trigger that I ended up with, and it seems to be covering the stated use-case well. It's by no means fully tested, but that will come with time. |
I am also struggling with this type of scenario. |
EC configuration is then simple, with the trigger defined as above entity_controller:
a_motion_light:
sensor: binary_sensor.a_motion_light_trigger
entity: light.some_light_to_control
sensor_type: duration
sensor_resets_timer: true Note that |
Description
I have a a threshold sensor which triggers when illumination is higher than a certain level as an override for a motion sensor triggered EC.
The documentation says: "You can define entities which stop EC from transitioning into active state if those entities are in on state". But the override is also used in active state.
Since the threshold is lower than the illumination created by the controlled light, the light never switches off.
The EC goes into the following state:
Configuration
Steps to reproduce
Steps to reproduce the behavior:
Expected behavior
This is how the component should work:
Actual Behaviour
This is what actually happened:
Version
The text was updated successfully, but these errors were encountered: