I am on my first Raspberry PI project and am using a PI 4B with an 8 relay board.
I've created a web page in HTML/javascript/php that has 8 push buttons on it. I am leveraging an IndexedDB solution to store the state of the relay on or off associated with the button clicked via coding and current value in the database. So when the button is clicked, I check the database value of the relay state (on or off) associated with that button in the database, then the code sends the relay to flip to the opposite and store the new state of the relay in the database.
While this works to an extent - is there a way to capture via code the current state a particular relay is in on or off?