openhab / org.openhab.binding.zwave

openHAB binding for Z-Wave
Eclipse Public License 2.0
170 stars 202 forks source link

Add support for COMMAND_CLASS_SOUND_SWITCH #1245

Closed bwosborne2 closed 2 years ago

bwosborne2 commented 4 years ago

This device needs significant binding updates.

"there are significant code changes required to support this device as it uses a new command class." from https://community.openhab.org/t/aeotech-doorbell-6/79278/42

Also, since the database maintenance, this device is no longer visible in the summary.

cdjackson commented 4 years ago

As I sort of indicated earlier, please can you make these issues standalone rather than just referencing messages in the forum. It might seem fine now, but it takes a lot of time later to work out what the issue is, and it would really be appreciated if the actual issue, and the required change could be added to the issue list rather than a link to a long conversation.

Thanks.

bwosborne2 commented 4 years ago

Is there any way I can tell what classes the binding recognizes to determine what is missing? Your original posts merely said,

"It looks like the device is using a new device class that needs to be added to the binding before the device can work. I will look into this tonight if jetlag doesn’t get the better of me!"

and later

"The XML file will not be created until I add the new device class - as mentioned in my previous message."

I can compare with the manual if I know where to look. Manual for Siren 6 ( the same device) is here.

bwosborne2 commented 4 years ago

From the docs, this appears to be the command classes for this device. I am not sure which one is missing.

GENERIC_TYPE_AV_CONTROL_POINT SPECIFIC_TYPE_SOUND_SWITCH COMMAND_CLASS_ZWAVEPLUS_INFO COMMAND_CLASS_SECURITY COMMAND_CLASS_SECURITY_2 COMMAND_CLASS_SUPERVISION COMMAND_CLASS_ASSOCIATION COMMAND_CLASS_ASSOCIATION_GRP_INFO COMMAND_CLASS_MULTI_CHANNEL_ASSOCIATION COMMAND_CLASS_NOTIFICATION COMMAND_CLASS_SOUND_SWITCH

kennetn commented 4 years ago

I was thinking about trying to implement this, but is there a good place to start when trying to understanding the code / design ? I have been looking at the comments in the code but I was just thinking if there was a better place to start?

bwosborne2 commented 4 years ago

@cdjackson is the expert on this code. I am just a user that has been helping with the device database.

cdjackson commented 4 years ago

@kennetn please define what channels you see as being required and I will try and look at coding up the command class soon.

kennetn commented 4 years ago

@cdjackson thanks for your help. When trying to figure out the channels and understanding how the device worked I was looking at the zwave debug log. I could see that the door bell was sending a notification in addition to the COMMAND_CLASS_SOUND_SWITCH when I activated the ring button. I found that the notification was using the alarmtype 14 (siren) that was not supported and causing the alarm to be null. My initial quest was just to get the notification working when the ring button was activated, so I was just about to open a new issue when I found that you just added alarmtype 14 today in https://github.com/openhab/org.openhab.binding.zwave/commit/3d6c4ebf292a217222a3fbb0f035afc5141adca0. So maybe this will make the notification work when the ringer is activated. It is a bit late now to be playing with the door bell but I will try it out tomorrow.

Regarding the channels for the COMMAND_CLASS_SOUND_SWITCH I am still trying to get a understanding of how this command class works. I am a bit unsure how you normally handle information that requires a zwave command to be queried. For instance the number of tones supported by a node can be queried with a command "Sound Switch Tones Number Get Command" so it would be possible to create a channel with this information. But I guess that will require that the binding always query the node regardless if the channel is used or can you see if a channel is using in the binding ?

The primary channels of interest would be to set tone and volume but I will look more at this tomorrow.

cdjackson commented 4 years ago

Thanks. Please can you provide the full information about the alarm that is produced - alarm type 14 does not provide enough information - I need to also know the event IDs that are sent.

If this is the main thing that is needed to get some functionality for this device, if you let me know the information above I will add this to the binding tomorrow.

Thanks Chris

On 4 Jan 2020, at 22:42, kennetn notifications@github.com wrote:

@cdjackson https://github.com/cdjackson thanks for your help. When trying to figure out the channels and understanding how the device worked I was looking at the zwave debug log. I could see that the door bell was sending a notification in addition to the COMMAND_CLASS_SOUND_SWITCH when I activated the ring button. I found that the notification was using the alarmtype 14 (siren) that was not supported and causing the alarm to be null. My initial quest was just to get the notification working when the ring button was activated, so I was just about to open a new issue when I found that you just added alarmtype 14 today in 3d6c4eb https://github.com/openhab/org.openhab.binding.zwave/commit/3d6c4ebf292a217222a3fbb0f035afc5141adca0. So maybe this will make the notification work when the ringer is activated. It is a bit late now to be playing with the door bell but I will try it out tomorrow.

Regarding the channels for the COMMAND_CLASS_SOUND_SWITCH I am still trying to get a understanding of how this command class works. I am a bit unsure how you normally handle information that requires a zwave command to be queried. For instance the number of tones supported by a node can be queried with a command "Sound Switch Tones Number Get Command" so it would be possible to create a channel with this information. But I guess that will require that the binding always query the node regardless if the channel is used or can you see if a channel is using in the binding ?

The primary channels of interest would be to set tone and volume but I will look more at this tomorrow.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/openhab/org.openhab.binding.zwave/issues/1245?email_source=notifications&email_token=AAH6IQ3YMI3TIHAPK64SCRLQ4EGF5A5CNFSM4JAEC7B2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEIDB3DA#issuecomment-570826124, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAH6IQ5HFSQ24UHAIGEXKPDQ4EGF5ANCNFSM4JAEC7BQ.

bwosborne2 commented 4 years ago

Do we need to import the xml file again into the database? I believe I still have the original files.

cdjackson commented 4 years ago

No - importing the XML won’t help at this point. Once the XML has been imported once, the only changes that can occur by importing another XML is to update the type/ids.

On 4 Jan 2020, at 23:19, bwosborne2 notifications@github.com wrote:

Do we need to import the xml file again into the database? I believe I still have the original files.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/openhab/org.openhab.binding.zwave/issues/1245?email_source=notifications&email_token=AAH6IQ43L6W7MS2Z6CGIRZLQ4EKOXA5CNFSM4JAEC7B2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEIDCMBY#issuecomment-570828295, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAH6IQZCFHCXIKJNUJJMEXLQ4EKOXANCNFSM4JAEC7BQ.

kennetn commented 4 years ago

I added another issue with the missing support for alarmtype 14 (siren) . #1284

cdjackson commented 4 years ago

Thanks. I’ll try and have that added shortly.

On 4 Jan 2020, at 23:28, kennetn notifications@github.com wrote:

I added another issue with the missing support for alarmtype 14 (siren) . #1284 https://github.com/openhab/org.openhab.binding.zwave/issues/1284 — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/openhab/org.openhab.binding.zwave/issues/1245?email_source=notifications&email_token=AAH6IQ7HQOBV5T343ZQFNTTQ4ELQFA5CNFSM4JAEC7B2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEIDCQWQ#issuecomment-570828890, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAH6IQY446KWOMWRWIBGTLDQ4ELQFANCNFSM4JAEC7BQ.

kennetn commented 4 years ago

Hi @cdjackson

I Finally had a bit of time to look at this command class. I only looked at version one of the command class so far.

What I can see is that the commands supported can be divided in 4 groups.

  1. Number of tones that has 2 Commands
  2. Get tone information that has 2 Commands
  3. Change volume and tone that has 3 Commands
  4. Start playing tones that has 2 Commands.

1. Number of tones

This is a simple value that is read from the device. I suggest a channel called.

1-1. "Number of tones" with a number ( read only )

I am a bit unsure how you normally handle these very static channels. Is it possible that you can just read the value once after the node is connected or would you need to have another channel to indicate that the value should be read?

2. Get tone information

For these I would suggest one channel called

2-1. "Get tone information" with a number

This channel should be updated with the tone number that is then returned in the three channels called.

2-2. "Tone Identifier" with a number
2-3. "Tone Duration" with number that is playing time in sec
2-4. "Tone Name" with string

These three values are received in the same message so I guess that it would be most easy to use if the Identifier channel is updated last. I can see that using this is a bit of protocol on top of protocol and I am unsure if this is the "normal" way to handle this? 

3. Change volume and tone

The set command can be send individually for volume and tone. Therefore I suggest two channels

3-1. "Default tone" with number
3-2. "Volume" with number that is percent from 0 to 100

Again I am a bit unsure when the channel should be updated with status from the device I would guess this only needs to be done after a change is send to the device with a set command.

4. Start playing tones

I would suggest a channel called.

4-1. "Play tone" with a number or the value "DEFAULT" or "OFF"

When this channel is updated the device starts playing. Maybe you could also use DEFAULT when any value that can not be converted to a number is received.  If the device is activated via the ringer the Report command will be updated and I suggest that this is used to update the channel with the number of the currently playing tone. Once the tone stops playing it will be set to 0 by another Report command. I do not see a reason to implement the Get command unless there is some meaning full background scanning that can be activated.

Was this the type of information you were looking for ? For me and I guess many others the 1 and 2 is not so useful so in a first version it would be fine to skip these.

bwosborne2 commented 4 years ago

This is used for 2 variants of a device. One is an alert siren and the other is a doorbell.

chrismcgarry commented 4 years ago

Don't know if this helps but here's the engineering spec for the doorbell. I've had this device since July so keen to help out to get it working.

There's quite a lot of info in the doorbell engineering spec and examples too is that what you need @cdjackson? SPEC-ZW162 Engineering Specification - Doorbell 6 - Aeotec - 2019.03.01.pdf

cdjackson commented 4 years ago

Thanks, but the spec here is not needed.

I thought that the doorbell now worked after the notification was added a few weeks back?

On 16 Jan 2020, at 22:49, chrismcgarry notifications@github.com wrote:

Don't know if this helps but here's the engineering spec for the doorbell. I've had this device since July so keen to help out to get it working.

There's quite a lot of info in the doorbell engineering spec and examples too is that what you need @cdjackson https://github.com/cdjackson? SPEC-ZW162 Engineering Specification - Doorbell 6 - Aeotec - 2019.03.01.pdf https://github.com/openhab/org.openhab.binding.zwave/files/4074025/SPEC-ZW162.Engineering.Specification.-.Doorbell.6.-.Aeotec.-.2019.03.01.pdf — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/openhab/org.openhab.binding.zwave/issues/1245?email_source=notifications&email_token=AAH6IQY6OBCNSTVNGEDPNPDQ6DP7XA5CNFSM4JAEC7B2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEJF2QTQ#issuecomment-575383630, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAH6IQZ5UJHEOG3UEA4QKKLQ6DP7XANCNFSM4JAEC7BQ.

kennetn commented 4 years ago

I thought that the doorbell now worked after the notification was added a few weeks back?

Yes the notification part is working with 2.5.1 (thanks a lot). However the command_class_sound is still needed because it is not possible to adjust the ring volume without the class and the default volume is really really loud. I got a round this by using some other home automation software (hoomseer) to set the volume and then changing back to openHAB, but for most users this is not really a usable solution. In addition I would also like to use the door bell as a siren for my alarm system and this also requires the command_class_sound. Aeotec also sells a siren sepperatly that I guess also use this command class that will need this calls. I think most users of the device will need to have the channels 3-2 and 4-1 that I described above.

cdjackson commented 4 years ago

Sure - I understand that there's functionality that's not supported - I was just responding to the comment that "this device isn't working" where I think the primary function does work.

It's not about not knowing what I'm doing, or looking for information - the issue is simply time. I'm currently working through some autogenerated command classes - once that is done I will use that generated code to provide some of the functions in this class.

chrismcgarry commented 4 years ago

Is there a steep learning curve, anything I could do to help? I've done plenty of Java development in the past and I'm very grateful for everything you've done @cdjackson so maybe time for me to try and contribute back.

cdjackson commented 4 years ago

Is there a steep learning curve

Yes.

However the other point here is that I don't want to waste my time doing something half baked. There are major changes required for the binding over the coming months, and to support that I need to do some background work (which I'm doing now). Once that is done I can use that to generate what's needed here.

Hopefully in a week or two I'll have that done and can look at this (hopefully it will be reasonably easy then).

bwosborne2 commented 4 years ago

It is my understanding the siren is basically the doorbell packaged without the buttons. They sell them separately to turn the siren into a doorbell.

Nadahar commented 4 years ago

It is my understanding the siren is basically the doorbell packaged without the buttons. They sell them separately to turn the siren into a doorbell.

This is my understanding as well. I have the "Siren 6" only, and right now I can't do anything with it. As far as I understand, "Doorbell 6" is "Siren 6" + one wireless (non z-wave) button. These buttons can also be bought separately and it is possible to "pair" up to 3 such buttons to one siren. The "button functionality" isn't really related to z-wave (or openHAB), since this is a (closed) system between the siren and the buttons. The only thing about it that concerns z-wave apparently, is that you can get a report sent when the "doorbell function" is activated (by someone pushing the button).

As a siren it doesn't seem like it can do anything at the moment using openHAB. As far as I can understand, the "sound switch" command is what is needed to be able to tell the siren to do anything at all.

yehudamm commented 4 years ago

Hi,

Are there any updates on supporting aeotec doorbell in openhab?

Thank you

bwosborne2 commented 4 years ago

I know Chris is working on totally rewriting the Z-Wave binding. I am helping him with some of the back-end programming changes for the new database. Like most managers I suspect he is especially busy with his day job with people working from home.

kennetn commented 4 years ago

I know Chris is working on totally rewriting the Z-Wave binding. I am helping him with some of the back-end programming changes for the new database.

Do you know where this development is taking place? I can not find any branch that looks like it is being worked on

bwosborne2 commented 4 years ago

My understanding is that the current binding was developed bu reverse engineering device behaviour. Chris is working on developing a binding based on the published standards, likely in a private repository. It is expected to be quite some time before that would be usable.

In addition, I an assisting in moving the Z-Wave device database to a website with a different host and framework. It too is incomplete and unusable at the present time. I am working through some code migration issues.

kennetn commented 4 years ago

Hi @cdjackson Is it possible that you can comment on the status of this "total rewrite" process? I was starting to look at implementing this but I do not want to do a lot of work if a rewrite is just around the corner. Maybe I can help with the rewrite instead ? Sorry if it sounds like I am pushing, that is not my intention I know we are all volunteers.

RudiTholen commented 3 years ago

Any news on the ZW164 (Aeotec Siren 6) to get it working with openhab? With ‘Z-Wave PC Controller 5’ I can let the ‘siren 6’ make all sounds at all volume levels, which I desire (from my PC) but with ‘openhab’ on my PI, I can only ‘monitor’ but not control the siren!

Is there any hope to get it working in OpenHab, or am I missing an important clue? Rudi Tholen

bwosborne2 commented 3 years ago

I know Chris has been working on major binding improvements during these large openHAB changes. Currently the large project is moving the device database, affecting all devices. I think Chris was hoping some user would be able to contribute to make this work. I believe he is currently focusing his efforts to benefit the largest number of users & devices.

RudiTholen commented 3 years ago

I do understand the hectic but I'm just hoping that a quick solution is possible. In my naivety, I thought it must be possible, to send the z-wave command in a easy (and perhaps temporary) way like:

init the alarm: 'Command sound switch' 0x79
'Soundswitch configuration set' 0x05
'Volume' Init 0xnn 'Default Tone identifier' 0xnn

Play the sound 'Command sound switch' 0x79
'Sound switch tone play set' 0x08 'Tone identifier' 0xnn

resulting e.g. in code for the siren: 79 05 1F 11 (Select Volume and tone)
79 08 11 (Play selected tone)
79 08 00 (Stop Tone)

and that I'm not the only one, with the same problem ;-)

Rudi

kennetn commented 3 years ago

I made a beta version that allows playing tones and setting the volume from rules. I put up a complied version in my fork. There are other issues with it, but for what I wanted to achieve it works. Please note you should not expect support for this version.

yehudamm commented 3 years ago

@cdjackson

Hi Chris,,

Could you update us on when we can expected to get Openhab control the Siren of this device? This is the main functionality of this device and I believe most of us are looking to operate it.

Thank you

JimCzuprynski commented 3 years ago

@cdjackson -

Chris, though I'm a noob with Openhab, I'd be more than happy to help out with building + testing the interface to the ZW164 doorbell and siren. It'd be nice to get this working so that we could control the siren via rules.

JimCzuprynski commented 3 years ago

I made a beta version that allows playing tones and setting the volume from rules. I put up a complied version in my fork. There are other issues with it, but for what I wanted to achieve it works. Please note you should not expect support for this version.

So for us noobs: what do we need to do to implement your solution, please? I know it's not supported but it'll be a worthwhile experiment on my part if I can help out the community.

bwosborne2 commented 3 years ago

I believe the current support work is already in the Z-Wave binding. It is only partial though. The full solution requires more work and the binding is due to be rewritten.

JimCzuprynski commented 3 years ago

Thanks for the response! I've scanned through most of the listings and code here, but to me it's unclear that there's a way to activate any of the doorbell or siren features from within a rule or script. Is that an accurate assessment? Or can anyone point me to an OpenHAB example of actually activating the siren / doorbell in this manner?

kennetn commented 3 years ago

This is how I configured my items. Switch alarm_system_siren "Alarm siren" { channel="zwave:aeotec_zw164_00_000:controller:node12:notification_siren1" } Switch doorbell_ringing "Door ring" { channel="zwave:aeotec_zw164_00_000:controller:node12:notification_siren3" } Number doorbell_play_tone "Playing tone" { channel = "zwave:aeotec_zw164_00_000:controller:node12:play_tone" } Dimmer alarm_volume "Alarm volume" { channel = "zwave:aeotec_zw164_00_000:controller:node12:volume" }

In the rule I write: doorbell_play_tone.sendCommand(17)

chrismcgarry commented 3 years ago

Is that using your fork @kennetn?

I've had the doorbell sitting in a box now for 1.5 years so would really like to get it working!

JimCzuprynski commented 3 years ago

Awesome, @kennetn! I saw your previous posts as well – I’ll give this a try.

To echo @chrismcgarry tho - do we need to apply the code in your fork to make this work, or to the best of your knowledge has this already been applied to the ZWave binding as of 13 December 2020?

kennetn commented 3 years ago

Is that using your fork @kennetn?

I've had the doorbell sitting in a box now for 1.5 years so would really like to get it working!

Yes thai is with my fork.

JimCzuprynski commented 3 years ago

So just a dumb question from a newbie again: Do we just shut down OpenHAB, install your JAR in place of the existing one, and restart? Sorry, didn't see installation instructions.

alamers commented 3 years ago

I am trying to get @kennetn 's solution working but only partially succeeded so far. Here's what I did. Since I am running 2.5.11, I forked his fork, merged in the 2.5.11 changes and compiled it. But you may as well try the compiled jar from kennetn.

Findings so far:

openhab-bot commented 3 years ago

This issue has been mentioned on openHAB Community. There might be relevant details there:

https://community.openhab.org/t/indoor-siren-6-and-doorbell-6-zw164-from-aeotec-still-difficulties-to-set-to-work/114759/2

openhab-bot commented 3 years ago

This issue has been mentioned on openHAB Community. There might be relevant details there:

https://community.openhab.org/t/indoor-siren-6-and-doorbell-6-zw164-from-aeotec-still-difficulties-to-set-to-work/114759/5

openhab-bot commented 3 years ago

This issue has been mentioned on openHAB Community. There might be relevant details there:

https://community.openhab.org/t/aeotech-doorbell-6/79278/62

openhab-bot commented 3 years ago

This issue has been mentioned on openHAB Community. There might be relevant details there:

https://community.openhab.org/t/aeotech-doorbell-6/79278/73

openhab-bot commented 3 years ago

This issue has been mentioned on openHAB Community. There might be relevant details there:

https://community.openhab.org/t/aeotec-zw162-setup/121471/4

nza-dk commented 3 years ago

I just spend a whole day setting up a build environment for openHAB version 3.1, downloading the source for the z-wave binding, merging @kennetn's changes and getting it all compiled.

I uninstalled the original 3.1.0 binding and copied my compiled jar to the bindingsfolder, re-included my Aeotec Siren 6, and it just works beautifully!

I get no errors in my z-wave log, no errors in openHAB and it just responds fast and accurate.

Why has this not been added to the official repo? May I try to submit your work in a pull-request @kennetn?

kennetn commented 3 years ago

I just spend a whole day setting up a build environment for openHAB version 3.1, downloading the source for the z-wave binding, merging @kennetn's changes and getting it all compiled.

I uninstalled the original 3.1.0 binding and copied my compiled jar to the bindingsfolder, re-included my Aeotec Siren 6, and it just works beautifully!

I get no errors in my z-wave log, no errors in openHAB and it just responds fast and accurate.

Why has this not been added to the official repo? May I try to submit your work in a pull-request @kennetn?

Hi

I have No issues with you making a pull-request. I think there are somethings regrading automatic discovery that is not working and status.

brydling commented 2 years ago

I just spend a whole day setting up a build environment for openHAB version 3.1, downloading the source for the z-wave binding, merging @kennetn's changes and getting it all compiled.

I uninstalled the original 3.1.0 binding and copied my compiled jar to the bindingsfolder, re-included my Aeotec Siren 6, and it just works beautifully!

I get no errors in my z-wave log, no errors in openHAB and it just responds fast and accurate.

Why has this not been added to the official repo? May I try to submit your work in a pull-request @kennetn?

Hi @nza-dk,

Any chance you can upload that jar for me to test?

Would be awesome if you want to make a pull request out of @kennetn's work 👍

Regards, Niclas