All right. Trying to get things figured out here.... Got my USB-UIRT up and running, but have a question about a task.
I want to have one button on an IR remote control to run a lamp module with a toggled on/off. (press this button once, light comes on, press same button again, light goes off.)
I think I am getting close with the task, but it just isnt quite right, and there are lots of delays in my task.... there must be a better way.
Ok here is what I have for my task:
Condition: Check for IR code #2 to be received
AND: if lamp.power state = on
Then turn lamp.power state = off
Then : Change IR code to 0
Then : delay 2000ms
Else If: Lamp.power state = off
Then : Change Lamp.Power state = On
Then : Delay 2000ms
Then : change IR code to 0
Sometimes it works, sometimes it cyles through once or twice (on/off/on or vice versa)
Thanks in advance for your help!
Proper way to toggle an IR input command?
Nope, that dont do it. In fact, I had tried that previous......
I think I may have tracked down part of the problem:
If I watch the history of received IR codes, it appears that it changes the IR Received code to 2 about a dozen times. The task attempts to reset the IR code to "0" partially through this procedure, thus causing the lamp to come back on, then of course it shuts it off again..... It seems depending on the timing, the lamp will flash on/off a couple times, then most of the time, it will rest in the state which I want it too.
No, is there a way for housebot or the USB UIRT to only post the received IR command once? Like I said, it comes up "change IR value to 2" about 12 times with just one quick press of the remote.
I have tried re-learning the remote, I have also tried to "trim" the pronto data for the code to clean it up, but that didnt seem to change anything at all......
Thanks for your help.
I think I may have tracked down part of the problem:
If I watch the history of received IR codes, it appears that it changes the IR Received code to 2 about a dozen times. The task attempts to reset the IR code to "0" partially through this procedure, thus causing the lamp to come back on, then of course it shuts it off again..... It seems depending on the timing, the lamp will flash on/off a couple times, then most of the time, it will rest in the state which I want it too.
No, is there a way for housebot or the USB UIRT to only post the received IR command once? Like I said, it comes up "change IR value to 2" about 12 times with just one quick press of the remote.
I have tried re-learning the remote, I have also tried to "trim" the pronto data for the code to clean it up, but that didnt seem to change anything at all......
Thanks for your help.
I wanted to say that you could set the IR Code Number Received Property to NOT allow same value changes, but I just checked the code and it ignores that flag anyway.gorfllub wrote:No, is there a way for housebot or the USB UIRT to only post the received IR command once? Like I said, it comes up "change IR value to 2" about 12 times with just one quick press of the remote.
You could add another Property to the IR Device and use it. For example, add a user definable numeric property. Use a Task to trigger off of the original IR received value. Have the task set the new value to the IR received value (using pv substitution) only if it is NOT equal to the value of the new property (and not zero). You can also have the Task set the value back to 0. This is just off the top of my head, and it may have other problems.
Scott