Config file for prototype ESPHome ESP32 device to control the ccl/sudo door in CCL using RFID.
Beware that a password is contained in the yml file. You should change it before using this in production. ^^^^^ lol you mean so hackers don't get in? :)
To compile and run first install esphome (Python >= 3.7 required):
sudo apt install python3.12-venv
virtualenv venv
. venv/bin/activate
pip3 install esphome
Generate a key with this and put it in secrets.yaml:
echo api_encryption_key: $( openssl rand -base64 32 ) > secrets.yaml
Then compile and upload:
esphome compile sudo-ccl-door-ethernet.yml && git add .esphome/build/sudo-ccl-door-ethernet/build/firmware.*
esphome upload sudo-ccl-door-ethernet.yml
# or
esphome compile sudo-ccl-door.yml && git add .esphome/build/sudo-ccl-door/build/firmware.*
esphome upload sudo-ccl-door.yml
to run open-sudo-door.py edit in the PSK from secrets.yaml and pip3 install --upgrade aioesphomeapi
not implemented yet: Now in home-assistant add your new esphome node (it will probably be auto-discovered). Then scan a tag and go to the tag manager and give it a name. Set up an automation. The trigger should be of type Tag and the Tag should be the name of the tag you just names. The action should be "esphome.door_sudo_unlock_door".