Until a week or so ago I knew nothing about HA and how to program it. I don’t know much more now! So assume I’m a total ignoramus and don’t use too many big words.
I have set up an automation using UI which may or may not be correct. My bet would be on the latter. The aim is to invoke the service lock.set_usercode. It needs 3 parameters. The node_id will always be 3, the code_slot will always be 1, and the usercode will vary every time. I can’t work out how to format from the UI to display in this post but this is what I have set up:
`Action type
Call service
Service
lock.set_usercode
Service data
data: ‘node_id:‘3’ code_slot:‘1’’
data_template:
usercode: ‘{{trigger.data}}’`
I’ve sort of cobbled this together as my best shot to get it to work. I’m calling it remotely using a webhook I got from Home Assistant Cloud. I’m using a curl command to try and set the usercode to =1234:
curl -X POST webhook -d "{{1234}}"
Again I’ve sort of cobbled this together from the few examples I can find. I’m sure the syntax is incorrect. I’ve tried a few dozen combinations of brackets/quotes without success. It is definitely working as far as invoking the automation because I see entries in the log. It’s just not updating the usercode. Can anyone tell me if the automation is correctly set up? And what syntax should I be using in the curl command line for passing variable data? The forum has helped hugely to get me to this stage. Any help would be greatly appreciated.