We have two very naughty little cats, who are in and out at all hours of the day. My partner gets quite distressed by their comings and goings, especially when they are out all night. I wanted to create some kind of solution which allows us to know whether the cats are in or out, without having to search all over the house for them.
Enter cat-track
! cat-track
is a very lean web page which allows us to see whether the cats are in or out of the house. It consists of an Express.js server which serves ip some static HTML with the cats on. It is updated through a REST API, which will be (when I can get hold of the bits) called by a device attached to the cat flap.
The flap client will scan the microchip in the cat's neck to establish which cat is using the cat flap, and then take input from a limit switch to discern whether the cat is going in, or coming out. It will then call the API endpoint to update the state in the server, which is stored in a LowDB JSON file. The frontend is updated via WebSockets to ensure the latest status is always being displayed.
The whole thing is containerised and runs on a Docker instance on a VPS I was already using for something else.