Access to HA Internal Device Status Tables, Query and Change

I have been a long time user of PowerHome, an Insteon based system similar to HA but much more powerful. I have about 70 Insteon devices in the house. I make extensive use of PowerHome’s internal programming language to interrogate periodically or see triggered events to/from multiple devices and make and implement appropriate decisions. The developer of PowerHome has just begun implementation for Z-Wave devices. I want to use a Z-Wave thermostat rather than the somewhat cranky Insteon one. The PowerHome implementation for Z-Wave is immature. I already have a number of raspi-based environmental sensors that report various status items into the PowerHome system using UDP messages and PowerHome takes pre-programmed actions as required. I was thinking of using HA to manage the Z-Wave thermostat but need access, query and change, to the underlying device status tables. A separate Python program would interface with the HA tables, sending and receiving UDP instructions from and status updates to the controlling PowerHome application. As Powerhome will be commanding the Z-Wave thermostat to change thermostat mode or set points, HA would need to notice the device status changes and send instructions to the thermostat. If this is infeasible or too difficult, I will just write a special purpose application just for my purpose. Thoughts are welcome.

It is probably only the interface you need to specify better.
The rest is sort of what HA does as standard.

HA have a huge number of interfaces, like rest, websocket, snmp and so on.
UDP is just the transport protocol, so what is the message protocol on top of that?