Need help reading an Arduino board sensor pin status

I have an Arduino board setup as a garage door opener. It has two sensor pins and two relay pins that open and close the garage doors from my iPhone app. The Arduino board has the ethernet port on it and I can connect to it just fine with the app and using a web browser.

I setup Home Assistant this evening using the HA ova file for a virtual machine, so I’m about 12 hours into my experience jumping ship from HomeBridge to Home Assistant.

So through tinkering with it, when I read the status from the Arduino, I get an XML file back that looks like this:

<myDoorOpener>
<status statusPin="2">Closed</status>
<status statusPin="3">Closed</status>
<status statusPin="4">Opened</status>
<status statusPin="5">Opened</status>
<challengeToken>MASKEDOUT12345</challengeToken>
</myDoorOpener>

I’ve tried for about the last five or six hours to figure out the syntax to create a sensor that can read and display the status for pins 2 and 3 and just flat have not been able to get one that passes config with proper syntax or shows the Open/Closed value after me blindly trying to tinker with it in HA.

If anyone can give me an idea how to define a sensor that can read the opened/closed values out of this XML response for the sensor pins, I would greatly appreciate it.

I’m only using two of the four sensor pins. One for each garage door. But the GET returns all four sensor pin values. So pins 4 and 5 aren’t being used for anything at the moment. The next step will be to learn how to send a POST to the Arduino to trip the relay pins to open and close the garage door, but if I can figure out how to read and show the pins in HA the right way, that would be a good start for me…

Thanks!