MODBUS and System air

In our house we´re using a Nilan Comfort 300LR system air. I have a rule which runs from Humidity. The speed of the system air is set from a measure of the humidity in our bathrooms. This means everytime someone has taken an bath, the spee of the ventilation will rise untill humidity is low again.
I do need to optimize this rule though, as it tend to get close to the setting here at summertime, where the outside air contains more humidity.

So based on the input from @Kim_Andersen and @gskjold I have rewritten the rule as follows:


rule "Adjust Fan"
when
    Item Bathroom_Scene changed or 
    Item Livingroom_Scene changed or 
    Item Group_CO2_Max changed or
    Item Group_Humidity_Max changed or
    Item Group_Humidity_Min changed or
    Item vTimeOfDay changed or 
    Item Presence_Home changed
then
    logInfo("Notification", "Fan rule")
    // we run fan on low when we are away, if its night and CO2 level is below 2500
    if  (Presence_Home.state==OFF || (vTimeOfDay.state.toString.contains("NIGHT") && Group_CO2_Max.state as Number < 2500) ){
         logInfo("Notification", "Fan low, we run fan on low when we are away, if its night and CO2 level is below 2500")
        if (VillaventFan.state as Number !=1) { VillaventFan.sendCommand(1)}
    }

    // we run fan on medium when we are home and its night and CO2 level is above 2500 below 3000
    if  (Presence_Home.state==ON && vTimeOfDay.state.toString.contains("NIGHT") && Group_CO2_Max.state as Number >= 2500 && Group_CO2_Max.state as Number < 3000 ){
         logInfo("Notification", "Fan medium, we run fan on medium when we are home and its night and CO2 level is above 2500 below 3000")
        if (VillaventFan.state as Number !=2) { VillaventFan.sendCommand(2)}
    }
    
    // we run fan on max when we are home and its night and CO2 level is above 3000
    if  (Presence_Home.state==ON && vTimeOfDay.state.toString.contains("NIGHT") && Group_CO2_Max.state as Number >= 3000  ){
         logInfo("Notification", "Fan max, we run fan on max when we are home and its night and CO2 level is above 3000")
        if (VillaventFan.state as Number !=3) { VillaventFan.sendCommand(3)}
    }


    // Turn fan on max when entering bathroom for 3minutes and its daytime and we are home
    if ( (Presence_Home.state==ON && Bathroom_Scene.state as Number > 0  && vTimeOfDay.state.toString.contains("NIGHT")==false ){
        logInfo("Notification", "Fan Max, Turn fan on max when entering bathroom for 3minutes and its daytime and we are home")
        if (VillaventFan.state as Number !=3) { VillaventFan.sendCommand(3)}
        createTimer(now.plusSeconds(300))[|
            if (VillaventFan.state as Number !=1) { VillaventFan.sendCommand(1)}
        ]
    }

    // Turn fan on max when cooking for 30minutes and its daytime and we are home
    if ( (Presence_Home.state==ON && Livingroom_Scene.state as Number ==7  && vTimeOfDay.state.toString.contains("NIGHT")==false ){
        logInfo("Notification", "Fan Max, Turn fan on max when cooking for 30minutes and its daytime and we are home")
        if (VillaventFan.state as Number !=3) { VillaventFan.sendCommand(3)}
        createTimer(now.plusSeconds(3000))[|
            if (VillaventFan.state as Number !=1) { VillaventFan.sendCommand(1)}
        ]
    }

    
    // we run fan on medium when we are home and its day and CO2 level is above 1000 below 1500
    if  (Presence_Home.state==ON &&  vTimeOfDay.state.toString.contains("NIGHT")==false  && Group_CO2_Max.state as Number >= 1000 && Group_CO2_Max.state as Number < 1500 ){
         logInfo("Notification", "Fan medium, we run fan on medium when we are home and its day and CO2 level is above 1000 below 1500")
        if (VillaventFan.state as Number !=2) { VillaventFan.sendCommand(2)}
    }

    // we run fan on max when we are home and its day and CO2 level is above 1500
    if  (Presence_Home.state==ON &&  vTimeOfDay.state.toString.contains("NIGHT")==false  && Group_CO2_Max.state as Number >= 1500 ){
         logInfo("Notification", "Fan max, we run fan on max when we are home and its day and CO2 level is above 1500")
        if (VillaventFan.state as Number !=3) { VillaventFan.sendCommand(3)}
    }


    // we run fan on medium when we are home and its day and humidty level is above 70%
    if  (Presence_Home.state==ON &&  vTimeOfDay.state.toString.contains("NIGHT")==false  && Group_Humidity_Max.state as Number >= 70  ){
         logInfo("Notification", "Fan medium, we run fan on medium when we are home and its day and humidty level is above 70%")
        if (VillaventFan.state as Number !=2) { VillaventFan.sendCommand(2)}
    }

    // we run fan on medium when we are home and its day and humidity level is below 40%
    if  (Presence_Home.state==ON &&  vTimeOfDay.state.toString.contains("NIGHT")==false  && Group_Humidity_Min.state as Number <= 40 ){
         logInfo("Notification", "Fan max, we run fan on medium when we are home and its day and humidity level is below 40%")
        if (VillaventFan.state as Number !=2) { VillaventFan.sendCommand(2)}
    }


end

Please let me know if you spot any bugs.

I dont see anything wrong.
Does it work? I think there are alot of “if´s”, which kinda makes it hard to tell, when the ventilation actually change state. You could probably optimized this… But I´n not the best to ask for help in this :slight_smile:

You´r Co2 level seems very high. Which unit is beeing used for measuring this? Normally it would be PPM. Anything above 1000 PPM should trigger an alarm in a normal house.

CO2 levels upto 5000 are allowed… so anything below 2500 seems to be fine…

What are safe levels of CO and CO2 in rooms?

CO2

250-350ppm Normal background concentration in outdoor ambient air
350-1,000ppm Concentrations typical of occupied indoor spaces with good air exchange
1,000-2,000ppm Complaints of drowsiness and poor air.
2,000-5,000 ppm Headaches, sleepiness and stagnant, stale, stuffy air. Poor concentration, loss of attention, increased heart rate and slight nausea may also be present.
5,000 Workplace exposure limit (as 8-hour TWA) in most jurisdictions.
>40,000 ppm Exposure may lead to serious oxygen deprivation resulting in permanent brain damage, coma, even death.

A typical outdoor Co2 is about 380PPM. Anything above inside would indicate, the the ventilation inside is not good enough.

It doesnt mean you´ll die as soon as it reach 400PPM. Far from!. But higher level tells you, Co2 is rising, and your ventilation cant keep up… You can wait untill it has reach something higher, but the best way and most optimized way would be to rise the speed of the ventilation when the Co2 value rises.

A device like the Netamo indoor sensor will rise a warning at 1000PPM. This is the same value which is allowed in public offices in Denmark. If the Co2 reach above 1000PPM, (In Denmark) they advice to look at the ventilation cause 1000PPM and above for a longer periode can make you feel dizzy, headache etc… It´s NOT a healty indoor climate above 1000PPM. But it wont kill you either.

So at 1000 I rise vent to medium and max when it goes passed 1500ppm. But you would set it to 800 and 1300ppm?

It depends :slight_smile:

As for the question about whats healty, yes, in my opinion you should focus on levels around 1000PPM, (whether it beeing 800 or 1500 isnt that important, as long as you focus on a specific level, and you are aware about this level, when it´s above, you should pay attention and be prepared to do something).

But… The path your going is very difficult to work with.
You´re doing exactly what I used to do in general for my rule. I also inserted alot of triggering factors into my rules at first, only to discover the vent changed because of one trigger, and caused other/new problems. Ie Co2 might be triggering your vent to higher level, before you even reach the triggering level for Humidity, which can causes other problems, (Low humidity can become a problem cause the building can dry out too much and it will get damaged). A very low humidity isn´t healty for humans either. (Normal humidity is about 30-60% (some say 40-60%).

In our house, if I trigger the vent due to high Co2, we´ll get a very low humidity insted, specially at winter time, where windows are not open as much as in summer times.
I gave up on the Co2, and focused on humidity when it is very high. Triggering on Humidity seems to keep the Co2 level low enough. Only a very few times when we have many guests visiting, the Co2 rise above 1500PPM. Netamo gives me an alarm at 1000PPM, and then I usually open a window/door, cause it´s way faster getting Co2 down, rather than to rise the ventilation. If it´s too cold outside (winter time), I might change the ventilation to full speed insted. It all depends on the situation.

This is mainly to give you an example of how difficult it can be to work and automate with many triggering factors at once…
My best advice is - You should monitor your home and see if you can find the right/best balance of the different measurement and triggering factors which suits your home and your family best… Maybe the best for your home is to trigger then vent at higher Co2 levels, simply to avoid other problems.
But in my opinion 2500PPM seems very high. I would lower this for sure, or maybe not use this trigger at all. I wonder if you ever have seen this high Co2 in your home?? If you havn´t, why use it then? :smiley:

2500 PPM is definitely quite high. For reference, in my (fairly tightly sealed flat), the ventilation is on full all the time when I’m at home (150 M3/hour). If it’s just me at home, the level hovers around 600-700 (I remember because one of the most common values I see is 666 :laughing:). With more people, it goes higher.
Since I got the Awair sensor, I leave the ventilation on for a few hours after I leave, too, to keep the VOC and PM2 levels down. At 2500 PPM I suspect those other pollutants may be at quite high levels.

Gunnar please could you copy code from .items for Villavent and .sitemap and rules?

Hi Kim Skatun, could you copy code with new modbus binding for things, items and sitemap??

Take a look at : https://github.com/skatun/LittleChina/wiki/HVAC

1 Like

What a perfect write up!

Anyone tested using Systemair Internet Access Module (IAM) against the Modbus binding (thus apparently using some Virtual Serial Port Server due to “Modbus TCP to RTU”)?

Have a setup with OpenHabian (Rpi3b+) running for the primary functions of the house, and I am now considering to implement Systemair VSR500 ventilation into OpenHab. A cabled solution between Rpi and VSR (RS485) would be an impractical solution for me, thus evaluating the IAM.

There are WiFi to modus dongle available on Amazon which probably would be cheaper then buying the system air version. You could also run a second rpi and use that one to control the system air. I personally run a 10m phone cable from the system air to my rpi.

Appreciate your response.

Does that mean that a Modbus RTU to WiFi Converter could work with the Modbus binding? Something like (as presented further up in this thread):
https://www.usriot.com/products/modbus-rtu-to-wifi-converter.html

Just a follow up, for future reference:

I ended up with the HF221, and it was pretty much plug and play after connecting to Villavent VSR 500 modbus port, connecting to wifi network and installing/configuring Modbus binding.

3 Likes

@kjoglums What settings do you use for Usermodes? Does it just set fan speed or something else?

@skatun, the user mode selection is just based on a default modbus adr. for my VSR 500, meaning it will just set fan speed according to predefined levels.

The selection widget I have used:
https://community.openhab.org/t/custom-widget-selection/31935/11

I’ve tried to connect my VTR-500 from RJ45 port on main board directly to a USR-TCP232-304 with a cat5e cable using A=pin5 and B=pin4 like shown in post 65 above. No data whatever register I try (seen at least three versions of documents with different registers from SystemAir). Has anyone experienced that other pins work? My VTR-500 is installed in 2014 and does not have the connection box on top.
IMG_0371

The USR TCP232-304 does not support Modbus directly (you would need a TCP232-410 instead).
How are you trying to drive it at this stage?