Closed pergolafabio closed 2 years ago
Sorry, I don't have a rain sensor. Therefore I do not know how this is queried.
np, i can try out , but i think i need to send this command? GW_GET_LIMITATION_STATUS_REQ
tried script below, but it gives an error
any idea? not sure how i need to send that command, quite new to this ...
'use strict'
const velux = require('velux-klf200-api')
velux.on('NTF',(data)=>{
console.log(data)
})
velux.connect('192.168.0.18',{})
.then(()=>{
return velux.login('xxx')
})
.then((data)=>{
return velux.sendCommand({ api: velux.API.GW_GET_LIMITATION_STATUS_REQ })
})
.then((data)=>{
console.log(data)
})
.catch((err)=>{
console.log(err)
return velux.end()
})
To query the position of a window, the home monitor must be started. Maybe that's the problem here too.
the home monitor is started,if i send other commands like this : GW_GET_VERSION_REQ , i get valid output its because i am also running Home Assistant, that enables the home monitor
i am just not sure how to send those limitation commands
GW_GET_LIMITATION_STATUS_REQ has parameter, the call is: return velux.sendCommand({ api: velux.API.GW_GET_LIMITATION_STATUS_REQ , commandOriginator: [int], priorityLevel: [int], indexArrayCount: [int], indexArray: [array of int], parameterID: [int], limitationType: [int] }
was trying this command :
return velux.sendCommand({ api: velux.API.GW_GET_LIMITATION_STATUS_REQ , commandOriginator: 1, priorityLevel: 2, indexArrayCount: 1, indexArray: 1, parameterID: 0, limitationType: 0 })
but gives me :
any idea? probably something wrong with the command array maybe? sorry , quite new to this
also, if i look in manual, you are talking about a commandoriginator and prioritylevel? i dont see that? is it possible that your parameters were wrong?
I dont know.
ok, last question then
how do i need to write this?
indexArrayCount: [int], indexArray: [array of int],
for example :
indexArrayCount: 2, indexArray: [1,2]
is that a valid syntax?
There is an issue in the file klf.js: In line 2002 "27" have to replace with "25"
@bergstermann Ah, do you have it working? Can you show your code?
I´m using it in node red.
But you have to send the command right? How is your command?
The parameter in node red:
{"sessionID":1,"indexArrayCount":1,"indexArray":[0],"parameterID":0,"limitationType":1}
There is an issue in the file klf.js: In line 2002 "27" have to replace with "25"
Fixed
Ok, thnx for this, gonna try this later
Hey @bergstermann , i was not able to test yet... Have you been able too? What are the values when it's raining/ not raining? Did it also update when the windows was in a closed state?
It works. 7 percent ist the limitation of window opening by rain. When the window is closed, the limitation is also sent.
Cool, do you also use Home Assistant?
No Redmatic on Homematic CCU3
Is 7, is that the value of the ventilation mode? So it only opens to 7% ?
In my case , when it's raining and the windows are closed, then I can't open them, also not in ventilation mode
Do you read out the minvalue ?
Yes, 7% ist the ventilation mode. LimitationType 0
And what is the limitationtype when it's raining? I have heard , if it's NOT 0 , then it means it's raining
i have found another github, with python programming, so i am using that one now :)
Hi @PLCHome
can you help me out with a sample script to retrieve the rain sensor state? it should be available in the
Seems if the Minvalue !=0 , then its raining
thnx , appreciated!!