Hi All,
Working on an automation to generate a random 4 digit pin and set my lock code for my door. Here’s the script:
housekeeper_code_on:
sequence:
- service: lock.set_usercode
data_template:
node_id: 44
code_slot: 4
usercode: states.sensor.pin_code.state
- service: notify.twilio_sms
data:
message: "You can use the code {{ states.sensor.pin_code.state }} to get into the house today"
target:
- !secret cell_phone
- service: notify.slack
data:
message: "Housekeeper code has been enabled! Code is: {{ states.sensor.pin_code.state }}"
It is firing correctly, however the lock code never changes.
The locks are working fine, so if I go to Dev Tools -> States and fire off the command
Domain: lock
Service: set_usercode
Service Data: {“node_id”: “44”, “code_slot”: “4”, “usercode”: “1234”}
The locks change the code, so I suspect that it is just some syntax thing. Also, states.sensor.pin_code.state comes across correctly…so, I’m not sure what the problem could be. Anyone have any thoughts?
Thanks!
Chris