Page 1 of 1
Use function key to turn on or off light

Posted:
Wed Aug 16, 2017 7:27 am
by jonmtl
Hello,
I’ve integrated an AD2PI with OpenHAB on my Vista-20p and now will like to use one the function key on my Keypad(A->D) to trigger an event (rule) in OpenHAB, like turn on light.
Is there a way to send a message to AD2PI that OpenHAB could read? Like, is it possible to create a Fault message (that would send a !REL message) by pressing on a function key?
Thanks for your help,
Jonathan
Re: Use function key to turn on or off light

Posted:
Wed Aug 16, 2017 7:29 am
by kevin
As far as I am aware, you can program (most) of the function keys on your panel to do whatever you want...
Other than that, you could do a virtual zone (emulate an expander, program in a zone, and fault/unfault this virtual zone with the L command)
Re: Use function key to turn on or off light

Posted:
Wed Aug 16, 2017 7:46 am
by mathewss
jonmtl wrote:Hello,
I’ve integrated an AD2PI with OpenHAB on my Vista-20p and now will like to use one the function key on my Keypad(A->D) to trigger an event (rule) in OpenHAB, like turn on light.
Is there a way to send a message to AD2PI that OpenHAB could read? Like, is it possible to create a Fault message (that would send a !REL message) by pressing on a function key?
Thanks for your help,
Jonathan
This is a perfect example of a use case for relay emulation. First enable one of the relay modules on the AD2. Make sure it does not conflict with any physical relay modules if you have any. Then you can program an output function for they keypad button to toggle one of the four virtual relays on the virtual relay module at its address. You would get REL on off messages that can be used to drive your automaton needs.
I do not have a step by step or white paper handy but if you document your steps we sure could make one.
Best
Sean M.
Sent from my SM-G935T using Tapatalk
Re: Use function key to turn on or off light

Posted:
Wed Aug 16, 2017 7:47 am
by mathewss
This is a perfect example of a use case for relay emulation. First enable one of the relay modules on the AD2. Make sure it does not conflict with any physical relay modules if you have any. Then you can program an output function for the keypad button to toggle one of the four virtual relays on the virtual relay module at its address. You would get REL on/off messages that can be used to drive your automaton needs.
I do not have a step by step or white paper handy but if you document your steps we sure could make one.
Best
Sean M.
Re: Use function key to turn on or off light

Posted:
Wed Aug 16, 2017 8:05 am
by jonmtl
Thanks for your help.
I will try this and if I'm able to make it work, I will post a step by step instructions.
Cheers,
Jonathan
Re: Use function key to turn on or off light

Posted:
Fri Aug 18, 2017 4:19 am
by jonmtl
Hello,
Good news! With your guidance, I was able to make it work.
So here are the steps that I had to do:
First, I’ve enabled all the relay emulation module on my AD2PI in the Alarm Decoder Web App (Settings -> Advanced -> Setup)
Then on my alarm system keyboard, I’ve gone into programming mode #### + 800
-The first step is to assign a function key to a device activation
--> *57
--> Press the function key you want to assign (D)
--> Press * to continue
--> Assign this key to 07 (Device Activation / Change Dev State)
--> Exit
Then you need to map the output. In my case, Output # 1 to 4 are already used, same for Module Address 12. So I will use output 5/address 13.
--> *79
--> Select Output number: 05
--> Output Type 1 (Relay)
--> Module Addr: 13
--> Position: 1
--> Exit
Then you need to define the output action
--> *80
--> Select an unused output function number. In my case "07"
--> Activate by: Zone Type (2)
--> Enter the Zone Type function key (66)
--> For the Output Action, I've selected close for 2 secs (1)
--> Output Number (I use the same as the Output function number: "07"
--> Exit
Voilà!
Now when I press on the D Key, I get from the AD2PI stream:
Timestamp Message
2017-08-18 08:15:47 !REL:13,01,00
2017-08-18 08:15:45 !REL:13,01,01
Now in OpenHAB, I've added an item:
Contact lightON "Function Button D [%d]" {alarmdecoder="REL:13,01#contact"}
And I've added a simple rule:
rule "Button D"
when
Item lightON changed from CLOSED to OPEN
then
sendCommand(Hue_light1, ON)
end
If you have questions, don't hesitate!
Cheers,
Jonathan
Re: Use function key to turn on or off light

Posted:
Fri Aug 18, 2017 9:34 am
by kevin
Thanks for the guide - just to point out - enabling all relay emulation slots could have dire effects. This could cause address conflicts with other devices - existing relays, long range/gsm radios etc. Be very careful and only emulate the ones you need. 1st one is 112, 2nd one is 113 and so on.
Re: Use function key to turn on or off light

Posted:
Fri Aug 18, 2017 9:45 am
by kevin