Thames Water data

Use AI-On-The-Edge and MQTT to add it into the energy dashboard. Easy peasy and each meter will only cost you about $7 in parts.
1000042427
1000042433
1000042429
1000042428
1000042430

1 Like

I have gotten https://myaccount.thameswater.co.uk/ajax/waterMeter/getSmartWaterMeterConsumptions to work in Postman. You can use this to import to postman.

{
	"info": {
		"name": "Thames Water",
		"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
	},
	"item": [
		{
			"name": "getSmartWaterMeterConsumptions",
			"request": {
				"method": "GET",
				"header": [
					{
						"key": "cookie",
						"value": "{{CookieData}}",
						"type": "text"
					},
					{
						"key": "referer",
						"value": "https://myaccount.thameswater.co.uk/mydashboard/my-meters-usage",
						"type": "text"
					},
					{
						"key": "x-requested-with",
						"value": "XMLHttpRequest",
						"type": "text"
					}
				],
				"url": {
					"raw": "https://myaccount.thameswater.co.uk/ajax/waterMeter/getSmartWaterMeterConsumptions?meter={{MeterID}}&startDate=22&startMonth=09&startYear=2024&endDate=22&endMonth=09&endYear=2024&granularity=H&isForC4C=false",
					"protocol": "https",
					"host": [
						"myaccount",
						"thameswater",
						"co",
						"uk"
					],
					"path": [
						"ajax",
						"waterMeter",
						"getSmartWaterMeterConsumptions"
					],
					"query": [
						{
							"key": "meter",
							"value": "{{MeterID}}"
						},
						{
							"key": "startDate",
							"value": "22"
						},
						{
							"key": "startMonth",
							"value": "09"
						},
						{
							"key": "startYear",
							"value": "2024"
						},
						{
							"key": "endDate",
							"value": "22"
						},
						{
							"key": "endMonth",
							"value": "09"
						},
						{
							"key": "endYear",
							"value": "2024"
						},
						{
							"key": "granularity",
							"value": "H"
						},
						{
							"key": "premiseId",
							"value": "",
							"disabled": true
						},
						{
							"key": "isForC4C",
							"value": "false"
						}
					]
				},
				"description": "This is the API the site uses to get data, I just found it in the browser"
			},
			"response": []
		}
	],
	"variable": [
		{
			"key": "MeterID",
			"value": "Replace with your meter ID which looks like 310000000"
		},
		{
			"key": "CookieData",
			"value": "Replace with cookie data from a recent signin to myaccount.thameswater.co.uk"
		}
	]
}

There are a lot of odd required headers and parameters. This is as small as I could get it.

I havenā€™t worked out the sign-on yet, so Iā€™m using a cookie from a recent valid sign-on to the site. Youā€™ll need to find your meter ID too. I didnā€™t see where to get that in the site yet, you may need to find that in inspect too.

Thereā€™s a ton of good data that comes back. Sorry for the aggressive redacting :smiley:

{
    "IsError": false,
    "IsDataAvailable": true,
    "Lines": [
        {
            "Label": "0:00",
            "Usage": X.0,
            "Read": XXXXXX.0,
            "IsEstimated": false,
            "MeterSerialNumberHis": "XXXXXXXXX"
        },
...
        {
            "Label": "23:00",
            "Usage": X.0,
            "Read": XXXXXX.0,
            "IsEstimated": false,
            "MeterSerialNumberHis": "XXXXXXXXX"
        }
    ],
    "IsConsumptionAvailable": false,
    "AlertsValues": null,
    "TargetUsage": 0.0,
    "AverageUsage": XX,
    "ActualUsage": XXXXX,
    "MyUsage": "NA",
    "AverageUsagePerPerson": XXXXX,
    "IsMO365Customer": false,
    "IsMOPartialCustomer": false,
    "IsMOCompleteCustomer": false,
    "IsExtraMonthConsumptionMessage": false
}