Author |
|
Deano Groupie
Joined: February 19 2003 Location: United States
Online Status: Offline Posts: 75
|
Posted: June 11 2004 at 13:27 | IP Logged
|
|
|
I am trying to get a light to go to 85% on a palm pad triger on G4on and then go to match the level of another light with a trigger on G4OFF.
I' using SendKeys in Triggers:
G4ON ph_x10btn("G",4,100,85)
G4OFF ph_x10btn("G",4,100,[X10LEVELG6])
When [X10LEVELG6] = 0, or if I substitute 0 in the function, X10status reports dimmed to 3 but the light looks more like it is at 20 - 30 %.
I pulled the plug on my "DIM eating TVs" and got the same result.
BTW, I am running this discussion forum from within power home and 0 from function results are showing up in the text.
Like this 0000 - that was due to G4ON, G4OFF, G4ON, G4OFF - How cool is that.
|
Back to Top |
|
|
dhoward Admin Group
Joined: June 29 2001 Location: United States
Online Status: Offline Posts: 4447
|
Posted: June 11 2004 at 13:58 | IP Logged
|
|
|
Deano,
The first thing is you probably want to change from using "Sendkeys" to "Formula" in your trigger. That is why you are getting the 0's showing up in your post. A "Sendkeys" is a formula that is evaluated and the result is then sent as keystrokes to the application with focus. Sometimes, this is a desired result, but in this case, I don't think thats what you want.
Reading your post and seeing what you are doing...I might have mislead you in my earlier post concerning the dimpercent. While this value in no way affects how the controller actually sends dim values, it will play a part in the number of "dim" commands sent from PowerHome to the controller. When you specify a level to PowerHome, it checks the dimpercent value and calculates how many dim commands need to be sent for that particular controller to achieve the desired level. I guess what Im trying to clear up is that each individual controller will dim a certain percentage when a single "dim" command is issued to it (not able to be controlled by PowerHome). This value varies per controller which is why we have the dimpercent parameter. PowerHome does use this value however to determine how many "dim" commands need to be sent to the controller to achieve a certain level.
In any event, it sounds as if the dimpercent needs to be adjusted in your case. What controller are you using? If you are using a CM11A, then you have probably found that there is no dimpercent for this controller. The CM11A dim command allows you to specifiy a value from 1 to 21 meaning that there are only 21 increments available. This equates out to a dimpercent of roughly 4.76%. Since the CM11A is unique in its handling of dim commands, this value is hardcoded. Most other controllers have a single dim command that dims a certain percentage and to achieve a desired level you just have to repeat the single dim command X number of times.
Another question...using the same controller, do all your lights seem to respond the same amount? Or do some lights seem to get dimmer than others?
Dave.
|
Back to Top |
|
|
Deano Groupie
Joined: February 19 2003 Location: United States
Online Status: Offline Posts: 75
|
Posted: June 12 2004 at 09:05 | IP Logged
|
|
|
Dave,
I am using a CM11A and although it is difficult to analyze due to different ambient conditions and fixture design, I think that they all dim about the same.
Some more testing with a different lamp/lamp module.
ph_x10btn("F",14,100,18/21*100) results in 86
ph_x10btn("F",14,100,0) results in 5
Could this be the classic off by one error?
G4 does appear to be slightly brighter at 5% than F14
Tried ph_x10btn("F",14,100,-5) but it won't execute so I can't do linear interpolation to fix problem.
|
Back to Top |
|
|
dhoward Admin Group
Joined: June 29 2001 Location: United States
Online Status: Offline Posts: 4447
|
Posted: June 12 2004 at 09:55 | IP Logged
|
|
|
Dean,
A couple more tests to perform to rule out problems with the ph_x10btn function:
ph_x10(1,"F",14,0) + ph_x10(1,"F",104,95)
The above test should be run after the light is first turned on before any other dims are sent. This should dim the light down to 5% and PowerHome should reflect close to same for the status.
Also, run the ph_x10btn("F",14,100,5) function. Again, try this immediately after the light is first turned on with no dims sent to it. This should also dim the light to about 5% and the level should appear to be the same as the test above.
The absolute dimming feature of the ph_x10btn function is reliant upon the correct current status. How it works is that the current status (as recorded by PowerHome) is checked. The status that you wish to go to is then subtracted from this status. If the result is positive, DIM commands will be sent. PowerHome calculates the number of dims by dividing the difference by the dimpercent. If the result is negative, BRIGHT commands will be sent. The ABS of the difference is then divided by the dimpercent and that many bright commands are sent.
As you can see, with each calculation, there will be a rounding error. Also, over time due to occasional "eaten" commands and the not completely accurate calculations, the actual status and the PowerHome status will drift apart resulting in error. The only way to really bring it back into alignment is to occasionally turn the light off (Actual status and PowerHome status are 0%). This was my attempt at achieving something similar to the absolute dimming the more expensive modules have.
Let me know how the above tests go and I'll run some down here as well. I won't be able to use a CM11A but might be able to uncover a way to minimize errors while using my Powerlinc. It may turn out that I have to provide some kind of "fudge" factor for the CM11A.
Also, as you've found out, the ph_x10btn function only accepts values from 0 to 100 for absolute dimming. You could followup a ph_x10btn("F",14,100,0) command (to dim a light to 0) with a ph_x10(1,"F",104,20) command to dim an extra 20%. This will also have the effect of "synchronizing" PowerHome to actual since the light should be fully dimmed (you could change the 20 to 100 to make absolutely sure ) and PowerHome will reflect a status of 0.
Dave.
|
Back to Top |
|
|
dhoward Admin Group
Joined: June 29 2001 Location: United States
Online Status: Offline Posts: 4447
|
Posted: June 12 2004 at 10:11 | IP Logged
|
|
|
Don,
Since my last post and a little bit of initial testing, one of the things Im going to add for the next version is that when doing absolute dimming or brightening in the ph_x10btn function is to add some extra dim/bright commands when the level value is either 0 or 100. This should have the effect of "synchronizing" if the light isn't vastly off.
Dave.
|
Back to Top |
|
|
Dean Senior Member
Joined: August 21 2003 Location: United States
Online Status: Offline Posts: 109
|
Posted: December 27 2004 at 00:19 | IP Logged
|
|
|
Dave,
I've read and re-read this thread on DIM'ing, but I can't seem to get things working properly.
I have a 2-way SmartHome LampLinc module which is supposed to have 32 different fading on/off rates and on-levels.
http://www.smarthome.com/2000s.html
Also the manual is located in PDF here:
PDF Manual
Basically, what I am trying to do in a macro is to record the current DIM level (ph_getx10level( "A", 5 )) of the LampLinc module in a [GLOBAL05] variable, then dim the module to some percent, say 50% (ph_x10btn("A",5,100,50)). Then, in another macro, I restore the recorded DIM level (ph_x10btn("A",5,100,[GLOBAL05])).
I am not achieving proper DIM'ness of the module. If I start out with the lamp on full/100% and do the ph_x10btn("A",5,100,50) command, the lamp hardly DIMs at all.
I am using the CM11A controller.
Have you used any of these modules?
Thanks,
-Dean
|
Back to Top |
|
|
dhoward Admin Group
Joined: June 29 2001 Location: United States
Online Status: Offline Posts: 4447
|
Posted: December 28 2004 at 17:13 | IP Logged
|
|
|
Dean,
I have never used any of the LampLinc modules . I did bring up the manual I checked through it and see that it has some non-standard features that PowerHome will not directly support.
First, even though they say this is a two-way module (it does support the status request command), it does not support extended dim commands. So, the first thing you will want to check is that the X-10 type you have selected for this module does not have the extended commands option checked. Next, you'll want to check the eventlog and see what is actually being sent to the CM11A when you execute your ph_x10btn("A",5,100,50) command when the light is at 100%. Also, check that the light dims properly when using the internal palm pad control. Count how many times you must press the dim button on the palm pad control until the light is fully dimmed. Half of that should be roughly 50% dim and this is the level that should be reached.
One of the things the manual said, is that the light support 32 individual levels of dim. The CM11A will send out only 21 individual levels. This may be causing problems, but Im not sure. One test, you'll want to try is the following formula: ph_x10(1,"A",5,0) + ph_x10(1,"A",104,100). Execute this formula when the light is at full brightness. The light should dim down to 0% or pretty close. If not, then it's possible that interference is eating some of the dim commands. I would try moving the module to different sockets to rule this possibility out.
After going through the manual a couple of times, it's difficult to determine if the unit supports the X-10 "preset-dim" commands. I know the unit has scene support and supports preset-dim levels, but was unable to ascertain if the older X-10 preset dim command was supported. To test this feature out, try the following formula: ph_x10(1,"A",5,0) + ph_x10(1,"PRESET DIM",316,0). If this module supports "preset dims", then the light should go to about 50% dim. If this works, then you wont want to use the ph_x10btn command as this command only supports standard dimming and extended dimming.
Let me know how your testing goes.
Dave.
|
Back to Top |
|
|
Dean Senior Member
Joined: August 21 2003 Location: United States
Online Status: Offline Posts: 109
|
Posted: December 28 2004 at 23:18 | IP Logged
|
|
|
Dave,
OK, let's see here. I double checked the X-10 type for the module I am using for the LampLinc and the extended command is not checked. The six options to the left of extended are checked; extended, memory and status only are not checked.
When I execute ph_x10btn("A",5,100,50) in a macro when the light is at full brightness, the following is displayed in the event log, but, the light does not appear to dim at all:
X-10 controller 1 transmission of House code: A, Command: Dim, Dim/Bright: 50
It takes 32 presses of the Dim button on the internal PowerHome PalmPad to completely turn off the light.
When I issues ph_x10(1,"A",5,0) + ph_x10(1,"A",104,100) in a macro as a formula, the light does not appear to do anything, but the X10 status in PowerHome does show the level as Dimmed 0. Even entering a value in the X10 status screen of 0 and pressing ADim for the light does not appear to do anything. I'm not sure if moving the module somewhere else would help since using the PowerHome PalmPad and hitting Dim 32 times did turn the module off.
The ph_x10(1,"A",5,0) + ph_x10(1,"PRESET DIM",316,0) command does dim the light and according to PowerHome's X-10 status, it shows 48. But, if I am reading the help file correctly, changing 316 to 300, 303, 345 or anything else always always produces the same result. X-10 status window shows 48 for this module. I've even managed to screw up the CM11A where I had to stop PowerHome and restart to get things working again using ph_x10(1,"A",5,0) + ph_x10(1,"PRESET DIM",345,0), you can substitute 345 for other values that also cause this problem. I guess I am not too sure how this PRESET DIM command works even after reading the help file. Should I only be using 300 to 331 for this module if it has 32 preset DIM levels?
So, what have I learned from all this testing? That I have a lot to learn about PowerHome and X-10. This may not bode well for you Dave.
Thanks,
-Dean
|
Back to Top |
|
|
dhoward Admin Group
Joined: June 29 2001 Location: United States
Online Status: Offline Posts: 4447
|
Posted: December 29 2004 at 00:26 | IP Logged
|
|
|
Aaggghhh, Dean, you're killing me .
Seriously, I think we've learned a lot. First, based upon the manual and your tests, I would set the X-10 Types up so that you also have "Memory" checked since the manual states that it will resume the last dim level when turned on.
Next, the proper range of values for the PRESET DIM command is 301 to 332 for a total of 32 dim levels. This has nothing to do with your lamplinc and is the X-10 standard for preset dim commands. Anything outside of this range (300 or greater than 332) will result in PowerHome locking up (I probably should do range checking but left the extra if's off for speed).
Since the internal palmpad is working, it's obvious that it is responding to standard dim commands as well. However, it seems to have a problem with the dims coming at it too fast. The way the CM11A works is that you tell it how much to dim the light by passing it a number from 1 to 21 with 21 being fully dimmed. The CM11A then internally sends the DIM command on the PowerLine repeatedly until it thinks the appropriate level is reached. Unfortunately, I have no control over the rate at which the CM11A sends the DIM commands to the powerline. When you use the internal palmpad, each time you press the "dim" key, you are essentially telling the CM11A to dim with "1" and it sends a single (actually in powerline protocol I believe it's two) dim command to the powerline so the delay is built in.
Now, I remember from another thread, you stated that you had boosters and/or repeaters. If memory serves correctly, these can play havoc with dim/bright commands.
I just did a quick google search and came across this thread:
http://groups-beta.google.com/group/comp.home.automation/browse_thread/thread/2999bf6044509580/53a6b6edd1c4d500?q=%22x-10%22+dim+repeater+problem&_done=%2Fgroups%3Fq%3D%22x-10%22+dim+repeater+problem%26hl%3Den%26lr%3D%26sa%3DN%26tab%3Dwg%26&_doneTitle=Back+to+Search&&d#53a6b6edd1c4d500
It appears that some repeater/couplers create problems with SwitchLincs specifically with standard dim/bright commands. This may be what were seeing here.
I would probably try to stick to using the PRESET DIM commands (301 to 332) but we need to verify that the X-10 status is working once we pass correct values. Unfortunately, the ph_x10btn function does not make use of the PRESET DIM command and neither does the X-10 status screen (it calls the ph_x10btn function). However, I will make an enhancement to this function so that it will check the X-10 Type and if the module supports PRESET DIM will use that method over standard dim.
Keep me posted.
Dave.
|
Back to Top |
|
|
Dean Senior Member
Joined: August 21 2003 Location: United States
Online Status: Offline Posts: 109
|
Posted: December 29 2004 at 20:19 | IP Logged
|
|
|
Dave,
I think you hit the bullseye with the Google link about problems with repeaters and SwitchLinc modules. With my Leviton coupler/repeater turned off, I had to move my lamp and LampLinc module over to the same phase as my PowerHome machine. I turned the lamp up to full brightness and hit DIM until the lamp went off...it took 32 presses of the DIM, which is what it was yesterday using the PalmPad in PowerHome. Once nice thing about the LampLinc module is that is has a little light on it and that light blinks once for each command received to its address. This did blink once for each press.
When I turned on the Leviton coupler/repeater and kept the lamp on the same phase as PowerHome (remember, I have PowerHome echoing the commands onto the powerline that it receives from the W800RF32 controller), I was still able to DIM the lamp until it went off, but I did notice the light on the LampLinc module did not blink consistently with each press. On some occasions I thought I saw it blink twice for a few presses of the PalmPad.
Then, moving the lamp back over to the opposite phase as PowerHome, things got much more interesting. I was not able to DIM the lamp until it turned off. I would see the LampLinc light blinking multiple times per press, sometimes not blinking at all, then the LampLinc appeared to be frozen. I was unable to even turn the light off with just an off command. Then I would see the light blink like 5 (give or take) times quickly, as if something was buffering the DIM commands (PowerHome???) and then releasing them all at once. At one point the light turned on to full brightness when I was DIM'ing it.
Obviously this was not a scientific study of LampLinc modules and the effects of repeaters, but I think it was enough proof for me to see that the repeater was causing sporadic problems in my environment.
When the following is entered in a formula, what are we doing by placing two commands between a plus (+) sign? Are we just adding up the return values here, which should be 0 if all is OK? Can any commands that return a numeric value be strung together like this? It is probably me, but I found the help file section on ph_x10 a little confusing. In general, and again it may just be me, having examples for the commands would be helpful.
Now that we have gotten this far, if we go back to my original application that brought all this about:
"Basically, what I am trying to do in a macro is to record the current DIM level (ph_getx10level( "A", 5 )) of the LampLinc module in a [GLOBAL05] variable, then dim the module to some percent, say 50% (ph_x10btn("A",5,100,50)). Then, in another macro, I restore the recorded DIM level (ph_x10btn("A",5,100,[GLOBAL05]))."
How do I go about this? We have learned that I need to use PRESET DIMS for the LampLinc module. If I understand your last post, there is currently no way (or perhaps no accurate way) to determine the current DIM/BRIGHT level of the LampLinc module? So there would really be no way to return a light to its previous DIM'ness state?
Thanks again Dave.
-Dean
|
Back to Top |
|
|
dhoward Admin Group
Joined: June 29 2001 Location: United States
Online Status: Offline Posts: 4447
|
Posted: December 31 2004 at 00:37 | IP Logged
|
|
|
Dean,
Glad to hear that some sense is coming from everything.
Concerning formulas...yes. We are adding the returns values from two functions which should result in 0 if everything was ok. And yes, you can do this when any function that returns a numeric. You can also concatenate strings together by adding them or functions that return a string. And it's not just you, the help does not adequately explain this. A good thread that goes into a little more detail is here: http://power-home.com/forum/display_topic_threads.asp?ForumID=4&TopicID=317. Look about halfway down for one of my posts for a good explanation of formula and how they work.
Now how to proceed. Using the ph_getx10level will return what PowerHome thinks is the current dim level. As long as you use only PRESET DIM, this could be fairly accurate (unless the repeater eats the actual preset dim command). If you are also using standard dim/bright commands, some of which are obviously eaten by the repeater, then the value wont be too accurate. But, this is all we have to rely upon since the LampLinc does not report its actual level. So, I would follow your original plan, using the ph_getx10level and saving to the global. I would then use the PRESET DIM command to do the actual dimming to the new level as well as restore to the previous level (in the global) when you're ready to do so. To dim the light 50% using PRESET DIM, do the following:
ph_x10(1,"A",5,0) + ph_x10(1,"PRESET DIM",integer(50 * 31 / 100 + 1) + 300,0)
To restore to previous dim:
ph_x10(1,"A",5,0) + ph_x10(1,"PRESET DIM",integer([GLOBAL05] * 31 / 100 + 1) + 300,0)
Let me know how this works out for you.
Dave.
|
Back to Top |
|
|
Dean Senior Member
Joined: August 21 2003 Location: United States
Online Status: Offline Posts: 109
|
Posted: December 31 2004 at 10:02 | IP Logged
|
|
|
Dave,
Now you're killing me! The formula worked great once I substituted int for integer.
I'll definitely check out the other thread you pointed me to.
Thanks for all your help on this one.
-Dean
|
Back to Top |
|
|
dhoward Admin Group
Joined: June 29 2001 Location: United States
Online Status: Offline Posts: 4447
|
Posted: December 31 2004 at 11:51 | IP Logged
|
|
|
Dean,
Oops , sorry...my bad. You definately want the INT command, not the INTEGER.
Glad some progress is being made. Also, I'll have the enhancements made to the ph_x10btn function so that PRESET DIM will be sent and supported if the module type is flagged to support it. This will simplify your formulas as well as allow the X-10 status screen to use the PRESET DIM.
Happy New Year,
Dave.
|
Back to Top |
|
|
|
|