from requests import get
import json

url = "http://192.168.1.2:8123/api/states/sensor.temperatuursensor_woonkamer_temperatuur"
headers = {
    "Authorization": "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiI2Y2Y1MDMwYzcxYzQ0OGU2YmYxOWQ4ZDJlYTZlNjJmNSIsImlhdCI6MTc1MDgzNDcwNiwiZXhwIjoyMDY2MTk0NzA2fQ.ABoHaCCx6iBjuCDL6jaW6rFpYyWZ57OhDD-LQSwey7I",
    "content-type": "application/json",
}

response = json.loads(get(url, headers=headers).text)

return_json = {
    "text":response['state'],
    "alt":"LIVINGTEMP",
    "tooltip":"Living Room Temperature",
    "class":"gpu_class"
}

print(json.dumps(return_json))