Adding a way to set door codes - Part 2: Create helpers
We have a very basic script written. Now we need to make some 'helpers' so we can put the information into the script easily. Helpers are small thingies (another technical term) that make it easier to put data into the system.
- Write a 'script' to set the door code.
- Create 'helpers' to make it easy to select the door to use, the code slot, and to enter the door code itself.
- Use the 'helpers' in the script.
- Create a 'card' that uses the helpers and the script. This is like the lock card, but uses the helpers to get the door, code slot and door code.
Create 'helpers' to make it easy to select the door to use, the code slot, and to enter the door code itself
If you are not already there, open up the Home Assistant - http://homeassistant.local:8123/, then go to 'Configuration' in the sidebar.
Select 'Helpers'
Room Name Helper
Select "Add Helper", then 'Dropdown'.
Enter "Lock Name" as the name. Then type in a name for your lock. This needs to be something that makes sense to you, or anyone who might be setting codes on this lock. I have named the rooms in my house, so I will start with "Scottish Room", then select "Add"...
You will see your new helper in the list. It will have an 'Entity Id' of "input_select.lock_name".
Code Slot Helper
Select "Add Helper", then 'Text'.
Enter the name - "Key Code Slot"
You will see your new helper in the list. It will have an 'Entity Id' of "input_text.key_code_slot".
Usercode Helper
Select "Add Helper", then 'Text'.
Enter the name - "User Code"
Then select 'Create'
You will see your new helper in the list. It will have an 'Entity Id' of "input_text.user_code".
So now we have our helpers built. Next we will tie the 'helpers' to the script.
Comments
Post a Comment
Thanks for the comment!