My openhab restricted accsess

Hi all,
Is there a way I can give my family accsess to the door_open_family item only so that they can add a do (ifttt) button to open the door to my flat. In addition I have made a rule that check my calender :

rule family opening of door
if door_open_family changed from OPEN to CLOSED and calender_family.state = ON then
     door_open.sendcommand(ON)
end

Rules are event based, so the rule itself would be like:

rule "family opening of door"
when
    Item door_open_family changed from OPEN to CLOSED
then
    if (calender_family.state == ON)
        door_open.sendCommand(ON)
end

Regarding the My.openhab restrictions, I have no idea, because I don’t use it.

1 Like

That’s where I am having doubt…

You can create a my.openhab account for each user linked to your OH instance (log in to my.openhab.org, move the mouse over your email in the upper right hand column, select “Users”, and select “Add new user”). Only expose the door_open_family through the myopenhab.persist so that will become the only Item that IFTTT can interact with.

Now each of your users can link their my.openhab account to their own IFTTT account and have their own Do button.

While you can limit what Items gets shared to my.openhab through the .persist file, you cannot restrict access to specific Items by user. Any Item that gets persisted to my.openhab is available to all of your my.openhab users.

Also, your rule is incorrect syntax.

First it needs a when clause.

Second it makes no sense to have an “AND” in a rule trigger. Rules are triggered by events, not state and two events will never occur at the same time.

Third, a Switch is a more appropriate Item for door_open_family. Switches are used to activate something to occur, Contacts are used to represent the OPEN/CLOSED status of, for example a door.

Fourth, the if syntax is incorrect. you use parens around the conditional and curly brackets. Furthermore testing for equals is “==”, not “=”

You rule should look like:

rule "Family opening of door"
when
    Item door_open_family received command ON
then
    if(calendar_family.state == ON) {
        door_open.sendCommand(ON)
    }
end