Posted: Sunday Jan 2nd, 2011 04:07 pm |
|
1st Post |
juwi_uk
Member
back to top
|
Hi
I'm sure its been asked many times but having spent many hours in a "cave" writing ComfortClient code I thought maybe my system needed a little TLC time too over the holidays and realised not as simple in my brain as first thought.
I have Zwave working with my lights. I want to turn the hall lights off automatically after 5 mins if switched on (as most people do in my house do) using the light switch. Save the planet and more importantly my electricty bill!
Possible?
If so can you point me in the right direction. I can see writing a response would work but how can that response be triggered by the physical switch being pressed?
Happy New Year.
Julian
|
Posted: Monday Jan 3rd, 2011 12:34 am |
|
2nd Post |
slychiu
Administrator
Joined: | Saturday Apr 29th, 2006 |
Location: | Singapore |
Posts: | 5500 |
Status: |
Offline
|
back to top
|
Happy New Year Julian
The UCM/Zwave is a one way interface, ie it can control Zwave devices and get its status by polling the device, but commands from Zwave switches cannot trigger Responses. This is a limitation of the Zwave protocol, as it was designed foro simple control by a remote controller.
Perhaps you can turn off your lights using a PIR, base on logic and time, eg if motion is not detected for 10 minutes and etc.. then switch off the lights
|
Posted: Monday Jan 3rd, 2011 03:46 am |
|
3rd Post |
slychiu
Administrator
Joined: | Saturday Apr 29th, 2006 |
Location: | Singapore |
Posts: | 5500 |
Status: |
Offline
|
back to top
|
I was wrong, there is another way you can turn off the lights on Zwave after you have used the Zwave switch to turn on the lights
The light should be mapped to a counter in Comfort during the learning process.
Hence use a timer to check the counter value. If it is ON, ie FF, start another timer to turn off the same light. You can combine with other logic conditions like PIR motion
|
Posted: Monday Jan 3rd, 2011 08:26 am |
|
4th Post |
Posted: Monday Jan 3rd, 2011 09:39 am |
|
5th Post |
juwi_uk
Member
back to top
|
OK what am I doing wrong?
Created response called "HallDownTimerOff" as follows:
If Counter ZWHallDown = 255 Then
Do ZWHallDownOff After 60 Seconds Using Timer20 ! Hall Down Timer
End If
Attached this response to counter "ZWHallDown" response.
Uploaded to Comfort but doesnt work.
Have tested "ZWHallDownOff" seperately and that works fine.
Tried "execute response" in Comfigurator on "HallDownTimerOff" and nothing happens.
In IO Monitor I get this when test in comfigurator:
> LI****
> DA51359206FFC214003C5E00FF
> LI
< LU01
< LR0111
< RA00
< LU00
What am I missing?
Regards
Julian
Last edited on Monday Jan 3rd, 2011 09:41 am by juwi_uk
|
Posted: Monday Jan 3rd, 2011 10:48 am |
|
6th Post |
slychiu
Administrator
Joined: | Saturday Apr 29th, 2006 |
Location: | Singapore |
Posts: | 5500 |
Status: |
Offline
|
back to top
|
The Counter Response is not activated for Zwave
This is because Comfort is polling the mapped zwave module for its value and saving it in the counter. It is not that the Zwave device sends the counter value to Comfort
Comfort polling and updating the counter does not activate the Counter response
You will have to use a separate timer which times out every 10 or 20 seconds and runs the response Halldowntimeroff and starts again
|
Posted: Monday Jan 3rd, 2011 11:55 am |
|
7th Post |
juwi_uk
Member
back to top
|
Hi Chiu,
You've lost me. Are there any examples on the forum on how to do this?
Regards
Julian
|
Posted: Monday Jan 3rd, 2011 12:01 pm |
|
8th Post |
juwi_uk
Member
back to top
|
I understand now.
That said IMHO this is wrong. Surely if you are going to have an event-driven response on a counter then it should fire every time the counter value changes, irrespective of what method changed the counter value.
Regards
Julian
|
Posted: Monday Jan 3rd, 2011 12:33 pm |
|
9th Post |
slychiu
Administrator
Joined: | Saturday Apr 29th, 2006 |
Location: | Singapore |
Posts: | 5500 |
Status: |
Offline
|
back to top
|
I understand the confusion
The principle operating is the same as the KNX and Cbus interfaces which are two way, ie Cbus and KNX can control Comfort via Counter Responses, but in this case Zwave cannot do so
Lets consider the case of Cbus. When a Cbus button is pressed, it sends a value to the mapped counter and triggers a Counter Response
However when Comfort sends a message to Cbus, say to turn on the light, it also changes the counter value to FF. However in this case, it does not trigger the counter response again because that may cause a duplicate action, ie cause something which you may not want to happen in the other direction.
eg a Cbus switch causes Comfort to switch on a number of devices. If the command goes the other way from Comfort to Cbus, should this cause the same thing to occur?
That is the historical reason for this behaviour, that counter responses are activated by incoming counter changes only. However it may be that this may not be the correct or the best way to handle it, and that the Counter response should be activated in both ways. I am not sure also that if such a change were made that it may affect existing programs and cause different behaviour. It is certainly something to consider
|
Posted: Monday Jan 3rd, 2011 12:40 pm |
|
10th Post |
juwi_uk
Member
back to top
|
Chiu,
Do you have an example of how I can get to work right now?
If I'm understanding correctly I need some sort of perpetual timer running. So I run ResponseA which at the end of countdown starts ResponseB which does the payload and then starts ResponseA again. Is this the way it works? I guess I need to hook the ResponseA to something then to start it the first time.
Any help appreciated.
Regards
Julian
Last edited on Monday Jan 3rd, 2011 12:40 pm by juwi_uk
|
Posted: Monday Jan 3rd, 2011 01:01 pm |
|
11th Post |
slychiu
Administrator
Joined: | Saturday Apr 29th, 2006 |
Location: | Singapore |
Posts: | 5500 |
Status: |
Offline
|
back to top
|
The response can be like
Response A:
Do Response A after 10 seconds using Timer X
Do Response HallDownTimerOff
Response A gets called every 10 seconds, and it checks the counter. This is safe, it does not cause anb endless loop
You can call Response A from the Startup Response or from any suitable event like the Home Control Menu.
You can also program the home control menu to stop the timer in case you want to disable this, like when you are having a party
|
Posted: Monday Jan 3rd, 2011 04:10 pm |
|
12th Post |
juwi_uk
Member
back to top
|
That's now working. Many thanks for the pointers.
Regards
Julian
|
|