Lights on with motion in washroom issue

I have setup this automation where the light in the washroom comes on when the Ikea E1525 motion sensor is detected. It will shut off in 3:30 when no motion is detected.This code has an ifelse statement where the light in the washroom will remain on if the adjust room (shower room) lights are on. When the shower room lights are off, the washroom light will turn off when there is no motion detected.

The problem I have is that the shower room lights have ikea smart blub. The switch is not smart. If someone finish using the shower and turn off the shower lights with the switch, the washroom lights will not turn off because HA still thinks the shower lights are still on when in fact, it was turned off manually at the switch.

How can I fix this problem without the need of buying additional device (smart switch). Hope to solve this using codes.

# Washroom Motion Senor
- alias: motion washroom light on
    platform: state
    entity_id: binary_sensor.motion_washroom_occupancy
    to: 'on'
    service: light.turn_on
    entity_id: light.wash_room

- alias: motion washroom light off
    platform: state
    entity_id: binary_sensor.motion_washroom_occupancy
    to: 'off'
    for: 00:00:30
    service_template: >
      {% if is_state('light.shower_room', 'on') %}
      {% else %}
      {% endif %}
    entity_id: light.wash_room

Generally when you use smart bulbs you want to physically restrict people from turning off the power to them. Easy / cheap solution is to stick something over the switch so they don’t turn it off.

Using code you might be able to create a template light which then sees the ‘unavailable’ smart light and reports this as ‘off’. Not sure how you will go there, plus you still lose the smart functionality so it’s still a lose situation

Yea, not everyone in my household has simulated over to automation. Their argument is turning off the light manually is faster.

Additonal Info:
I was thinking of using an Ikea E1743 on/off switch and place it right outside of the room on the counter but that is one more item on the counter I don’t like. Mounting on the wall with holes and or tape is not an option for me either.

Since you are using zigbee2mqtt, set report: true

Then HA will detect if your bulb is switched off with the non-smart switch

I solved it by putting a piece of foam under the switch, so it acts as a pulse switch now :wink:

I use Xiaomi wireless buttons which I have stuck above the normal light switch using double sided tape. The normal switch gets left on and the wireless button is used as an override. A single click turns the light on and disables motion control. Double click turns the light off and also disables motion control and a long press turns on motion control, leaving the light in ‘auto’ mode…but you didn’t want to buy more hardware…