Jakey69 / openhab

Source code of the open Home Automation Bus (openHAB)
Eclipse Public License 1.0
0 stars 1 forks source link

RF Dimmer #2

Open jshridha opened 9 years ago

jshridha commented 9 years ago

Jack,

I noticed last night that the dim/bright commands work differently for PL and RF commands. For PL, you can specify the amount to dim (which is what you are doing). The problems is a DIM command over RF dims only a set amount regardless of the amount you tell it to dim. I'm not sure yet what this amount is, but it's approximately 10% of the full scale for the dimmer I was using.

I think we need a different method for dimming via RF. The easy way is to not define a dimmer but define a button instead. So there would be 3 items for each switch. An on/off item, a button to dim, and a button to bright. This is definitely an easy fix for the short term, but not the prettiest.

Another method would be to keep track of how much dim/bright has already been sent and then loop through to send more. For example, of the dim is on a scale of 0-100% and you're currently at 30%, you'd then have to send 4x 10% commands to get to 70%. So you'd send the command once, wait for a response, and send the command again looping through until you got to a total of 70%.

The only issues I see here is if the light was dimmed using a different method (for example a remote control or right at the switch). The software would have to detect this and adjust its memory of what the dim level used to be. Also, soft start switches cause other issues. As always, the devil is in the details.

jshridha commented 9 years ago

I worked on this for a bit tonight and think I have a fix. Can you assign this issue to me?

jshridha commented 9 years ago

Jack,

I handled this issue by creating a loop for rf commands. If the transmit method is rf and the command is bright or dim, it'll send the command numerous times to reach the required dim level. It seems to be pretty robust, but it relies on having the number of dim levels configured. I'm sending you a merge request.

jshridha commented 8 years ago

Jack,

Have you had the chance to take a look at this merge request? It would be nice to have it included before the openhab v1.7.1 release.