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.
Then I will be able to see what is happening with your automation.
First of all what a good Blueprint just what I was looking for. Until yesterday my extractor fan was controlled by my plc, because a remote IO station has broken (which has a long delivery time), I came across this Blueprint which does almost exactly the same as what I programmed in the plc. Only when I took a shower this morning did I notice that the fan wouldnât come on and I turned it on manually to check the logs later. Now I suspect I did something wrong somewhere because I get the following error every time the automation is triggered.
Error log:
Logger: homeassistant.components.automation.hvac_bathroom_humidity_exhaust_fan
Source: components/automation/__init__.py:608
Integration: Automation (documentation, issues)
First occurred: 11:06:59 (6 occurrences)
Last logged: 12:20:26
Error rendering variables: UndefinedError: 'dict object' has no attribute 'entity_id'
Yes this has solved the problem and I have tested it a few times and everything works properly. This is great now I donât have to make anything myself to control my fan and you have thought of a lot of things I saw when I was browsing your code. Good job.
But I have one question:
While browsing through your code I saw some nice places here and there to add a function to adjust the fan speed. My fan can run at 2 speeds (high and low). What I would like to see is if the function âTurn on the fanâ is called and before âCheck if the lights are enabledâ there is an option to set the low/high bit high, and then after âWait until Humidity Derivative Sensor drops or it times outâ to set the bit low again. So basically when the timer runs âWait the number of minutes that has been set for the time delayâ the fan then runs at low speed, and then of course after this time the fan simply turns off.
I actually programmed almost exactly the same in my PLC as you did here in this blueprint, only this is the difference with what I made.
Also, the humidity had to be close again before I started showering (I took a snapshot of the value 10 min before I started showering and it also had to have dropped within a certain window, I donât know the percentage value now) otherwise the timer restarted and repeated a maximum of 3x. I do not attach much value to the latter because you have the option to set a maximum humidity and a time out value can be entered.
But donât get me wrong this is not an accusation or that I see it as a shortcoming. The blueprint is awesome in itself, just thought before I start experimenting with your blueprint Iâll drop the idea here
Thanks for the update, nice to know it working again
I am working on this blueprint so I will consider your suggestion but it will be some weeks before I release the next new features. I to have a 2 speed fan but only use one speed. Maybe check in again next month.
Oh see thatâs good news. I donât really care that it will take a while, Iâm going to test the values of the humidity (decreasing and rising value) first, then I will be a week further haha. Iâve already changed your blueprint to what I said in my previous post.
What did I do:
I actually copied your include_fan_speed_off and fan_speed literally and called it âspeed_switchâ
After this I put a choose for the âfan_onâ function if an entity is selected for speed switch then it will execute otherwise not
And for switching to the Timer I did the same, only of course with homeassistant.turn_off
I didnât make this neatly, I looked that I can get it made in the easiest possible way in my situation. Your other flow âFor winter mode when enabled and within the set winter monthsâ I have not changed. For now I have more than enough with this and I am still experimenting with the settings. Iâll keep an eye out for your updates, Iâm curious about your upcoming implementations
I have a request about time delay, ATM TimeDelay starts when the -level is reached ie -1, but if the level drops again after say 5 mins the timer is not reset, so, once the timer end the fan turns off, so it can cause the room humidity to start going up as it has not really had time to level out.
So could you code it so it resets the timer or add an option to reset it if falls below the point where the Delay Timer started.
The delay Time started at Orange arrow, but the derivative was still dropping (Pink and Blue), the Delay Time out ended and fan turn off at Green Arrow, which cause the the room humidity to raise again and eventually start the fan again once it reached the derivative high point (Yellow arrow). Restarting the timer each time the derivative goes lower than the set point would help stop this.
I know you would of read the settings guide Click Here.
If the humidity rises again it is a balancing act to get all your settings correct. I have mine so when the fan goes OFF the humidity will rise but not enough for the fan to come back ON. Then the humidity fall again. Good to also add your humidity sensor in your chart as it can help to understand what is happening and if you should run the fan longer. Here are my settings if your interested.
I saw this happening to me today too and I think itâs kind of the same problem. Only I think jumping back is not that simple, maybe a timer for the trigger would help a lot and in my opinion it is not that difficult to implement.
@Blacky
Could you please take a look (this is the place in my case) on line 1708 here you call the function âWait until Humidity Derivative Sensor drops or it times outâ. If you add a âfor x time conditionâ to this with a variable input, donât you think we can dampen this out.
Looks like your sensor location is ok. Try lowering your âFalling Humidityâ. Then you may be able to adjust your âTime Delayâ. It is a bit of a âLove Affairâ and it could take 20 showers to get it right, but once you do it works well. I have tried this but found getting the setting right stops the automation always going to the âSafe Guard - Maximum Run Timeâ.
Now we can see what is happening, ⌠having your settings would be nice but no stress, letâs have a look at it. Below I have added a few things in the hope it will be more clear.
At point âAâ. The red arrow (1.7 - 1.9) looks to be your âRising Humidityâ. Consider raising it to the yellow arrow (3.0). Because it is now 3.0 the point âBâ (fan ON again) may not accrue (try it, see, adjust, try it see, adjust, etc). The red line is where you finished your shower. Point â1â (green arrow) should be your âFalling Humidityâ around -2.0. Looks like your âTime Delayâ is around 15 min so if we take orange line to the green line it is around 20 min but we have a stop / start of the fan so 15 min may be ok. First try and set your âTime Delayâ to 25 min then look at the graph again to fine tune your run time as 25 min is way to long but we will be able to see what is happening. Then it is fine tuning, again, again and again of all your settings.
Sensor, sensor set up and sensor location is the main critical factor because that is the information we need to make it work perfectly. Having it inline with your fan inlet will stop all your problems (air flowing over it when the fan is ON). I also have my humidity sensor report every 60 seconds regardless. The data is not a problem it is the key and all this data gets purged in 10 days. In the past I had other sensors but once I set it up like this âBOOMâ perfect.
As I said in the above post, It is a bit of a âLove Affairâ and it could take 20 showers to get it right, but once you do, it works well. This is why winter and summers is realy nice feature as you can see by my settings it is so different and even 0.1 makes a difference.
thanks for taking the time, iâll try to tweak i did have 25mins for delay, now reduce this to 10 mins, and raised the detect point to 3 (was 1) hopefully this will stop the re-actioning. thanks let thw fun begin tweaking.
Thanks Andy, thanks for persisting at it, this is one blueprint I realy love (Game Changer to home automation) and my family love it to. If you have any question I here to help.
Yes, you are right, I actually have too little data. Anyway, I work with your original blueprint, I want to get the settings right first. Iâve set the falling humidity to -2, Iâve seen in history that it always falls below that.
But you are absolutely right when it comes to adjusting control loops, I myself work during the day as an Industrial Software Engineer and I program PLCs, Robots, safety systems and motion systems and I also regularly have to adjust control loops haha.
By the way, Iâm curious how the transition from high speed to low speed will react, you can see exactly when the fan is switched on in the graph. It may then be too humid in the bathroom to switch to low speed. I remember when I made the function block in the PLC that there was something wrong with this and that is why I first wait until the falling humidity falls below an x value (now -2 in your blueprint for me) and then for x (I think 3 min) time the falling humidity in a window of 0.1 <> -0.1 and then the timer will be started and the fan will run at low speed. I also had a timeout, but I also looked at the absolute value of the humidity, otherwise it falls into timeout very often. But I think this is all getting way too hard and what youâve made is more than enough (if youâve implemented the 2 speed control, of course, just kidding). But I made all this 8 years ago or so and I borrowed some of the code from a project from a lab where they genetically manipulate plants (vegetables), here we made a fully automated system to simulate a certain climate and humidity was one.
But again, good Automation here we are also happy with it and what I write above are certainly not criticisms just wanted to share my experiences maybe this will help you, if not then see it as if I didnât say anything
Haha, yeah, I noticed that too! While I was browsing through your code, it was clear that youâve really thought things through. I totally understand where youâre coming from. When I was working on programming this in the PLC 8 years ago, I found myself going down the rabbit hole multiple times too. Your contribution here is awesome, and itâs a relief knowing I wonât have to tackle it all over again â thanks for saving me that âround twoâ experience
Software is rarely a closed book; Iâve never encountered a completely flawless software package. Last year, I had to make a modification to a machine that I programmed a decade ago. When I looked at it, I thought, âWhat was I thinking back then?â But thatâs the beauty of it â you can arrive at solutions in different ways, and you often gain new insights, aside from the physical changes, of course.
By the way,
So, I took a shower today and guess what? The fan decided to stick around for a good while after I tweaked the âhumidity dropâ to -2. It happily hummed along for about 30 minutes this time. I must say, it wouldnât hurt to have it running at low speed for another 30 minutes or so afterward. But hey, itâs working like a charm to run the fan on high speed. Iâd probably dial down the high speed time a bit if I were to let it run at low speed afterward. The sweet part is, when itâs on low speed, itâs practically a ninja â no noise whatsoever. Super handy for those evening showers when someoneâs already in bed.
I was thinking, what if I use the âFan Speed - Switch Offâ option to not actually turn off the fan, but instead start a script that lets the fan run at a low speed for x amount of time? Or maybe a switch helper that triggers the script and only resets after the script completes. Just an idea!