-
Notifications
You must be signed in to change notification settings - Fork 482
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
Extending to full HA profile #5
Comments
Hi sjlb197, did you already got the thermostat to join the RaspBee network? Since you already use the REST API I would recommend to clone the repository and extend the API with the needed thermostat functionality. For example by implementing a /thermostats endpoint in the same way the /lights endpoint was done. Be aware that the REST API plugin is written with help of the deCONZ C++ API. I'm not sure how complex the thermostat interface is (clusters/commands/attributes) but if only reading out data like temperature is needed it should be fairly easy todo. |
Hi manup, Yes, I have got the thermostat to join the RaspBee network, although it cannot control it at the moment. I am waiting for a firmware update on the thermostat, and this may be the cause of not being able to control it. I have also seen some more detailed instructions on one of the other issues here on GitHub about how to setup a network for HA profile devices - I will try going through that also. The thermostat supports the thermostat cluster (0x0201) and the temperature measurement cluster (0x0402), as well as on/off (0x0006). I will need to send target temperature values to the thermostat, as well as on/off, and will also need to set attribute reporting for the measured temperature attribute. I agree that this should be reasonably easy to achieve. Many thanks for your advice. Steve |
I actually have some follow-on questions please. I am able to compile the REST API, either using the provided makefiles and command (qmake-qt4 && make), or by opening the project in Qt Creator and building from there. My questions are:
Many thanks in advance! Steve |
Hi Steve, the following answers should shed more light on the plugin build process.
After building the plugin with the commands
After restarting deCONZ the new plugin will be loaded automatically.
Right now it's not possible to build a standalone application without the deCONZ GUI running. However a headless lightweight version of deCONZ shall address this. There is no fixed release schedule for the headless version set but it should be available later this year.
Related to the thermostat and ZCL attribute reporting you may refer to the secion 7.2.3 configure attribute reporting of the deCONZ user manual since you can setup reporting without writing code.
The UI will update automatically the attribute table after reception of a ZCL attribute report. |
Hi Manuel, Again, many thanks for your reply. I have copied the new shared object as you described; I seem to now have two menu entries for the REST api in deCONZ. One item opens the old app, and the other opens the new app (I made a trivial change to add a label to the widget, so that I can see which version it is, old or new). I also tried making a change that would be visible over http. I changed the port number to 8082, and changed the RaspBee-GW name. When I try to connect using my web browser, I cannot connect on 8082, only 8081 which is what I provide with the --http-port option to deCONZ. Also I only see the old name RapBee-GW. I would guess that this is because deCONZ is somehow picking up the original shared object from somewhere, and cannot connect to two different objects, so I just see the original behaviour. Do you know what might be causing these problems? Apologies if my explanation isn't very clear. Please let me know if I need to clarify anything. Many thanks, and regards, Steve |
Hi Steve, Did you remove the old library from /usr/share/deCONZ/plugins/ I initially did a rename of of the old library but it was still loaded. A move to another directory resolved the problem for me. |
Hi Willem, Ah, OK. No, I have only renamed. I'll move to another directory. Many thanks. |
Thats true the original library has to be either removed or replaced because deCONZ will just load everything from the plugins directory on startup. Also note that the |
I can confirm that indeed moving the old .so rather than just renaming fixes the issue. Thank you. It's just going to take me a little while to work out how to add similar /thermostats functionality (I just get a 404 error at the moment). I'll keep working on that. Many thanks for your advice and input. Steve |
The The reason why the RaspBee-GW name does not change is because the name and other configuration parameters are stored in a sqlite3 database file. The name can be changed either via REST API or in the WebApp. Youre welcome if you have anymore questions always feel free to ask :) |
Hi Manuel, Yes, the --http-port command line option does work. I was trying to override in the plugin source code, only to be able to show that the correct shared object had been picked up. But I've shown that now so that's fine. I do have another question please: I noticed that debug prints are present in the code, and I think these would be useful. By running Many thanks, Steve |
Hello Steve, Where type can be error, info, aps, zdp, zcl, zcldb, http. The level parameter defaults to 0 (no debug output) and can be set up to 2. The debug output can be quite noisy :) |
Hi Manuel, Ah of course, thank you. I'm quite used to looking at noisy debug output so that should be fine. I'll start off by making it noisier anyway :-) Work is keeping me quite busy at the moment, but hopefully I'll get a little time to look at this as well. Many thanks. |
Hi Manuel, Just taking a quick look at this now, now that I have the debug logging turned on (http and info to 2) it looks like my HTTP GET isn't getting as far as the plugin. For a GET request to /api//lights I see an "HTTP API GET" debug message. The 404 response my REST client receives is the "This is not the page you are looking for" response. Do you think I'm correct in my analysis (that the response I get for /thermostats is generated by deCONZ, not the plugin)? For now I'll try adding to the /lights endpoint instead. Many thanks, Steve |
Hi Steve, have a look into the file de_web_plugin.cpp, I guess the HTTP request is filtered. Did you already add it to the After a request passes the filter it shall be handled in the broker method |
Hi Manuel, No, indeed you are correct I didn't add it to the isHttpTarget method. Many thanks for the pointer. Steve |
Hi Steve & Manuel, I'm reading your convo with much interest as I just got my Raspbee. Works with deCONZ REST API plugin nicely. However, I am also looking to extend the API beyond just lights to switches, motion sensors and door sensors. I have to admit it felt hopeless until I chanced upon this thread. Looks like it's possible! Was wondering if there is some documentation available somewhere with step-by-step guide? Many thanks in advance! Regards, |
Hi Steve, Your last update made it look like you were just one step away from a functional addition. any chance you could submit a pull request? Even if it wasn't accepted the changes would be listed and it would be a great help to people looking to add functionality! |
I'm afraid I'm very much further away than that ... Work and life have prevented me from making any progress ... The issues I was having were initial issues trying to get anything working, so whatever I had was in the very early stages.
Apologies,
Steve
|
Closing the oldest issues for know to tidy up the tracker and duplicates in newer issues. |
Merge pull request from dresden-elektronik/master
Update code with last official version
…an event for Button 1 for any button pressed. This switch has a situation where it sends the same endpoint/cluster/command ID for every button pressed and only makes the distinction between buttons via payload value. The current logic in `DeRestPluginPrivate::checkSensorButtonEvent()` currently does not support this type of distinction, and the button map (field dresden-elektronik#5) only seems to support the first digit of the payload value and not the full payload value. Therefore all of the information that distinguishes between the buttons ends up being ignored and the button events are being sent as the first mapped entry (button 1). This commit changes the logic within `DeRestPluginPrivate::checkSensorButtonEvent()` to allow the value of the button pressed to be modified once a valid mapped entry has been found, and adds specific logic for the Eria Adurosmart Wireless Dimming Switch to change the button value based off of the payload value.
This isn't an issue, so my apologies if this isn't the correct place to raise this question.
I would like to use my RaspBee module to control HA profile thermostatic radiator valves (thermostat and temperature measurement clusters). I'm using OpenRemote at the moment to communicate over the REST API to deCONZ, and so I have a question about how best to communicate with my radiator valves.
Am I going to be able to extend the REST API to support my devices, or might I be better off using the C++ API to deCONZ?
Many thanks in advance for any assistance.
The text was updated successfully, but these errors were encountered: