I just purchased a Dome Wireless Z-Wave Plus Siren. Ultimately, I want to configure it to chime when my existing contact sensors detect an open door (so expect an upcoming question about creating rules, similar to this question). For now, I’m trying to create a sitemap where I can change the chime sound and volume on-demand. That configuration currently works via the “Configuration Parameters” available to the Thing in PaperUI.
I’ve created a sitemap with the following, which turns the siren on and off:
Frame label=“Siren Alarm” {
Switch item=DomeWirelessSirenDMS01_Switch label=“Alarm On/Off”
}
but I’m a bit lost as to how to modify the Configuration Parameters in order to configure which sound plays and at what volume.
I found this code, which supposedly does what I’m looking for, but it’s for SmartThings:
I can see the configuration options that I’d like to set in the above code, but I don’t know how to send the necessary commands to OpenHAB2.
I found this post, which asks essentially the same question, but the answer (if it works) is not clear enough for me to implement without additional follow-up questions (I’m very new to OpenHAB):
Ultimately, I gather that want to create new Selections in the Sitemap, which change the values of other Items that probably do not yet exist (something like “Siren_Sound” and “Siren_Volume”). To link “Siren_Sound” (for example) with the Configuration Parameter of the Dome Siren Thing, I need to know the Channel that “Siren_Sound” should use to change the Configuration Parameters.
I don’t know this device but the standard approach is:
Look at your Thing in PaperUI. At the bottom of the Thing’s page is listed one or more Channels.
Pick the Channel that provides the information you want or control point on the device you want. The following is an example Channel from an Astro Thing:
The first line is a name for the Channel. The second line is the channel ID. The little square icon to the right will copy the ID to your clipboard. The last line is the type of Item that Channel can be linked to, in this case a DateTime.
You can click on the blue circle icon and select an Item to link to this Channel or, if you are using .items files you can copy the Channel ID and paste it into the Item binding config.
What you need to do is find the channels for the sound and the volume on your Thing, create Items for those Channels and link them to the Items. Put those Items on your sitemap and you can control them from there.
If there are no Channels for those then you will not be able to change those parameters dynamically from your sitemap or Rules.
a chime when a door opens and closes (I’ve already implemented a rule for this)
an alarm when a door was opened when I didn’t want it to be
The alarm and chime will use different sounds (in the screenshot above, the chime is configured as the “Secondary Notification Sound” and the alarm will be configured as the “Primary Notification Sound”. My current rule, as well as the Switch on my sitemap, play the “Secondary Notification Sound” since “7. Toggle secondary chime” is set to that option. I don’t know how to play the “Primary Notification Sound” from a sitemap or rule though, except by manually changing the configuration within PaperUI, which does not meet my use case.
It seems like not many people are using this device - are configuration parameters uncommon in devices? Surely there must be other devices people use that have configuration options people want to adjust dynamically at runtime via sitemap or rule. In fact, it looks like this was implemented in OpenHAB (https://github.com/openhab/openhab1-addons/issues/2082) - I just can’t find how to do it in OpenHAB2.
Like I said, as far as I know, there is no way to dynamically change a parameter. You can still use the 1.x binding if that was possible for that version.
I suspect that might be something that will get implement in the future if it used to be possible. But typically, on every device I’ve seen, parameters are intended to be pretty static. If they weren’t, they would be exposed using a command class in which case the parameter would show up as a Channel.
If you want to change a configuration parameter then this can be done for selected parameters if we add a channel to the database. Please list the parameters that need to be added and e can take a look at it.
Hoping I’m giving you what you need here - if not, please let me know. Also, if I can help, please let me know - I’ve never updated the database or created new channels, but I’m happy to learn and contribute where I can.
Note that all of the configurations take integers as input.
Configuration Parameters:
Primary Notification Volume Level
Value: 1, Label: Low Volume
Value: 2, Label: Medium Volume
Value: 3, Label: High Volume
Primary Notification Length
Value: 1, Label: 30 Seconds
Value: 2, Label: 1 Minute
Value: 3, Label: 5 Minutes
Value: 255, Label: Plays Until Battery Is Depleted
Secondary Notification Length // Note - it’s weird to me that the values for this are different from #2, but that’s how it’s defined in the XML…
Value: 0, Label: Does Not Stop
Value: 1, Label: 1 Minute
Value: 5, Label: 5 Minutes
Value: 255, Label: Chime Will Not Play
Secondary Notification Volume Level
Value: 1, Label: Low Volume
Value: 2, Label: Medium Volume
Value: 3, Label: High Volume
Primary Notification Sound
Value: 1, Label: Dong dong
Value: 2, Label: Fur Elise
Value: 3, Label: Westminster Chime
Value: 4, Label: Dingdongdingdongdingdong
Value: 5, Label: William Tell Overture
Value: 6, Label: Classical
Value: 7, Label: Weeooeeooeeooeeoo
Value: 8, Label: Err-err-err-err-err
Value: 9, Label: Beepbeepbeepbeep (Default)
Value: 10, Label: beeeep-beeeep-beeeep
Secondary Notification Sound
Value: 1, Label: Dong dong
Value: 2, Label: Fur Elise
Value: 3, Label: Westminster Chime
Value: 4, Label: Dingdongdingdongdingdong
Value: 5, Label: William Tell Overture
Value: 6, Label: Classical
Value: 7, Label: Weeooeeooeeooeeoo
Value: 8, Label: Err-err-err-err-err
Value: 9, Label: Beepbeepbeepbeep (Default)
Value: 10, Label: beeeep-beeeep-beeeep
Notification to Play
Value: 1, Label: Primary
Value: 2, Label: Secondary
The most important parameter to be able to set dynamically is #7, since without it, I can only trigger one notification sound. Of course, it’d be nice to be able to set all of them if possible.
and I know how to link channels to Items to dynamically modify their values. What I don’t know is - how do I link a channel to an existing configuration parameter (or a function of a device)?
I can see that configuration parameters are configured like this:
so the link has to be the name, right? Do I just create a new channel whose id is the name of the configuration parameter? I’m assuming the parameter names (e.g. config_1_2) must come from the device’s documentation. This all seems too simple though.
Is there any documentation I can use to better understand the linkage so I can set this up myself?
In the CONFIGURATION class, it has a channel called config_decimal, and this has a configuration of parameter=7. So, this will provide you a channel linked to parameter 7 that is a decimal type.
You will need to add the same sort of thing to the database for your device.
I hope this helps - apologies for the slow/limited response as I’m currently on holiday with limited time and access to internet…
Thanks @chris! I noticed you updated the URL, and I really appreciate it. I don’t see the channel called config_decimal for that Thing, but in searching the OpenHAB GitHub, I came across what I think you’re referring to. Pasting the examples here for my reference and for anyone else who might search in the future::
Maybe you need to log in to the database to see the channels - it is there.
You need to update the database to get this working - I don’t generally accept PRs for database changes without the database being updated as it will just get deleted next time the database is exported.