OK, I have a “rough” set up for the siren. This is just to give some basic functionality, as without specific command handlers or message handlers, you can’t use all the functionality of the siren, but this covers simple cases. Also I am using OH2, but the instructions should work for OH1 also (but tested with OH2).
If you don’t want to get into configuring the insteonplm binding, you can get simple functionality by setting the siren up as a dimmer or switch. A Switch simply sets the siren off for the maximum time (about 4 minutes - 255 seconds) with the last sound used (chime or alarm). A Dimmer allows you to set the alarm duration as a percentage of 4 minutes (or 255 seconds), so 12% is about 30 seconds. This will work irrespective of the sirens “armed” status.
The siren has three armed settings, “home”, “away” and “both” (plus “disarmed”). The alarm can be triggered for each of these modes by group broadcasts, but I haven’t got into that, it’s complex. So you can set the armed modes, but triggering is a direct trigger, and ignores the armed modes. The armed modes can be used by linked devices though.
Functionality exposed by this set up is:
ON/OFF (like switch)
On for duration % (like dimmer)
On for specific time (in seconds)
Set alert sound (Chime or Alarm)
Arm Mode (“home”, “away”, “both”)
Disarm (and silence at same time)
Poll (to get current status, including remaining alarm time)
This asumes you are somewhat familiar with adding additional devices in the insteonplm binding. The instructions are in the insteonplm wiki https://github.com/openhab/openhab1-addons/wiki/Insteon-PLM-Binding in the “Adding new device types” section.
Here are the settings:
additional_features.xml
<xml>
<feature name="SirenAlertGroup"> <!-- just does the polling for Alert Type -->
<message-dispatcher>PollGroupDispatcher</message-dispatcher>
<poll-handler ext="1" cmd1="0x2E" cmd2="0x00" d1="0x01" >FlexPollHandler</poll-handler>
</feature>
<feature name="SirenTrigger">
<message-dispatcher>DefaultDispatcher</message-dispatcher>
<message-handler cmd="0x11" group="1">LightOnDimmerHandler</message-handler>
<message-handler cmd="0x12" group="1" mode="FAST">LightOnDimmerHandler</message-handler>
<message-handler cmd="0x13" group="1">LightOffDimmerHandler</message-handler>
<message-handler cmd="0x14" group="1" mode="FAST">LightOffDimmerHandler</message-handler>
<message-handler cmd="0x19">DimmerRequestReplyHandler</message-handler>
<message-handler default="true">NoOpMsgHandler</message-handler>
<command-handler command="PercentType">PercentHandler</command-handler>
<command-handler command="OnOffType">LightOnOffCommandHandler</command-handler>
<command-handler command="DecimalType" cmd1="0x11" value="command2">NumberCommandHandler</command-handler>
<poll-handler ext="0" cmd1="0x19" cmd2="0x00" >FlexPollHandler</poll-handler>
</feature>
<feature name="SirenArm" timeout="5000">
<message-dispatcher>SimpleDispatcher</message-dispatcher>
<message-handler cmd="0x20">TriggerPollMsgHandler</message-handler>
<message-handler cmd="0x19" ext="0" match_cmd1="0x19" rshift="6" low_byte="command2">NumberMsgHandler</message-handler>
<message-handler default="true">NoOpMsgHandler</message-handler>
<command-handler command="DecimalType" ext="1" cmd1="0x20" cmd2="0x05" value="userData1">NumberCommandHandler</command-handler>
<poll-handler ext="0" cmd1="0x19" cmd2="0x03" >FlexPollHandler</poll-handler>
</feature>
<feature name="SirenDisArm" timeout="5000">
<message-dispatcher>SimpleDispatcher</message-dispatcher>
<message-handler cmd="0x20">TriggerPollMsgHandler</message-handler>
<message-handler cmd="0x19" ext="0" match_cmd1="0x19" rshift="6" low_byte="command2">NumberMsgHandler</message-handler>
<message-handler default="true">NoOpMsgHandler</message-handler>
<command-handler command="DecimalType" ext="1" cmd1="0x20" cmd2="0x04" value="userData1">NumberCommandHandler</command-handler> <!-- userData1 is ignored -->
<poll-handler>NoPollHandler</poll-handler> <!-- polled by SirenArm -->
</feature>
<!--
Name Armed / Disarmed / countdown state
bit 0 - bit 5 - Remaining Arming Countdown time
bit 6 - Home armed
bit 7 - Away armed
Remaining number of seconds in a countdown
The value can be any number from 0-45
This value loosely corresponds to the number of
seconds of remaining countdown time.
-->
<feature name="SirenAlertType" timeout="5000">
<message-dispatcher>DefaultDispatcher</message-dispatcher>
<!-- handles direct ack after siren type has been changed-->
<message-handler cmd="0x19">TriggerPollMsgHandler</message-handler>
<!-- handles direct extended message after query -->
<message-handler cmd="0x2E" ext="1" match_cmd1="0x2E" low_byte="userData7">NumberMsgHandler</message-handler>
<command-handler command="DecimalType" ext="1" cmd1="0x2E" cmd2="0x00" d1="0x01" d2="0x05" value="userData3">NumberCommandHandler</command-handler>
<poll-handler>NoPollHandler</poll-handler> <!-- polled by SirenAlertGroup -->
</feature>
<!--
NOTE: This is the same command used to set a
dimmable device's Ramp Rate
Name Siren Alert Type
Description The siren has two Alert types, Chime and Loud Siren
Size 1 byte
Description Value
Chime The siren will emit a ding-dong chime 00
Loud Siren The siren will emit a 120db Siren 01
-->
<feature name="SirenPoll" timeout="5000">
<message-dispatcher>DefaultDispatcher</message-dispatcher>
<!-- handles direct ack by triggering poll-->
<message-handler cmd="0x19">TriggerPollMsgHandler</message-handler>
<message-handler default="true">NoOpMsgHandler</message-handler>
<command-handler command="DecimalType" ext="1" cmd1="0x2E" cmd2="0x00" d1="0x01" value="userData3">NumberCommandHandler</command-handler>
<poll-handler>NoPollHandler</poll-handler>
</feature>
</xml>
additional_devices.xml
<xml>
<device productKey="F00.00.23">
<model>2868</model>
<description>Siren Module</description>
<feature name="trigger">SirenTrigger</feature>
<feature name="arm">SirenArm</feature>
<feature name="disarm">SirenDisArm</feature>
<feature name="poll">SirenPoll</feature>
<feature_group name="alert_group" type="SirenAlertGroup">
<feature name="alarmtype">SirenAlertType</feature>
</feature_group>
<feature name="lastheardfrom">GenericLastTime</feature>
</device>
</xml>
items
Switch hallwaySirenSwitch "Siren Switch [%s]" <siren> {insteonplm="XX.XX.XX:F00.00.23#trigger"}
Dimmer hallwaySirenDimmer "Siren Dimmer [%d%%]" <siren> {insteonplm="XX.XX.XX:F00.00.23#trigger"}
Number hallwaySirenSwitchDuration "Siren ON Duration [%s]" <siren> {insteonplm="XX.XX.XX:F00.00.23#trigger"}
Number hallwaySirenArm "Arm Siren [MAP(armed.map):%s]" <siren> {insteonplm="XX.XX.XX:F00.00.23#arm", autoupdate=false}
Number hallwaySirenDisArm "Disarm Siren [%d]" <siren> {insteonplm="XX.XX.XX:F00.00.23#disarm", autoupdate=false}
Number hallwaySirenAlarmType "Siren Sound [%d]" <siren> {insteonplm="XX.XX.XX:F00.00.23#alarmtype", autoupdate=false}
Number hallwaySirenPoll "Siren Poll" <siren> {insteonplm="XX.XX.XX:F00.00.23#poll", autoupdate=false}
sitemap
Switch item=hallwaySirenSwitch mappings=[ON="TEST", OFF="SILENCE"]
Switch item=hallwaySirenDimmer mappings=[0="OFF", 12="30 Sec", 24="1 min", 35="90 sec", 47="2 min", 100="4 min"]
Slider item=hallwaySirenDimmer
Switch item=hallwaySirenSwitchDuration mappings=[0="OFF", 30="30 Sec", 60="1 min", 90="90 sec", 120="2 min"]
Switch item=hallwaySirenAlarmType mappings=[0="CHIME", 1="ALARM"]
Switch item=hallwaySirenArm mappings=[1="HOME", 3="AWAY",2="BOTH"]
Switch item=hallwaySirenDisArm mappings=[0="DISARM"]
Switch item=hallwaySirenPoll mappings=[0="POLL"]
transform armed.map
0=0
1=1
2=3
3=2
-=Unknown
NULL=Unknown
You need the transform as the value returned by the armed status is a bitmap (2 bits for away, home) and the setting is a value 1,2,3 = home, both, away, so the one does not map to the other.
Note that the Number for setting the alarm on time is 0-255 in seconds, and does update on a poll, but will give the % remaining (of 255). The Dimmer item updates the same way on a poll (and when it hits 0), so if you want the remaining alarm time, poll, then read the dimmer or Number item, which gives you the % of 255s time left ie if there is 2 minutes alarm time left you should get 50%.
WARNING: I have found that if you hit the Siren with too many commands (like to many polls), it stops responding, and needs a power cycle to fix it. Yes, an Alarm that stops responding to commands if you query it, or send commands to it too often - not the most reliable of alarms!
This is just a quick set up for basic functions, there may be errors in my implementation, feel free to improve! Hopefully Bernd or someone will come up with a proper message and command handler for this device eventually, and we can use the full functionality.
Until then, enjoy!