I have just got a Vera Lite to automate opening and shutting some conservatory roof windows. They are opened using standard 230V window openers.
The previous controller was a simple device which had a thermostat and rain sensor input. the windows would be fully open when the thermostat was hot and fully closed when the thermostat was cold or raining.
The idea of the Vera was to be able to more intelligently open the windows dependant on the outside temperature. Using the Roller Shutter 2 (FGRM-222) would appear to be exactly what was required. Ability to run the motors in both directions and some sort of intermediate opening control. The problem is that the motors won’t pass the calibration process very easily. Maybe 1 out of 15 attempts. When they do get calibrated the motors aren’t reliable enough for the intermediate opening settings to be trusted not to creep around. After a while you can end up with a window that is telling you it is 20% open, yet is 100% open (or shut).
It must be stressed that this is not necessarily a problem with the Roller Shutter 2, more that the window openers have a lot of slack in the gear box, and when the Roller Shutter 2 cuts the power the window opener gearbox runs on for another half a second or so. This adds up over a few intermediate adjustments to a large error.
I have come up with a way of controlling the openers reliably, to enable the windows to be a bit more intelligently controlled. I thought I would share it in the hope that it may help someone else with the same problem to solve, or to see if someone has a better way.
As the intermediate opening values are impossible to trust I have the window close every time, and then re-open with the motors running for a variable amount of time before stopping. In this way the windows can be guaranteed to only be a certain amount open. It does mean that the windows shut briefly first before re-opening, but it is the only way to ensure that the opening is always what you require, and that the slack in the motor/gearbox system hasn’t allowed a significant error to creep in.
I have two Fibaro Window/Door Sensors (FGK-101) with DS18b20 temperature sensors. One of which has the rain sensor connected to the binary input. In this mode you can no longer use it as a door contact, but I never wanted to use it as a door contact anyway.
One sensor measures the outside temperature, one measures the inside temperature. I have two scenes. One closes the window when the temperature is low. One opens the windows when it is hot.
The window openers take approx 13 seconds to either fully open or fully close.
The logic is as follows:
Kitchen becomes cold: Close windows
Kitchen becomes hot:
If raining or 5deg or less outside, close window fully, then run the window opener motors for 2 seconds to allow approx 15% opening for ventilation without risk of rain entering
ElseIf 10deg or less outside, close window fully, then run window openers for 4 seconds to allow approx 30% opening
ElseIf 15deg or less outside, close window fully, then run window openers for 6 seconds to allow approx 45% opening
Else fully open the window
The cold scene has a schedule for sunset + 3hr and a trigger for inside temperature becoming cold. The scene sets the Window Roller shutter to close
The hot scene has a schedule for sun rise and 3 triggers, one for inside becoming hot, one for is raining and one for is not raining. It uses some luup code to intelligently chose the opening the window.
Startup LUUP
function opener(dID)
luup.call_action("urn:upnp-org:serviceId:WindowCovering1", "Up", {action = "Up"} , tonumber(dID))
end
function stopper(dID)
luup.call_action("urn:upnp-org:serviceId:WindowCovering1", "Stop", {action = "Stop"} , tonumber(dID))
end
function closer(dID)
luup.call_action("urn:upnp-org:serviceId:WindowCovering1", "Down", {action = "Down"} , tonumber(dID))
end
function closeopener(dID, delay)
closer(dID)
luup.call_delay('opener', 14, dID)
luup.call_delay('stopper', 14 + delay, dID)
end
Scene LUUP
local outsideTemp = luup.variable_get("urn:upnp-org:serviceId:TemperatureSensor1","CurrentTemperature", 8)
local isRaining = luup.variable_get( "urn:micasaverde-com:serviceId:SecuritySensor1", "Tripped", 3)
outsideTemp = tonumber(outsideTemp)
if (isRaining == "1" or outsideTemp <= 5) then
closeopener(9, 2)
elseif (outsideTemp <= 10) then
closeopener(9, 4)
elseif (outsideTemp <= 15) then
closeopener(9, 6)
else
opener(9)
end
Any feedback would be appreciated.