-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[nikohomecontrol] Support for accesscontrol action #11868
Comments
@toonvl I have included access control in a development branch of the Niko Home Control binding. It should create access control things with 2 channels, the bell and the door lock. I have no access control devices, so cannot test myself, but if you are willing to test, you can download the compiled .jar version here. This development version has new functionality for NHC I energy and for NHC II access control. I need it tested before I can submit this for review. I have no testers so far for access control. Also, there is still a pending PR with thermostat improvements. These enhancements build on top of that, so I will only submit if the previous PR has been reviewed and the enhancements have been tested. If you are OK with this, please test the development version specifically for access control and let me know how it goes. Chances are there are still issues. Provide debug logs if there are issues and I will try to resolve. |
Hi @mherwege, thanks! I'm trying to test, I've now installed 3.3.0 snapshot on my pc. I have put the file in the addons folder, but I can't see it in openhab. Do you have an idea of what I'm doing wrong? |
Hi @toonvl . The location looks right to me. You may have to install the mqtt binding as wel to make it work. To check if the binding is active, use bundle:list and search for niko in the karaf console. |
@toonvl Please download the jar file again (same link) and try once more. I had a bug introduced in the binding because of some refactoring that blocked everything but the bridge from being added. Things were discovered, but failed starting when being added. |
Hi @mherwege I keep getting the following issues, before and after starting over from an empty folder and unpacking 3.3.0-SNAPSHOT again, installing mqtt binding and then adding the jar file when openhab is shut down. io.reactivex.exceptions.UndeliverableException: The exception could not be delivered to the consumer because it has already canceled/disposed the flow or the exception has nowhere to go to begin with. Further reading: https://github.com/ReactiveX/RxJava/wiki/What's-different-in-2.0#error-handling | java.util.NoSuchElementException: No value present I keep the Niko Home Control II Bridge on my 'main' openHAB 3.2.0 installation on the RPI disabled while testing this. |
@toonvl I fixed that error. Try again with the new version, same link as before. |
@mherwege I think the problem was running it on a machine with Java 15 instead of 11. I have now installed it on a Mac with Java 11 installed (Zulu build of OpenJDK). Everything is working well on there, I can add the bridge, add the lights, add the access control. I have created things for a light, the access control doorbell and lock. When testing the doorbell and lock however, nothing happens. I have checked the MQTT topics and I saw that only changing the doorbell state give a command message
with the following error message:
when you ask the API for the devices list this is how the access control device looks like:
So for some reason my device is missing the BasicState property, it is in the API documentation however. Do you know if we could do something with that button id somehow? The MQTT command message that works for me is:
But currently the lock channel is not sending out any messages to the controller. I do see events in the events log, but no specific warnings or errors in the openhab log. Do you have any idea why the lock channel is not sending out MQTT messages? |
@toonvl Did you test with the updated version I posted 4h ago? There was an issue with mixing basicState and doorlock properties in my code before. |
@mherwege I am using the latest version, to be sure I downloaded it again now, and replaced it, but it still has the same effect. |
@toonvl I found another bug, the doorlock channel was not correctly updated. There is a new version loaded. For further feedback: I understand unlocking is the most important part. However, I don't want to put something in the code that is half baked. Making the lock work is the first step. I may reconsider the structure afterwards. It would be best if we could always have the bell signal, but that may not be possible. |
@mherwege I definitely agree in getting it right! I'm glad to test. I have installed the latest version from dropbox, but still the same result. I can't see any of the commands from the Niko app, it must be using a different way of communication. I have set the log level for niko home control to TRACE and have first switched the state of a light a few times and then the lock: Changing the lamp:
Changing the lock status:
For the lock I'm missing the rol.internal.protocol.nhc2.NhcAction2 and ol.nhc2.NikoHomeControlCommunication2 lines |
What is the status of the item when you give the command? It may be an issue with mapping from on/off to open/closed. I can only give an open command, so it could be it is mapped the wrong way around. |
It's always 'Closed'. When I send the command via MQTT it switches to 'Open' for 5 seconds and then goes back to 'Closed' in the event topic /hobby/control/devices/evt: So Closed is the normal state in the controller. If you mean in openHAB, I've tried waiting for more than 5 seconds and then switching again, but that gives the same What I do notice is that I indeed see only something in the logs when changing from OFF to ON. Maybe you can try to change the logic to make it do something when changing from ON to OFF. Maybe that could give a clue? |
@toonvl I think I found the problem. I didn't correctly interpret the feedback I received from the Niko Controller, leaving the door unlocked all the time in the eyes of OH. That should be solved, and you should now see the door locked (switch true) when it is locked, hence giving a command would switch it to on, which is unlocked. Fingers crossed this is the last issue on this part. Then we can look at what to do with the bell. A new version is uploaded. |
@mherwege the lock is now working as expected. Default state locked is now ON in OH and it sends the command if switched to OFF, and state is following properly, switching back to ON when the lock status changes again. I'm just not sure if I would have switched them around, with locked being OFF in OH and ON in OH meaning unlocked. I'm now trying to install it in my main OH installation and using it in combination with the homekit integration, but I'm having issues with it being recognised. I'll keep you posted. Do I need to change the lock behaviour so we can see if in ring and come in mode it will have the basicstate property as well? |
@toonvl I used the locked = ON convention also used in the Homekit, Google and Alexa integrations. Bindings I looked at with locks also use this convention. And so does NHC itself. |
@mherwege makes sense if that's the convention 😄 I have pressed the bell button and I found these messages in the evt topic:
I think the callstatus can be interpreted like:
the Uuid is not one that I recognise from the devices list though, it's not the same as the acces control device, so I hope this is enough to work with? |
Interesting. Did you try searching the full log for that Uuid? I am surprised it doesn't show up anywhere else. Without further info, it looks like impossible to link this to the right doorlock. If you are OK with this, you can send me a full log, including a binding start, by private message in the forum. |
@mherwege I don't know how to send you a private message here? Now that I have changed to ring and come in I can see in the events that it is indeed toggling the basicState, but since doing that I can't find the acces control device anymore in the devices list when I send the devices list command in MQTT. I hope they did not remove access in their latest update to the hobby API or something? what do you think? |
You can’t here, but you can in the forum (community.openhab.org). My handle is the same. I would be surprised Niko changed the API. You did not do a controller update, did you? Then it cannot have changed. |
@mherwege I created a user in the community forum with the same handle as well (@toonvl) |
I have a doorlock and niko doorbell with videophone ( 550-22001) connected to our niko home control II system. This is controllable in the app, but I would like to be able to link this to openHAB as well so I can control it via homeKit. I have tried sending the corresponding MQTT message, based on the API, and this works fine. I however cannot add it in openHAB as the action type is currently not supported.
Environment
openHAB 3.2 with Niko Home Control Binding
running in Docker container openhab/openhab latest ( OpenJDK Zulu 11.52.13 ) on Docker 19.03.15
running on a rPI 3B+ running raspbian Bullseye
The text was updated successfully, but these errors were encountered: