Yeah. Thatâs the problem. I wanted the fan to turn on using the switch because thatâs what all the rest of the family uses. It does work with turning it on via the toggle helper.
The problem you have is if the automation turns ON the fan it is the same as turning ON the switch. It is the same entity. So if you use the switch for the manual fan then every time the fan is turned ON with the automation it turns ON the manual switch. Hope you can see the conflict. So the manual switch must be totally independent.
So what you can do is get a Shelly 2PM and use one contact for the fan and the other for the manual switch. Wire the manual switch to the switch on the wall not the fan.
Blacky
Ok. So my switches are from hubitat and it added a switch to fan helper âChange device type of switchâ). I can use that for the automation and it works as now there are two entities that control the fan. Havenât figured out how to make such a helper myself but that sounds like a possible workaround
Great automation - thank you so much. Iâm seeing a weird edge case. Iâve got two switches, both wired separately to Shellys - light, fan. Also have a zigbee motion sensor.
If I just set up the motion sensor â fan, it all works fine, turns on, turns off. What Iâd like to do is add the light switch as the âmanual fan switchâ. First problem - itâs a light, not a switch - so I added a template switch that is just based on the value of the light.
I add that into the âmanual fan switchâ and it works if I donât trigger the motion sensor. I can turn on the light, the fan turns on, I can turn off the light, the fan turns off. However, if the light is off, and I enter the bathroom, triggering the motion sensor, then I turn the light on manually, then turn it off again, the fan remain on - and never turns off.
Any tips?
Thanks,
Cemil
I have just tested it here again and it works perfectly. I Had
- Motion as the Trigger Sensor
- Fan in fan
- Light in Manual Fan Switch
Could you please provide us your YAML of the automation? This YAML code are the settings you have selected in the automation so I can help. To do this go into your automation, top right 3 dots, Edit in YAML, copy all the code, come back to the forum and in your reply at the top tool bar click on â</>â and paste code in there.
Blacky
Hi @blacky,
alias: Downstairs Bathroom Exhaust Fan
description: ""
use_blueprint:
path: Blackshome/toilet-exhaust-fan.yaml
input:
entity_trigger: binary_sensor.lumi_lumi_sensor_motion_aq2_motion
fan_switch: switch.downstairs_bathroom_fan
time_delay: 1
include_manual_fan_switch: enable_manual_fan_switch
manual_fan_switch: switch.downstairs_bathroom_light_fake_switch
manual_fan_switch_time_delay: 0
YAML there. Also failure condition.
Thank you for helping debug! How can I help?
The âswitch.downstairs_bathroom_light_fake_switchâ, I canât see if this is set up correctly. Can you copy your light entity ID and replace it with your âswitch.downstairs_bathroom_light_fake_switchâ in the YAML. Like this.
alias: Downstairs Bathroom Exhaust Fan
description: ""
use_blueprint:
path: Blackshome/toilet-exhaust-fan.yaml
input:
entity_trigger: binary_sensor.lumi_lumi_sensor_motion_aq2_motion
fan_switch: switch.downstairs_bathroom_fan
time_delay: 1
include_manual_fan_switch: enable_manual_fan_switch
manual_fan_switch: your.light_entity_id_here
manual_fan_switch_time_delay: 0
Donât be confused with this trace line as it is the inverted trigger being stopped. When you go into your traces at the top you will see the date and a back / forward arrow. Click on the back arrow to get the correct trace.
Blacky
Sure; will try in about an hr or so. FWIW< hereâs the fake switch template:
- platform: template
switches:
downstairs_bathroom_light_fake_switch:
unique_id: "downstairs_bathroom_light_fake_switch"
value_template: "{{ is_state('light.downstairs_bathroom_light', 'on') }}"
turn_on:
turn_off:
You have actions in the but no actions . Try this⌠it will be better to just input your light as you are not using it as the trigger.
platform: template
switches:
downstairs_bathroom_light_fake_switch:
unique_id: "downstairs_bathroom_light_fake_switch"
value_template: "{{ is_state('light.downstairs_bathroom_light', 'on') }}"
alias: Downstairs Bathroom Exhaust Fan
description: ""
use_blueprint:
path: Blackshome/toilet-exhaust-fan.yaml
input:
entity_trigger: binary_sensor.lumi_lumi_sensor_motion_aq2_motion
fan_switch: switch.downstairs_bathroom_fan
time_delay: 1
include_manual_fan_switch: enable_manual_fan_switch
manual_fan_switch: light.downstairs_bathroom_light
manual_fan_switch_time_delay: 0
Blacky
OK! Will do - I think it wouldnât let me pick a manual_fan_switch through the UI if the domain type was == light.
I figured I didnât need any actions in there, since we were just using it for state - is that not the case? I thought you were just monitoring for state?
It will not allow you to pick a light domain through the UI but you can edit the YAML and add your light in this blueprint⌠for that input it will still work. I run filters sometimes so it is easier to pick your entity and I though most people wouldnât use a light there but it is okay to do so.
Normally when you add these turn on or off actions you have actions. What you can do when developing templates like this is to add your light and you template to the UI then turn the light ON and see what happens to the template. Then if needed you can edit them and see what happens remembering you will have to reload templates every time you edit them. To do this go into developer tools . YAML tab > then select âTemplate Entitiesâ. A HA restart will also do the same thing.
Hope this helps you, let us know how you go.
Blacky
@blacky - sorry it took me a little while to get back to playing with this!
Iâm still having the same issue. YAML below.
When I walk into the bathroom, sensor trips, fan comes on. If I then decide I want the light, and turn ON the light, fan stays on. If I then walk out, turn the light off, fan stays on - and never turns off again.
Ideas greatly appreciated!
description: ""
use_blueprint:
path: Blackshome/toilet-exhaust-fan.yaml
input:
entity_trigger: binary_sensor.lumi_lumi_sensor_motion_aq2_motion
fan_switch: switch.downstairs_bathroom_fan
time_delay: 1
include_manual_fan_switch: enable_manual_fan_switch
manual_fan_switch: light.downstairs_bathroom_light
manual_fan_switch_time_delay: 0
I have tested it here again trying every option and the fan always turns OFF. Can you check to make sure nothing else it keeping it ON (anther automation).
Blacky
Hi @Blacky ; again, finally got back to testing this, and not seeing âexpectedâ behaviour. Iâve got my master fan down the bottom.
For clarity, there are 2 Shelly relays - a 1pm and a dimmer in there; 1pm runs the fan, dimmer runs the lights. Theyâre on separate switches. It may be important to note that the presence sensor and switch are both inside the bathroom, so itâs hard to press the light switch without triggering the presence sensor.
Based on the config below, I am definitely seeing unexpected behaviour:
- If I trip the sensor, fan works - every time. If I donât touch the light, the fan will go off with the time delay. So far, so good.
- If I trip the sensor, then turn the light on manually, the fan will eventually go off when the presence sensor stops detecting motion, but so will the light. Example log entry - Iâm not sure how the automation is turning off the light, given that I havenât selected any option.
Master Bathroom Light turned off triggered by automation Master Bathroom Exhaust Fan triggered by state of Master Bathroom Motion Sensor Presence
19:28:09 - 19 hours ago
- Lastly, if I trip the sensor, then turn the light on manually, then turn the light off manually, the fan will not turn off by itself - requires manual intervention.
What other information can I provide to help troubleshoot?
alias: Master Bathroom Exhaust Fan
description: ""
use_blueprint:
path: Blackshome/toilet-exhaust-fan.yaml
input:
entity_trigger: binary_sensor.master_bathroom_motion_presence
fan_switch: switch.master_bathroom_fan
time_delay: 2
include_manual_fan_switch: enable_manual_fan_switch
manual_fan_switch: light.master_bathroom_light
Thanks for providing this detail of what is happening including your YAML. It really helps me.
Correct
Correct
Not correct
All is good in the design of the blueprint but it look like you would like a different option / way in how it should work. Please look at removing / disabling the manual light control and use option 1 in the bypass. Then in âBy-pass Switch - Turn Fan ONâ enter in your âlight.master_bathroom_lightâ. The only thing that may happen is when you turn your light OFF the fan may turn OFF instantly if the presence sensor is not detecting motion. I could add a extra input to fix this but let us know if this works for you. Note you could also use the âEnable the by-pass auto off - Turn fan ON optionâ and set a âBy-pass Auto OFF - Time Delayâ if the light was left ON accidentally.
Please let us know how you go as I do value feedback.
Blacky
Hi @Blacky ; Thanks for the rapid response mate. What youâve written makes sense, let me try it.
I may come back with some small wording modifications to documentation / tooltips in that case. Thanks a lot for the help!
Hi,
I would really like to use the inverted mode in combination with the âtrigger wait optionâ, which is exclusive for the ânormal Modeâ.
Means that the fan should only be switched on if the trigger wait time has passed and the light is switched off (after leaving).
I havenât found a solution for this. Does anyone have an idea?
Thanks a lot.
Firstly welcome to the community
I can see your point. I have updated the blueprint, just doing the final checks and I will release the update. Stay tuned.
Blacky
New Features
- Invert Mode - Trigger wait option can now be used in inverted mode.
Maintenance
- Changed to my new layout.
Bugs Fixes
- Fixed bugs in inverted trigger by-pass.
If you like this blueprint? Consider hitting the button in the top post
If you like my blueprints, and would like to show your support or just say thank you? Click Here
Enjoy
Blacky