Below we explain how to add the Loqed Smart Lock to your Domoticz installation by using standard Domoticz functionality. You will end up with two switches: one will show the status, and one will allow you to control the lock. With native Domoticz functionality, it it currently not possible to have both in the same switch (do no try to: it will create an endless loop of door openings).
Go to Setup -> Hardware. Add a new dummy device.
On the same page as above, click on Create Virtual Sensors.
Call the new sensor ‘Loqed Actions’ and choose ‘Selector Switch’ as type.
Go to https://webhooks.loqed.com and login with your administrator account and create an API Key. You should end up with an entry similar as below. Leave this page open, we need the three URLs in the next step.
Go to ‘Switches’ and click on the edit button of the ‘Loqed Actions’ switch. We are now going to ensure the switch has three selector levels: ‘Open’, ‘Day lock’, and ‘Night lock’. Each level will call the correct URL for the lock action.
Don’t forget to save the switch. The first part is done, you now have a switch that you can use to control your Loqed Smart Lock! Note that if the lock status is changed from within the Loqed app, Domoticz will not show the correct lock status. This is unfortunately not easy to solve. However, we can show the lock status also in Domoticz by making just another virtual switch. This allows you to still performs actions with Domoticz if the lock status is changed.
This switch will not be used for switching really, but just to see the current lock status.
Go to Setup -> Hardware, and click again on the Create Virtual Sensors button. Name the sensor ‘Loqed Status’ and choose again the ‘Selector Switch’ type. Click save.
Go to ‘Switches’ and click on the edit button of the ‘Loqed Status’ switch. This time, ensure there are only two selector levels: ‘Day lock’, and ‘Night lock’ (open is only reached by the lock for a second, thus it doesn’t make sense to show it here). Do NOT add any URL’s.
Before saving the switch, look at the URL in your browser, and write down the Switch ID (it is numeric). Also, write down the Selector level number for ‘Day lock’ and ‘Night lock’.
We are now going to format an URL that the Loqed Backend can call to let Domoticz know the Loqed Status has changed. The URL looks like this, but certain parts need to be changed:
When you are finished, enter this URL in your browser, and verify that the ‘Loqed Status’ switch changes status to the status you requested! Then, create a second URL for the other selector level ‘Night Lock’ (only the [LEVEL] part of the URL will be different).
Go to https://webhooks.loqed.com and login with your administrator account. Click on ‘Add new webhook’. Ensure to select only the ‘Day lock’ checkbox, and copy-paste the URL of ‘Day lock’ status here. Save. Add another webhook, now only select the ‘Night lock’ checkbox, and copy-paste the other URL of step 3 here. Save as well.
Now you’re all set! Once the lock changes status, the new status will be send to Domoticz.
Once again: you cannot use one switch to combine actions and status in Domoticz using this method. Do not try to: it will create an endless loop of openings or closings.