Integrating control of my Velux windows into Domoticz

In this subforum you can show projects you have made, or you are busy with. Please create your own topic.

Moderator: leecollings

User avatar
StanHD
Posts: 347
Joined: Friday 12 July 2013 16:09
Target OS: Windows
Domoticz version:
Location: East Sussex, UK
Contact:

Integrating control of my Velux windows into Domoticz

Post by StanHD »

Hi All,

Velux windows operate under a system called "ioHomecontrol". Although this is incompatible with the rfxtrx433, they also offer an interface that can instruct the basic functions by using 2 simple digital on/off inputs. (Velux klf 100).

A pulse to 1 input closes, the other opens, and both together stops.

My question is does anyone know of a usb connected relay board that I can control via domoticz? This way I could locate the board and interface local to my nuc and broadcast instructions via the Velux interface.

My system: Domoticz running under Windows on nuc.

Thanks
Domoticz Main - Intel nuc, Windows, RFXTRX433E. Lan Relay Boards, Aeon Z-Stick Gen 5, Evohome HGI80, Milight WiFi, MySensors Ethernet Gateway, Harmony Hub
Python:- Broadlink RM2, Sonos
HA-Bridge - Amazon Echo / Alexa
leplan73
Posts: 4
Joined: Sunday 31 August 2014 22:36
Target OS: Linux
Domoticz version:
Contact:

Re: Integrating control of my Velux windows into Domoticz

Post by leplan73 »

I'm working on the support of Yoctopuce USB actuators (i.e. relay) and sensors. I have submitted a first patch to the authors.
User avatar
StanHD
Posts: 347
Joined: Friday 12 July 2013 16:09
Target OS: Windows
Domoticz version:
Location: East Sussex, UK
Contact:

Re: Integrating control of my Velux windows into Domoticz

Post by StanHD »

I decided to bite the bullet an ordered one of these:

http://www.robot-electronics.co.uk/htm/eth008tech.htm

Will report back how it goes. Image
Domoticz Main - Intel nuc, Windows, RFXTRX433E. Lan Relay Boards, Aeon Z-Stick Gen 5, Evohome HGI80, Milight WiFi, MySensors Ethernet Gateway, Harmony Hub
Python:- Broadlink RM2, Sonos
HA-Bridge - Amazon Echo / Alexa
simonrg
Posts: 329
Joined: Tuesday 16 July 2013 22:54
Target OS: Raspberry Pi / ODroid
Domoticz version: 3.8807
Location: North East England
Contact:

Re: Integrating control of my Velux windows into Domoticz

Post by simonrg »

Looks interesting device, not quite sure how you are going to use it with ioHomecontrol.

I guess you are going to use the ETH008 to control the KLF100, and connect to Domoticz by sending http commands to the ETH008.

The Velux documentation takes you in details through particular operations, without really giving an overview of what the device can do, so as with much of the Velux documentation, having read the KLF100 instructions I am not sure how many devices it can connect to or quite how to connect to it. It looks like it should be able to open / close all my blinds as 1 group, but almost implies if I want to control by windows as well, then I need to buy another KLF100. Am I missing something?

My plan is to take a ioHomecontrol relay apart and wire it up to PiFace in order to control directly from Domoticz/Raspberry Pi, a bit cludgey as you need to press buttons multiple time in order to navigate menus and obviously only feedback is on the remote control screen. I haven't yet quite worked out whether I can get away with using simple outputs on the PiFace or whether I need to use the relays, which would limit me to 2 buttons.
Raspberry Pi 2 B - 2A@5V PSU - Raspbian + Domoticz + RFXtrx(89), LightwaveRF House(dimmers, sockets, wireless/mood switches), Owl CM113, 4 LaCross Temp / Humidity Sensors, 4 Siemens PIR, Smappee, Solaredge, ESP8266
User avatar
StanHD
Posts: 347
Joined: Friday 12 July 2013 16:09
Target OS: Windows
Domoticz version:
Location: East Sussex, UK
Contact:

Re: Integrating control of my Velux windows into Domoticz

Post by StanHD »

My idea is indeed to use the klf-100. I think you are right, and from my research this will only control 1 group. In my case this is fine as my Velux are both in one high vaulted room and we always operate as a group. Also in the same room we have a reversible ceiling fan that we have installed for both cooling in one direction and de-stratification in the other. The supplied rf remote does not play with the RFXTRX433, so I have obtained a second remote control which I have torn apart, and similar perhaps to your idea, I will solder wires to the required tracks. Using low level, high level, and outside temperature sensors, I might try a simple control script / blocky to automate the component actions. For example, outside temp > x = open Velux. Or maybe control the de-stratification fan using the temperature differences of the internal sensors. Either way it should all be great fun.
Domoticz Main - Intel nuc, Windows, RFXTRX433E. Lan Relay Boards, Aeon Z-Stick Gen 5, Evohome HGI80, Milight WiFi, MySensors Ethernet Gateway, Harmony Hub
Python:- Broadlink RM2, Sonos
HA-Bridge - Amazon Echo / Alexa
simonrg
Posts: 329
Joined: Tuesday 16 July 2013 22:54
Target OS: Raspberry Pi / ODroid
Domoticz version: 3.8807
Location: North East England
Contact:

Re: Integrating control of my Velux windows into Domoticz

Post by simonrg »

All sounds good, just not going to be cheap with the KL100 @ £100 and the ETH008 @ £50.

Looking forward to hearing how it all goes.
Raspberry Pi 2 B - 2A@5V PSU - Raspbian + Domoticz + RFXtrx(89), LightwaveRF House(dimmers, sockets, wireless/mood switches), Owl CM113, 4 LaCross Temp / Humidity Sensors, 4 Siemens PIR, Smappee, Solaredge, ESP8266
User avatar
StanHD
Posts: 347
Joined: Friday 12 July 2013 16:09
Target OS: Windows
Domoticz version:
Location: East Sussex, UK
Contact:

Re: Integrating control of my Velux windows into Domoticz

Post by StanHD »

Progress Update:-

Got the Relay board, connected the ethernet, gave it 12v DC, instantly available via "http://eth008"
Checked the default config and for now switched off the HTTP Authentication.
Tested the relays from the on-board webapp, all working :)
Next I fixed the IPA address.
Upgraded the firmware using the provided (download) updater to V5. This allows ASCII:-

ASCII text commands DOA and DOI (V4+ firmware needed)
Following customer request we have added a feature that allows the outputs to be switched using an ASCII string, devices like a Mobotix camera can now switch relays with simple strings.
The string for activating output1 for 5 seconds is formatted using comma seperated variables with the following syntax:
":DOA,1,50,password"
To break this down ":" (hex 3A) at the start of the string indicates that there is an ASCII message to follow, "DOA" is digital output active, "1" is the output number, then "50" for 5 seconds (50x100ms) and finally the TCP password (if applicable).
If I wanted to make output 2 inactive for 3 seconds I would use:
":DOI,2,30,password"
To break this down ":" (hex 3A) at the start of the string indicates that there is an ASCII message to follow, "DOI" is digital output inactive, "2" is the output number, then "30" for 3 seconds (30x100ms) and finally the TCP password (if applicable).
Assuming no password is used the previous command would simply be:
":DOI,2,30 "


Now for Domoticz:-

Image

Image

Works perfectly :D

Have already tested with the ceiling fan temporarily connected. The KLF 100 (Velux Interface) just arrived today, and I have just ordered an enclosure.

Will report more progress soon.
pascalspits
Posts: 88
Joined: Tuesday 24 February 2015 16:14
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Belgium
Contact:

Re: Integrating control of my Velux windows into Domoticz

Post by pascalspits »

Is there a way to detect the status of the relays on the ETH008 ?
when I make a dummy switch in Domoticz (like you did, above here) I can control the relay with it, no problem, but without any feedback ...
although when switch on 1 relay with Domoticz and then I open the URL application of the ETH008 I can see that this channel is already switched on, it seems to get this feedback
this lets me conclude that there might be a way of detecting/reading the state of the relays as well ...
wouldn't it be cool to have Domoticz also know this state ?
how could this be done ?

Digital Active/Inactive
This is a 3 byte command:
The first byte is the command, 32 (active means on) or 33 (inactive).
Second byte is the relay number (1-8).
Third byte is the on time. Set this to zero for un-timed operation, or 1-255 for a pulse in 100mS intervals (100mS to 25.5 seconds).
For example:
0x20 - turn the relay on command
0x03 - relay 3
0x32 (50) - 5 seconds (50 * 100ms)
Board will return 0 for success, 1 for failure
Note - All bytes in a command must be sent in one TCP/IP packet .


I'm just a newbie in this, so hoping there are smart people who can help ...
RasPi2 - Aeotec Z-Stick S2 - Fibaro multisensors - Fibaro RGBW dimmers - ETH08 relais boards
nigels0
Posts: 221
Joined: Thursday 23 January 2014 12:43
Target OS: Raspberry Pi / ODroid
Domoticz version: 3.8153
Contact:

Re: Integrating control of my Velux windows into Domoticz

Post by nigels0 »

Any update on connecting the kLF100 to the eTH008? Just about to bite the bullet myself. I have 4 velux integra windows which I want to control as a group - both the window opening and the blinds - from what I read above, I need two KLF100s?
User avatar
StanHD
Posts: 347
Joined: Friday 12 July 2013 16:09
Target OS: Windows
Domoticz version:
Location: East Sussex, UK
Contact:

Re: Integrating control of my Velux windows into Domoticz

Post by StanHD »

Hi, I can confirm that my Velux windows work great with the KLF100 and ETH008

I have 2 windows in the same room, therefore operate them as a group with the KLF100.

Here's what works for me:-

1. Add dummy push-on switches for each "mode" with a 5s Off Delay setting e.g:- "Open", "Close", "Stop"

Image

Address each switch to a relay on the ETH008 e.g.:

I use the HTTP Command:

Relay 1 = "Open". http://192.168.0.33/io.cgi?DOA7 in the On Action of the switch, and http://192.168.0.33/io.cgi?DOI7 in the Off Action of the switch
Relay 2 = "Close". http://192.168.0.33/io.cgi?DOA8 in the On Action of the switch, and http://192.168.0.33/io.cgi?DOI8 in the Off Action of the switch

The "Stop" Switch has no commands, just an Off Delay of 5s

2. Using the diagram provided with the KLF100, Connect the N.O. Contacts of Relays to the terminals on the KLF100.

3. I make another Dummy switch like this:-

Image

4. I set the operating modes with a Blockly like this:
Image

So when "Open" or "Close" is selected, the relevant switches operate the relays which set the mode of the Velux Windows. Unfortunately I have to use the separate "Stop" button as I do not know how to do it using the pre-defined "Stop" function available in the other Domoticz Switch. (If anyone knows how please let me know :) )

5. Finally, I have made a control Blockly to "Automate" the windows on hot days:-

Image

Hope this helps a bit. I am sure there are more elegant ways to do this with a script, but that would be beyond my skills. :D

Stan
Domoticz Main - Intel nuc, Windows, RFXTRX433E. Lan Relay Boards, Aeon Z-Stick Gen 5, Evohome HGI80, Milight WiFi, MySensors Ethernet Gateway, Harmony Hub
Python:- Broadlink RM2, Sonos
HA-Bridge - Amazon Echo / Alexa
nigels0
Posts: 221
Joined: Thursday 23 January 2014 12:43
Target OS: Raspberry Pi / ODroid
Domoticz version: 3.8153
Contact:

Re: Integrating control of my Velux windows into Domoticz

Post by nigels0 »

Stan

Thanks - really useful and comprehensive. I have four windows and will have them all as a group. Is it true then I'd need another kLF100 to handle the blind opening and closing for all 4 windows in the group operating together?
User avatar
StanHD
Posts: 347
Joined: Friday 12 July 2013 16:09
Target OS: Windows
Domoticz version:
Location: East Sussex, UK
Contact:

Re: Integrating control of my Velux windows into Domoticz

Post by StanHD »

nigels0 wrote:Stan

Thanks - really useful and comprehensive. I have four windows and will have them all as a group. Is it true then I'd need another kLF100 to handle the blind opening and closing for all 4 windows in the group operating together?
You are welcome.

I don't have blinds, so i am not sure, but yes, I think you would need another klf100.
Domoticz Main - Intel nuc, Windows, RFXTRX433E. Lan Relay Boards, Aeon Z-Stick Gen 5, Evohome HGI80, Milight WiFi, MySensors Ethernet Gateway, Harmony Hub
Python:- Broadlink RM2, Sonos
HA-Bridge - Amazon Echo / Alexa
nigels0
Posts: 221
Joined: Thursday 23 January 2014 12:43
Target OS: Raspberry Pi / ODroid
Domoticz version: 3.8153
Contact:

Re: Integrating control of my Velux windows into Domoticz

Post by nigels0 »

Just got the ETH008 and used your blocky and switches - didn't work though. Checked from the browser and was fine - so had to be password issues - so changed the script to http:admin:[email protected]/io.cgi?DOA7=50 etc.) and all was fine. Note I decided not to use explicit on/off actions - rather let the board handle the switch off just to remove one possible fault with the ETH008 not receiving the off trigger (hence the =50 at the end).
User avatar
StanHD
Posts: 347
Joined: Friday 12 July 2013 16:09
Target OS: Windows
Domoticz version:
Location: East Sussex, UK
Contact:

Re: Integrating control of my Velux windows into Domoticz

Post by StanHD »

Ahh yes, I remember now, I turned off the password bit. If you come up with any better / different control methods, please share as you have done above. Nice to know I'm not the only one doing this ;)
Domoticz Main - Intel nuc, Windows, RFXTRX433E. Lan Relay Boards, Aeon Z-Stick Gen 5, Evohome HGI80, Milight WiFi, MySensors Ethernet Gateway, Harmony Hub
Python:- Broadlink RM2, Sonos
HA-Bridge - Amazon Echo / Alexa
nigels0
Posts: 221
Joined: Thursday 23 January 2014 12:43
Target OS: Raspberry Pi / ODroid
Domoticz version: 3.8153
Contact:

Re: Integrating control of my Velux windows into Domoticz

Post by nigels0 »

Well I changed the blocky to lua - that allowed me to remove a number of dummy switches. There is an outstanding issue with LUA which doesn't recognise 'Stopped', I have the code in there, but it doesn't work, so I have to keep the two Stopped dummy switches for now.

--script_device_velux.lua
--
--Works with two Velux KLF-100s to control both the Window open/close and the Blind up/down
--

commandArray = {}
if (devicechanged['Velux Windows'] == 'Open') then
os.execute('curl http://admin:[email protected]/io.cgi?DOA7=50')
elseif (devicechanged['Velux Windows'] == 'Stopped') then
os.execute('curl http://admin:[email protected]/io.cgi?DOA7=50')
os.execute('curl http://admin:[email protected]/io.cgi?DOA8=50')
elseif (devicechanged['Velux Windows'] == 'Closed') then
os.execute('curl http://admin:[email protected]/io.cgi?DOA8=50')
end
if (devicechanged['Velux Blinds'] == 'Open') then
os.execute('curl http://admin:[email protected]/io.cgi?DOA5=50')
elseif (devicechanged['Velux Blinds'] == 'Stopped') then
os.execute('curl http://admin:[email protected]/io.cgi?DOA6=50')
os.execute('curl http://admin:[email protected]/io.cgi?DOA5=50')
elseif (devicechanged['Velux Blinds'] == 'Closed') then
os.execute('curl http://admin:[email protected]/io.cgi?DOA6=50')
end
if (devicechanged['Velux Blind Stop'] == 'On') then
os.execute('curl http://admin:[email protected]/io.cgi?DOA6=50')
os.execute('curl http://admin:[email protected]/io.cgi?DOA5=50')
elseif (devicechanged['Velux Windows Stop'] == 'On') then
os.execute('curl http://admin:[email protected]/io.cgi?DOA7=50')
os.execute('curl http://admin:[email protected]/io.cgi?DOA8=50')
end
--print(devicechanged['Velux Windows'])
return commandArray
nigels0
Posts: 221
Joined: Thursday 23 January 2014 12:43
Target OS: Raspberry Pi / ODroid
Domoticz version: 3.8153
Contact:

Re: Integrating control of my Velux windows into Domoticz

Post by nigels0 »

Well I got the two KLF-100 units connected to the ETH008 and programming the KLF-100 proved difficult; I had to de-register the windows and blinds as the KLF-100 did not 'see' them as they were registered to a remote control. Once I registered the windows and blinds to the KLF-100, I selected only the windows and they open and close exactly as planned. I then copied the config to the second KLF-100 and selected only the blinds - and they work fine too.
User avatar
StanHD
Posts: 347
Joined: Friday 12 July 2013 16:09
Target OS: Windows
Domoticz version:
Location: East Sussex, UK
Contact:

Re: Integrating control of my Velux windows into Domoticz

Post by StanHD »

That's good. I think I used the "copy" routine from the existing remotes to register my KLF100.
Domoticz Main - Intel nuc, Windows, RFXTRX433E. Lan Relay Boards, Aeon Z-Stick Gen 5, Evohome HGI80, Milight WiFi, MySensors Ethernet Gateway, Harmony Hub
Python:- Broadlink RM2, Sonos
HA-Bridge - Amazon Echo / Alexa
simonrg
Posts: 329
Joined: Tuesday 16 July 2013 22:54
Target OS: Raspberry Pi / ODroid
Domoticz version: 3.8807
Location: North East England
Contact:

Re: Integrating control of my Velux windows into Domoticz

Post by simonrg »

Related question, I have 7 Velux solar blinds and 3 Velux electrically controlled windows, how many KLF-100s would I need to control them all?
Raspberry Pi 2 B - 2A@5V PSU - Raspbian + Domoticz + RFXtrx(89), LightwaveRF House(dimmers, sockets, wireless/mood switches), Owl CM113, 4 LaCross Temp / Humidity Sensors, 4 Siemens PIR, Smappee, Solaredge, ESP8266
nigels0
Posts: 221
Joined: Thursday 23 January 2014 12:43
Target OS: Raspberry Pi / ODroid
Domoticz version: 3.8153
Contact:

Re: Integrating control of my Velux windows into Domoticz

Post by nigels0 »

You need one KLF-100 per group - so if you wanted to control all individually, you'd need 10 - but if you grouped some(or all) of the windows together and the same with the blinds - then you'll need just 2.And any other combination in between of course.
User avatar
StanHD
Posts: 347
Joined: Friday 12 July 2013 16:09
Target OS: Windows
Domoticz version:
Location: East Sussex, UK
Contact:

Re: Integrating control of my Velux windows into Domoticz

Post by StanHD »

Yep, that's exactly right
Domoticz Main - Intel nuc, Windows, RFXTRX433E. Lan Relay Boards, Aeon Z-Stick Gen 5, Evohome HGI80, Milight WiFi, MySensors Ethernet Gateway, Harmony Hub
Python:- Broadlink RM2, Sonos
HA-Bridge - Amazon Echo / Alexa
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest