homeassistant: only switch bathroom light when it is already on
All checks were successful
flake / flake (push) Successful in 1m18s

Although the system now knows whether the bathroom light is on, it switches the switch every time the light should be turned off regardless of if it's already off. Because this is a device running on battery that performs a physical movement this runs the battery out very fast. Adjust the system to only switch the light off if it thinks it's on, even though this has the potential for desyncs.
This commit is contained in:
JakeHillion 2024-05-25 22:03:11 +01:00
parent 3f829236a2
commit 78705d440a

View File

@ -116,10 +116,7 @@ in
unique_id = "87a4cbb5-e5a7-44fd-9f28-fec2d6a62538";
value_template = "{{ states('sensor.bathroom_motion_sensor_illuminance_lux') | int > 500 }}";
turn_on = { service = "script.noop"; };
turn_off = {
service = "switch.turn_on";
entity_id = "switch.bathroom_light";
};
turn_off = { service = "script.bathroom_light_switch_if_on"; };
};
};
}