Need help creating a User Interface for GCP IoT project which uses ESP32 and Raspberry Pi 4

Good Day

I am working on a project that involves using the ESP32 microcontroller and the DHT 22 temperature/humidity sensor to create an IoT device that uses UDP transsmission over Wifi to send data to a Raspberry Pi, which acts as my edge device. The Raspberry Pi then sends this data to Google Cloud by establishing an MQTT connection with the cloud which publishes the data to a pubsub topic. I have so far managed to configure the cloud to accept the data using IoT core and Pub Sub and have successfully sent data to my topic in the cloud. I however, would like to use firebase to create a user interface for easier user experience.
I have come across this article; How to check the weather using GCP-Cloud IoT Core with ESP32 and Mongoose OS, written by @Olivier LOURME which details how to do this using Mongoose Os and Javascript but my mqtt code which publishes data to the cloud is in python and whenever I try to initiate the firebase cloud function for it, I keep getting a ‘syntax error: unexpected token R in JSON at position 0 at JSON.parse’ . The mqtt code can be found here: community/cloudiot_mqtt_gateway.py at master · GoogleCloudPlatform/community · GitHub
I would greatly appreciate any help to enable the python code to transmit the data in the correct JSON format to resolve this problem.