I am new to OpenHAB. Currently I am looking for an automation platform for our smart office project. OpenHAB seems interesting to me. However, in order for my project to work, I need it to support multiple users configuration, i.e. different users will have different access to the “things” in the office. And also I should be able to configure automation rules based on different users login/detection.
For example, user A walks into the office and his/her office light and the aircon will be turned on. If user B walks into the office, his/her table lamp will be turned on.
Is this user based framework already available in OpenHAB? Or someone has started working on it already? If not, what will be a best way to implement this?
There is no built in way to give fine grained access to different things based on user. You can have multiple users but they all have the same access to everything.
There is no way to determine who is logged in.
I’ve thought a little bit on this and without massive work changing OH itself, I would set up a reverse proxy which handles the logins and forwards to a custom sitemap that only has the things that user can control on it.
If you want to use a reverse proxy see ngnix or apache programs. If you want to add something to OH itself, head on over the Eclipse SmartHome project as that is likely where the changes would need to take place.
Well that’s a little nuisance when unnecessarily expanding your system.
I’ve a plan to implement OH2 in my very apartment, which has 4 guys.
To think about each user must have a specific device => that would cost a lot. And what would happen if some more new guys move to my apartment? What is the thing should do then?
Just my thought, I hope you can suggest some solutions
Looking at it from another perspective. Imagine a system which is using for example a multi room audio like sonos. You would expect that each user has access only to a limited number of speakers. So OH would not only need tho limit that per item, it would ned to limit possibility to group all boxes. However that is a function from within sonos, in other words the connected system.
I’d say for such a system of systems a complete multi user functionality can only be integrated up specific limit.
Well I have a very clumsy idea to start, but since I’m not a developer so I dont know how to do it.
My idea also similar to one of the comments above. We creat multiple .sitemap files on our OH2 server (demo.sitemap, demo1.sitemap…). Then we can use something like nginx to redirect our web browser to one of those sitemaps based on the priority level of our account. For example, I enter user name like admin or root, the password might be anything on earth, the browser will redirect me to demo.sitemap with the display of full items. On contrary, others account will lead me to other sitemaps with less items on it.
But I dont know how to configure it with nginx, please show me how?
I would caution on that fork that it appears to be an academic project and the developers appear to have lost interest in it since publishing their paper. I would be very cautious in adopting that fork as it is already almost seven months out of date and will only continue to become more so over time.
It really was unfortunate that they did not try to integrate their solution into the baseline, though there are aspects of their approach that, at least to me, feel a little hacky and not consistent with a good longterm solution that fits with the OH and ESH architecture. But that is based more on a feeling and less on concrete examination of the code. If the authors are on this forum and see this, I’d love to talk about it.