Hi
Hoping @jossuar ossuar will be able to help as I have now made progress and have my system working for informational purpoases but would liek to be able to send commands to the panel - which I am having no success with.
I have set a rule as follows:
rule "Chime when STAY Pressed"
when
Item Partition1_Stay received command ON
then
if (Partition1_ReadyToArm.state == ON) {
logWarn("actions", "Ready to ARM is ON")
}
else {
val actions = getActions("caddx","caddx:zone:thebridge:partition1")
if (null === actions) {
logWarn("actions", "Actions not found, check thing ID for bridge")
return
}
logWarn("actions", "Ready to ARM is ON")
actions.chime()
}
end
Using
caddx.things as folows:
Bridge caddx:bridge:thebridge "Bridge" [ protocol="Ascii", serialPort="COM1", baudrate=9600 ] {
Thing partition partition1 "Main House Alarm" [ partitionNumber=1 ]
Thing zone zone1 "MAG Front Door 01" [ zoneNumber=1 ]
Thing zone zone2 "MAG Kitchen Door 02" [ zoneNumber=2 ]
Thing zone zone3 "PIR Kitchen 03" [ zoneNumber=3 ]
Thing zone zone4 "PIR Lounge 04" [ zoneNumber=4 ]
Thing zone zone5 "PIR Garage 05" [ zoneNumber=5 ]
Thing zone zone6 "PIR Main Bedroom 06" [ zoneNumber=6 ]
Thing zone zone17 "PIR Dining Room 17" [ zoneNumber=17 ]
Thing zone zone23 "PIR Passage 23" [ zoneNumber=23 ]
caddx.items as follows:
Group:Contact:OR(OPEN,CLOSED) MotionSensors1 "Motion Sensors [%s]" <motion>
Group:Contact:OR(OPEN,CLOSED) Windows1 "Doors [%s]" <door>
Group:Contact:OR(OPEN,CLOSED) MotionSensors2 "Motion Sensors [%s]" <motion>
Group:Contact:OR(OPEN,CLOSED) Windows2 "Doors [%s]" <door>
Group:Contact:OR(OPEN,CLOSED) MotionSensors3 "Motion Sensors [%s]" <motion>
Group:Contact:OR(OPEN,CLOSED) Windows3 "Doors [%s]" <door>
Group:Contact:OR(OPEN,CLOSED) MotionSensors4 "Motion Sensors [%s]" <motion>
Group:Contact:OR(OPEN,CLOSED) Windows4 "Doors [%s]" <door>
Contact MAG_Front_Door_01 "MAG Front Door 01 [%s]" <door> (Windows1) { channel="caddx:zone:thebridge:zone1:zone_faulted" }
Contact MAG_Kitchen_Door_02 "MAG Kitchen Door 02 [%s]" <door> (Windows1) { channel="caddx:zone:thebridge:zone2:zone_faulted" }
Contact PIR_Kitchen_03 "PIR Kitchen 03 [%s]" <motion> (MotionSensors1) { channel="caddx:zone:thebridge:zone3:zone_faulted" }
Contact PIR_Lounge_04 "PIR Lounge 04 [%s]" <motion> (MotionSensors1) { channel="caddx:zone:thebridge:zone4:zone_faulted" }
Contact PIR_Garage_05 "PIR Garage 05 [%s]" <motion> (MotionSensors1) { channel="caddx:zone:thebridge:zone5:zone_faulted" }
Contact PIR_Main_Bedroom_06 "PIR Main Bedroom 06 [%s]" <motion> (MotionSensors1) { channel="caddx:zone:thebridge:zone6:zone_faulted" }
Contact PIR_Diningroom_17 "PIR Diningroom 17 [%s]" <motion> (MotionSensors1) { channel="caddx:zone:thebridge:zone17:zone_faulted" }
Contact PIR_Passage_23 "PIR Passage 23 [%s]" <motion> (MotionSensors1) { channel="caddx:zone:thebridge:zone23:zone_faulted" }
Switch Partition1_Armed "Armed [%s]" <house> { channel="caddx:partition:thebridge:partition1:partition_armed" }
Switch Partition1_EntryGuard "Entry Guard [%s]" <house> { channel="caddx:partition:thebridge:partition1:partition_entryguard" }
Switch Partition1_ReadyToArm "Ready to Arm [%s]" <house> { channel="caddx:partition:thebridge:partition1:partition_ready_to_arm" }
Switch Partition1_PreviousAlarm "Previous Alarm [%s]" <house> { channel="caddx:partition:thebridge:partition1:partition_partition_previous_alarm" }
Switch Partition1_Stay "Arm is STAY [%s]" <house> { autoupdate="false" }
and .sitemap:
sitemap alarm label="Alarm at 59" {
Frame label="Main House" {
Text item=Partition1_Armed
Text item=Partition1_EntryGuard
Text item=Partition1_ReadyToArm
// Text item=Partition1_PreviousAlarm
// Switch item=Partition1_Armed
// Switch item=Partition1_EntryGuard
Switch item=Partition1_Stay mappings=[ON="STAY"]
Text item=MotionSensors1
Text label="Motion Sensors (detailed)" {
Text item=PIR_Kitchen_03
Text item=PIR_Lounge_04
Text item=PIR_Garage_05
Text item=PIR_Main_Bedroom_06
Text item=PIR_Diningroom_17
Text item=PIR_Passage_23
}
Text item=Windows1
Text label="Windows (detailed)" {
Text item=MAG_Front_Door_01
Text item=MAG_Kitchen_Door_02
}
}
I am however now able to get the rule to send any command to the panel as the getActions() returns NULL
2020-09-16 17:21:22.621 [WARN ] [lipse.smarthome.model.script.actions] - Actions not found, check thing ID for bridge
I assume this is because I am using the incorrect thing?
Tried to follow the examples at https://github.com/jossuar/openhab2-addons/tree/caddx_actions/bundles/org.openhab.binding.caddx#rule-actions however the rule examaple does not tie in with the .things and .items in the article.
Would appreciate any guidance as to what I am doing wrong and hwo I go about sending commands such as stay(), exit(), disarm(String pin) to a specific partition.
Many Thanks
Mark