@123 Taras - Thank you so much for your help. I have tested your code and it works perfectly.
You have also brought to my attention the existence of MQTT-Explorer.
The reason I require the reply to reqsynctime is that I think it is used to let the solar inverter know that the data it is sending is being received. If there is no response to the time sync request the inverter may or may not send any solar production data. Sometimes it goes quiet for hours before it will try again, and I have no way of knowing if its a fault with inverter/wifi dongle or communication between inverter, my access point and HA pc.
If the inverter gets the respsynctime reply it starts sending data straight away over mqtt, and then during the day will do a reqsynctime request every 1 hour and 1 minute.
I have changed out 2 wifi dongles so far, and every time I get a new dongle it has a new wifisn.