Smart Meter Texas - API requirements

Hello:

I wanted to try out the API from smartmetertexas.com (they have a published API) and when I requested it, I got the following email back:

Thanks for Contacting Smart Meter Texas Support team, We have received your request regards “API Integration”. We need the below prerequisites as mandatory in order to provide API setup for your account.

1>Public SSL certificate(CA authorized SSL certificate is mandatory for Production or self-signed SSL certificate is for stage if you would like to test)
2>Static IPs-We need the public IP address which needs to be added for IP white listing.

As per the latest SMT 2.0 guidelines, For Residential users, You can share the SSL certificate with any CN name, But only Single domain certificates will be allowed and do not allow the use of Wild card certificates. Let us know if you are having any queries on it.

Can anyone help me decipher what the SSL certificate requirements are? What do they mean "You can share the SSL certificate with any CN name"? And how would I do that? Alternatively, how do I generate a self-signed cert?

On the static IP, I guess I could share my public IP assigned by the service provider, but would need to figure out how to track if it changes. Since they "white list" specific IPs, is there any workaround (apart from getting a static IP from my provider)?

Thanks,

From my brief read of the SMT interface guide, the API seems to be intended for businesses (either competitive electric suppliers or IT companies working for suppliers).

For API access you would need your own domain name (ie rakeshg.com) along with an SSL certificate issued (from a certificate authority) to that domain name. And a static IP from where the API requests are made. You would have to supply the any IP addresses changes to SMT for continued access via the API with probable update delays of several days.

A self-signed cert would only be able to access test data. So thats of no use for real data.

SMT can send you via email 15 minute interval consumption data on a "defined frequency". I would look at this as the easiest option to get started.

This was from the web portal section

Thanks - I am already subscribing to this. The data for each day comes the following day in the evening. I’m guessing the API will not have it available any sooner either, as it is not available on the “live” website either.

It appears they do have an option for residential users for API access per the email (I was hoping to automate getting the data into my database) but it looks like it’s not worth the hassle.

The only suggestion for realtime consumption would be some sort of interface to the meter (depends on meter)

Or a clamp-on current transformer on the mains or branch circuits.

Something like this (just example, no experience.)
https://www.amazon.com/Eyedro-Electricity-My-Eyedro-com-Real-Time-EYEFI-2/dp/B07KBBD8C5/

1 Like

I found a way in Node-RED to read the CSV attachment to the email. Real-time is not really required, but I do want the automated aspect.

Once I have the data, I can create the database entries and (hopefully) not have to do the manual process.

Thanks so much for your help and suggestions.

Share your flow when your done I really like learning from the work you do.

Plus I'm planning to start monitoring my power consumption. Our utility just installed a smart meter and they actually recommend a usb device by emporia that supposedly joins with the meter via zigbee and allows access to realtime usage data.

However at first glance it only via an android app.

1 Like

Here is the flow:

[{"id":"7e24edac.5a24d4","type":"inject","z":"2b6c3ed9.22a7ea","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":116,"y":2865,"wires":[["2148b319.453f6c"]]},{"id":"2148b319.453f6c","type":"e-mail in","z":"2b6c3ed9.22a7ea","name":"Get Unread Emails","protocol":"IMAP","server":"imap.gmail.com","useSSL":true,"autotls":"never","port":"993","box":"Inbox","disposition":"Read","criteria":"UNSEEN","repeat":"300","fetch":"trigger","inputs":1,"x":160.00003051757812,"y":2936.3333740234375,"wires":[["952f8ba2.699798","b6a64831.19d9c"]]},{"id":"b6a64831.19d9c","type":"switch","z":"2b6c3ed9.22a7ea","name":"Only if meter readings","property":"topic","propertyType":"msg","rules":[{"t":"cont","v":"Fwd: Smart Meter Texas – Subscription Report","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":393.9999694824219,"y":2935.666748046875,"wires":[["16247b97.702d4c","ce16063c.0be738"]]},{"id":"ce16063c.0be738","type":"change","z":"2b6c3ed9.22a7ea","name":"Get attachment","rules":[{"t":"delete","p":"payload","pt":"msg"},{"t":"set","p":"payload","pt":"msg","to":"attachments[0].content","tot":"msg"},{"t":"delete","p":"header","pt":"msg"},{"t":"delete","p":"from","pt":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":640.0000076293945,"y":2937.666748046875,"wires":[["e60c9dba.dc8c98"]]},{"id":"e60c9dba.dc8c98","type":"function","z":"2b6c3ed9.22a7ea","name":"Extract CSV","func":"msg.payload=msg.attachments[0].content.toString('latin1')\n\ndelete msg.attachments\ndelete msg.html\n\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":819.0000076293945,"y":2937.666748046875,"wires":[["a04e2a60.ea0078","683db5a2.969ac4"]]},{"id":"683db5a2.969ac4","type":"csv","z":"2b6c3ed9.22a7ea","name":"Parse CSV","sep":",","hdrin":true,"hdrout":"none","multi":"mult","ret":"\\n","temp":"","skip":"0","strings":true,"include_empty_strings":"","include_null_values":"","x":1003.0000305175781,"y":2936.666748046875,"wires":[["246f6c0b.801184","302b144e.8bec24"]]},{"id":"302b144e.8bec24","type":"function","z":"2b6c3ed9.22a7ea","name":"Calc Daily Totals","func":"const data = msg.payload;\nconst dataLength = data.length;\n\nlet date = new Date(data[0].USAGE_DATE)\nlet consumption = 0\nlet surplus = 0\n\nfor (var i = 0; i < dataLength; i++) {\n    if (data[i].CONSUMPTION_SURPLUSGENERATION == 'Consumption') {\n        consumption = consumption + Number(data[i].USAGE_KWH)\n    } else {\n        surplus = surplus + Number(data[i].USAGE_KWH)\n    }\n}\n\ndelete msg.payload\ndelete msg.columns\n\nmsg.date=date.toISOString().split(\"T\")[0]\nmsg.consumption = +(consumption.toFixed(3))\nmsg.surplus = +(surplus.toFixed(3))\nmsg.net = msg.consumption - msg.surplus\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":180.00003051757812,"y":3040.666748046875,"wires":[["9500e402.e923d","3e2886a5.49dbda"]]},{"id":"3e2886a5.49dbda","type":"function","z":"2b6c3ed9.22a7ea","name":"SQL Insert Query","func":"\n\nlet sqlString = 'INSERT INTO meter_reading (reading_date,consumption,surplus,net) VALUE ('\n\nconst quote = \"'\"\nconst comma = \",\"\n\n\nsqlString +=\"STR_TO_DATE(\"+quote+msg.date+quote+\",'%Y-%m-%d')\"+comma\nsqlString +=msg.consumption+comma\nsqlString +=msg.surplus+comma\nsqlString +=msg.net+\")\"\n\n\nmsg.topic = sqlString\n\nreturn msg;\n","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":407.0002136230469,"y":3039.666748046875,"wires":[["d5e64711.3718f","fa64f025.7cb4"]]}]

and this is what the flow looks like:

A couple of things to note:

  1. I set up a Google account to use for the email subscriptions from smartmetertexas.com and enabled app specific password for it. This way, it will should not be impacted by Google turning of "less secure" method for accessing email.

  2. The email node is configured to look for only unread mails ("unseen") and then mark them as "read" so it does not keep sending the same stuff again.

  3. The data is an attachment to the email (CSV format) with meter readings every 15 minutes. I sum up the data for the day in a function node before storing it in the database. The 15 minute interval format is the only format that includes data on consumption (used from the grid) and surplus (supplied to the grid).

  4. In the flow, I have removed the last node (mySQL node), but you can save the data to any database. The SQL to create the table is

//Meter Readings table
CREATE TABLE
meter_reading
(
id INT NOT NULL AUTO_INCREMENT,
reading_date DATETIME,
consumption DECIMAL(10,3),
surplus DECIMAL(10,3),
net DECIMAL(10,3),
created TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (id)
);

Hope this helps. Feel free to ping me if you have any questions.

Our local utility supports this device which has local, cloud and a realtime data streaming api (to a local server)

https://rainforestautomation.com/us-retail-store/eagle-200-smart-meter-energy-gateway/

Reading some amazon reviews a couple of users stated they used it with SMT, but I would call SMT first before purchase.

Its out of stock at the mfg & amazon but you can signup to be notified.

This is probably the route I will go.

1 Like

Apparently, it used to work before 2019, but not any longer.

https://www.rainforestautomation.com/state-texas-residents/

I am currently getting real-time data from my Tesla inverters (solar panel and inverter) via a local API. It matches (pretty closely) the data that the smart meter has for what was utilized from the grid and what was sent to the grid. It also has solar generation and what was provided from the battery, so it actually gives me what we used in total vs only what was billed.

The smart meter data, for me, is just a cross verification.

That's a bummer, Texas electricity seems to be a real mess. Really limiting what the person paying the bill can do.

1 Like

Yeah - in more ways than just this!