Powermax binding

Tags: #<Tag:0x00007fc3edda5260> #<Tag:0x00007fc3edda5198>

Sorry the code is a real mess…


This one gets the entrydelay. So if my phone is at home when entrydelay it disarms.
rule "Huslarm"

when   
    Item Powermax_partition_arm_mode changed to EntryDelay
then
	alarm = 1 // I need to set this for the alarm to be activated if entrydelay has been triggerd.
	sendCommand(Powermax_EntryDelay, ON)
	logInfo(    "Alarm system", "Entrydelay on")
	if(HouseJustArrived.state == ON) {
		sendCommand(Powermax_partition_arm_mode, "Disarmed")
	}

end


rule "Huslarm"

when   
    Item Powermax_partition_alarm changed to ON
then
	alarm = 1
	logInfo(    "Alarm system", "alarm = 1")
	if((Powermax_zone1_status.state==ON) && (Powermax_EntryDelay.state==OFF) && (Powermax_partition_armed==ON)) {
    sendCommand(Powermax_Alarm, ON)
    pushover("Alarm!! Movement in the living room", 2)
	}
end

rule "Huslarm"

when   
    Item Powermax_partition_arm_mode changed to Armed
then
    if(alarm == 1) {
    pushover("Alarm in the house!!", 2)
    if(Powermax_Alarm.state!=ON) { sendCommand(Powermax_Alarm, ON) }
    logInfo(    "Alarm system", "Entredelay larm on")
	}
	else {
		var String command =Powermax_partition_status.state.toString.toLowerCase
   if (command.contains("armed away")) {
		if(HouseMode.state!=2) { sendCommand(HouseMode, 2) }
		pushover("Alarm is armed", -2)
		}
	}
end

rule "Alarm disarms"

when   
    Item Powermax_partition_arm_mode changed to Disarmed
then
    createTimer(now.plusSeconds(3)) [|
if(Powermax_Alarm.state==ON) {
	if(Powermax_EntryDelay!=OFF) { sendCommand(Powermax_EntryDelay, OFF) }
    if(Powermax_Alarm.state!=OFF) { sendCommand(Powermax_Alarm, OFF) }
	alarm = 0
	logInfo(    "Alarm system", "Alarm reseted")
    pushover("Alarm reseted.", 0)
}
else {
	if(Powermax_EntryDelay!=OFF) { sendCommand(Powermax_EntryDelay, OFF) }
    if(Powermax_Alarm.state!=OFF) { sendCommand(Powermax_Alarm, OFF) }
	alarm = 0
		if(HouseMode.state!=1) { sendCommand(HouseMode, 1) }
}
	]
end

This is my log file. When the alarm actually works when a door is opened and entrydelay is started and it runs out.
When the system goes to EntryDelay i trigger a ‘alarm = 1’. If the system disarms in the entrydelay time window the ‘alarm’ is set to 0. And when the time runs out (without disarm) the partition is set to “armed” again, which means an alarm has triggerd.

Well actually my problem does not always occur, I need to investigate further why it does false alarm, something to do with ‘alarm = 0’ not being set.

2017-02-13 11:14:11.643 [ItemStateChangedEvent     ] - Powermax_zone29_status2 changed from CLOSED to OPEN
2017-02-13 11:14:11.649 [ItemStateChangedEvent     ] - Powermax_zone29_status changed from OFF to ON
2017-02-13 11:14:11.704 [ItemStateChangedEvent     ] - Powermax_partition_status changed from Armed Away, Ready to Entry Delay, Not ready, Open in Zone 29, Status changed, Alarm event
2017-02-13 11:14:11.710 [ItemStateChangedEvent     ] - Powermax_partition_alarm changed from OFF to ON
2017-02-13 11:14:11.717 [ItemStateChangedEvent     ] - Powermax_zone29_last_trip changed from 2017-02-12T17:39:33.000+0100 to 2017-02-13T11:14:11.000+0100
2017-02-13 11:14:11.725 [ItemStateChangedEvent     ] - Powermax_partition_ready changed from ON to OFF
2017-02-13 11:14:11.731 [ItemStateChangedEvent     ] - Powermax_partition_arm_mode changed from Armed to EntryDelay
2017-02-13 11:14:11.753 [ItemCommandEvent          ] - Item 'Powermax_EntryDelay' received command ON
2017-02-13 11:14:11.759 [ItemStateChangedEvent     ] - Powermax_EntryDelay changed from OFF to ON
2017-02-13 11:14:12.052 [ItemStateChangedEvent     ] - Powermax_partition_status changed from Entry Delay, Not ready, Open in Zone 29, Status changed, Alarm event to Entry Delay, Not ready
2017-02-13 11:14:12.055 [ItemStateChangedEvent     ] - Powermax_partition_alarm changed from ON to OFF
2017-02-13 11:14:14.293 [ItemStateChangedEvent     ] - Powermax_partition_status changed from Entry Delay, Not ready to Entry Delay, Ready, Closed in Zone 29
2017-02-13 11:14:14.297 [ItemStateChangedEvent     ] - Powermax_partition_ready changed from OFF to ON
2017-02-13 11:14:32.049 [ItemStateChangedEvent     ] - Powermax_partition_status changed from Entry Delay, Ready, Closed in Zone 29 to Entry Delay, Ready, Last 10 seconds
2017-02-13 11:14:41.050 [ItemStateChangedEvent     ] - Powermax_partition_status changed from Entry Delay, Ready, Last 10 seconds to Armed Away, Ready, Status changed
2017-02-13 11:14:41.055 [ItemStateChangedEvent     ] - Powermax_partition_arm_mode changed from EntryDelay to Armed
2017-02-13 11:14:41.682 [ItemCommandEvent          ] - Item 'Powermax_Alarm' received command ON // Alarm goes out to the phone.
2017-02-13 11:15:12.118 [ItemStateChangedEvent     ] - Powermax_partition_status changed from Armed Away, Ready, Status changed to Armed Away, Ready, Alert in memory

Hi,

Just startede with Openhab. so it is a steep learning curve :slight_smile: .I had my Powermax on a Vera before.

From the examples above, i am able to get the powermax connect with my rasp pi. And I can arm and disarm without a code.
Is it possible to have a keypad and then you have to type in a pin before you are allowed to disarm?

Thanks

Regards

Claus

Unfortunately no

Can I arm and disarm with a PIN kode, if I build it into a bottom? If I can, how would the code look like?

Thanks

/Claus

Hi,

I have actually found a way to do it. You can use this keypad: Custom widget: Keypad

together with a rule.

I can fill in the details if anybody would like to know more.

Regards

Claus

Yes please :slight_smile: @chamtl Claus

you can create a rule like this:

// Disarm alarm
rule "AlarmDisarm"
when
Item AlarmKeypad received update
then
if(AlarmKeypad.state==“KODE”)
{
sendCommand(Powermax_partition_armed, OFF)
}
end

This is not using the pin code in powermax, but it uses the pin that you define in the rule. So if you dont enter one of the codes in the rule, then the alarm will not diaarm.

Also remember to allow disarm in the powermax openhab binding settings.

/Claus

@Lolodomo,
have you tested the tcp connection also? I’m buying a powermax pro and I’d like to add it to openhab with a tcp connection, but if it is not tested or not working, I will buy the serial expansion card .
Thank you in advance.

Not tested by myself. I have only the serial connection kit.

Okey, I’m new to this binding. Just hoked up my PowerMaster 10 G2 to Openhab with a TTL-USB device. As what I can se I do have communication with the PM. I have followed the instruction from the documentation. I can see that may Serial and so on i read.

But it is from here that I’m not sure how to go on. I don’t get any respons from PIR’s, or door sensors. Trying to read event logs don’t give any thing. Is this due to PowerMaster 10 not beeing compatible, or is it my conf/setup thats not correct?

Are there any settings in the CA/panel that has to be changed in order for the “Powerlink” to go fully active?

Any advice on what to do next is appreciated!

As you already got the information you are showing, I think the Powerlink mode is working as expected.
What about the items relative to arm mode ? Are they updated when you arm and disarm your system ?
Maybe your items for sensors are defined with the wrong zone number ?

I could advice to move to the 2.0 version of the bindings as it includes the automatic discovery of zones but it is not yet fully stable and I have not yet released it. But I fixed 2 little bugs yesterday and I should release it soon now.

1 Like

As I am new to openhab, I was wondering if there is an update on the new binding? Or is there a place where we can find it? Can’t wait to test it…

Happy to do some beta testing for you?

For users wanting to test the new version of the binding for openHAB 2, you can download the jar file here: http://lg.hc.free.fr/openHAB/org.openhab.binding.powermax-2.1.0-SNAPSHOT.jar
The documentation is available here: https://github.com/lolodomo/openhab2-addons/blob/powermax/addons/binding/org.openhab.binding.powermax/README.md

Cool! Will start testing after my holidays…

Just dropped it into the addon folder and restated:

2017-07-13 17:10:00.834 [ERROR] [org.openhab.binding.powermax        ] - FrameworkEvent ERROR - org.openhab.binding.powermax
org.osgi.framework.BundleException: Could not resolve module: org.openhab.binding.powermax [190]
  Unresolved requirement: Import-Package: gnu.io
	at org.eclipse.osgi.container.Module.start(Module.java:434)[org.eclipse.osgi-3.10.101.v20150820-1432.jar:]
	at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1582)[org.eclipse.osgi-3.10.101.v20150820-1432.jar:]
	at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1562)[org.eclipse.osgi-3.10.101.v20150820-1432.jar:]
	at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.doContainerStartLevel(ModuleContainer.java:1533)[org.eclipse.osgi-3.10.101.v20150820-1432.jar:]
	at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1476)[org.eclipse.osgi-3.10.101.v20150820-1432.jar:]
	at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1)[org.eclipse.osgi-3.10.101.v20150820-1432.jar:]
	at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)[org.eclipse.osgi-3.10.101.v20150820-1432.jar:]
	at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:340)[org.eclipse.osgi-3.10.101.v20150820-1432.jar:]

Do i need to add the serial binding via paper UI?

The feature openhab-transport-serial needs to be started.

You have to do it through the console.

An alternative is to install through Paper UI another binding relying on serial connection like the RFXCOM binding.

yep that fixed it. all the zones showed up, so far so good :slight_smile: