Automate my mechanical Ventilation when i turn the lights on in the badroom

Hi people, i have the following “problem”;

i have 6 lights in my bathroom (ikea tradfreri light connected to the ike tradfreri hub)

my light switch however is nog smart, just a “normal” switch.

i have an automation which if one light goes on the Mechanical Ventilation starts, i have played with the states from unavailable or off , or as it is now from any state, but it wil sometimes work , most of the time not.

and i know why, when i turn my lights of with the switch, HA will see them as ON untill i do something in HA (turn them off of dim the ligths), only then they become UNAVAILABLE.

so im trying to find a way to make this work every time and not at random, i played around with a automation wich turns the light on so i trigger this UNAVAILABLE state, with mixed results.

my automation for the MV

alias: MV aan
description: ""
trigger:
  - platform: state
    entity_id:
      - light.lamp01_badkamer
    from: null
    to: "on"
condition: []
action:
  - service: script.mv_preset_high
    data: {}
mode: single

my resoltuin automation.

alias: Set status badkamer verlichting
description: ""
trigger:
  - platform: time_pattern
    seconds: "1"
condition:
  - condition: not
    conditions:
      - condition: device
        type: is_on
        device_id: aa1c8f14c2fa4471c1ce37a1cf6ac19b
        entity_id: 6fc3eea06c5d57d40df0c38effd085ff
        domain: light
      - condition: device
        type: is_on
        device_id: 57ca25a0a8241bb6d26c308902019757
        entity_id: 7beaf20fb7a2b6dde0c6de6adcacbd27
        domain: light
      - condition: device
        type: is_off
        device_id: ad7d206eab7e92fa96ca9b212c0ae1dd
        entity_id: 7b9fbeee1740e365f6a9dd381cf3c6b4
        domain: light
      - condition: device
        type: is_off
        device_id: f4422eabbce15c11886cc384c6fbe634
        entity_id: 3e9e0a947e2bcdce91393b9a2a72ecfe
        domain: light
      - condition: device
        type: is_off
        device_id: 5431430f97a905de9ccd3f839f518b84
        entity_id: c9bd140f35eb7b35cbb22d373f899f6c
        domain: light
      - condition: device
        type: is_off
        device_id: 2b8eacbb6c2176281a5d0c9ae54d7f9d
        entity_id: 1e545032c740eb7259e2ce45bc8ab0db
        domain: light
action:
  - service: scene.turn_on
    target:
      entity_id: scene.lampen_badkamer
    metadata: {}
mode: single

thanks for you inputs and thougts.

i am dyslexic so bear with me somethimes i misspel or croos letters and words.

my native lang is Dutch.

Greetz

I can’t answer your automation question, but I may have a different solution. Have you considered leaving power to the lights all the time, and using a smart switch action to turn them on and off?

Hi Daves, yeah that would probably be my next step, actually i have an shelly lying around, and my thought was to do something with that.

i eventually used a Shelly 1l to automate the process, which works flawlessly.
in additation i can now automate my lights if i want to.