Sonnen Battery Plugin


I have modified the Envoy plugin I found on this forum to take data from my home battery (Sonnen) and mix it with Vera. I have attached the API document and I have attached the code i muddled through. I have confirmed I am getting the right data to the right variables, but what i don’t know how to do is fix the display and layout. It still shows Watts and KWH where it should have other text.
The output from the battery is just a REST API in JSON format (here is an example)

{“C06”:10,“C07”:0,“C08”:0,“C09”:0,“C10”:0,“C11”:0,“C12”:0,“C23”:0,“C24”:0,“M03”:3170,“M04”:898,“M05”:100,“M06”:10,“M07”:664,“M08”:234,“M09”:0,“M30”:100,“M31”:4544000,“M34”:0,“M35”:0,“M37”:19332.51,“M38”:4152,“M39”:0,“M40”:7195.23,“M41”:3086,“S01”:160,“S07”:“US-85339”,“S08”:15,“S15”:“45119”,“S16”:“5.01 (405)”,“S65”:8000,“S66”:“son”,“S69”:16000,“S70”:“3.5”,“S71”:“FALSE”}

Using this URL http://:3480/data_request?id=status&output_format=xml&DeviceNum= I can see the data is there:

I just want to have human text for the variables on the app/webpage. i.e. M03 = Current PV Power ### Watts
M04 = Current Home Consumption
M05 = Battery Charge State ## %

Anyone able to point me in the right direction?