Use function key to turn on or off light

General Discussion

Use function key to turn on or off light

Postby jonmtl » Wed Aug 16, 2017 7:27 am

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
jonmtl
newt
newt
 
Posts: 3
Joined: Wed Aug 16, 2017 5:34 am

Re: Use function key to turn on or off light

Postby kevin » Wed Aug 16, 2017 7:29 am

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)
Not an employee of the company. Just here to help and keep things clean.
kevin
Platinum Nut
Platinum Nut
 
Posts: 994
Joined: Fri Aug 16, 2013 10:10 am

Re: Use function key to turn on or off light

Postby mathewss » Wed Aug 16, 2017 7:46 am

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
mathewss
Moderator
Moderator
 
Posts: 188
Joined: Fri Dec 06, 2013 11:14 am

Re: Use function key to turn on or off light

Postby mathewss » Wed Aug 16, 2017 7:47 am

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.
mathewss
Moderator
Moderator
 
Posts: 188
Joined: Fri Dec 06, 2013 11:14 am

Re: Use function key to turn on or off light

Postby jonmtl » Wed Aug 16, 2017 8:05 am

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
jonmtl
newt
newt
 
Posts: 3
Joined: Wed Aug 16, 2017 5:34 am

Re: Use function key to turn on or off light

Postby jonmtl » Fri Aug 18, 2017 4:19 am

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
jonmtl
newt
newt
 
Posts: 3
Joined: Wed Aug 16, 2017 5:34 am

Re: Use function key to turn on or off light

Postby kevin » Fri Aug 18, 2017 9:34 am

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.
Not an employee of the company. Just here to help and keep things clean.
kevin
Platinum Nut
Platinum Nut
 
Posts: 994
Joined: Fri Aug 16, 2013 10:10 am

Re: Use function key to turn on or off light

Postby kevin » Fri Aug 18, 2017 9:45 am

We have added your steps to our wiki, thanks

https://www.alarmdecoder.com/wiki/index ... _Key_Relay
Not an employee of the company. Just here to help and keep things clean.
kevin
Platinum Nut
Platinum Nut
 
Posts: 994
Joined: Fri Aug 16, 2013 10:10 am


Return to General

Who is online

Users browsing this forum: No registered users and 3 guests

cron