├── .gitattributes ├── README.md ├── Smart Meter Texas HASS.json ├── Smart Meter Texas MQTT.json └── smartmetertexas.yaml /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## Node-Red Implementation of the Smart Meter Texas API 2 | 3 | Access your current meter reading from the Smart Meter Texas API! The Node-Red flow requests a meter read every hour and reports the results over MQTT or to a Home Assistant entity. There is also a package for Home Assistant providing a number of useful sensors for use in your instance, if you wish not to use the native Energy Dashboard. 4 | 5 | --- 6 | ### Prerequisites: 7 | * An electric meter enrolled with Smart Meter Texas 8 | * Your Smart Meter Texas Username, Password, ESIID, and Meter Number 9 | * An MQTT Server (Optional if using integration below) 10 | * Home Assistant [Node-Red Companion Integration](https://github.com/zachowj/hass-node-red) (Optional if using MQTT) 11 | * Node-Red and the following additional nodes: 12 | * node-red-contrib-https 13 | * node-red-contrib-credentials 14 | * node-red-contrib-home-assistant-websocket (only needed for those who want direct home assistant integration rather than MQTT) 15 | --- 16 | ### Installation: 17 | 1. Make sure your system meets the above prerequisites. 18 | 2. Import the __Smart Meter Texas **.json__ file into your Node-Red instance. You only need one or the other, not both. 19 | 3. If you are using MQTT and Home Assistant (not integration), place the __smartmetertexas.yaml__ file in your config/packages directory, or copy the sensor configuration lines in the file to your main configuration file. More information of using packages can be found [HERE](https://www.home-assistant.io/docs/configuration/packages/#create-a-packages-folder "HERE"). 20 | #### NOTE: To use the native Energy Dashboard, you only need to add the mqtt sensor to your configuration and nothing else. If you wish to have your own utility meter entities, then copy the rest of the entities along with the mqtt sensor. 21 | 22 | 5. Continue with configuration! 23 | --- 24 | ### Configuration: 25 | 1. Open the imported Node-Red flow and open the __Credentials__ node. You will need to fill in your Smart Meter Texas Username, Password, ESIID, and Meter Number. Optionally, you can change the minute when the meter will be polled every hour in the respective cron job nodes. It is advised to have the authentication cron run BEFORE the request read cron. Click __Done__ when you are finished. 26 | 2. MQTT Users: Open the __MQTT: Send Reading__ node and configure your MQTT server information. 27 | 3. Node-Red Companion Integ. Users: Open the __SMT Current Reading__ node and set your home assistant instance. 28 | 4. When you are finished configuring the nodes, click the __Deploy__ button to start the flow with your new configuration. 29 | 5.(Optional): If you are using the optional Home Assistant sensors package, and do not wish to use the native Energy Dashboard, set your electricity cost in the entity __input_number.smt_energy_cost__. 30 | --- 31 | ### Usage: 32 | The Node-Red flow will request a meter read at 30 minute intervals since the last successful read. It will then request the results of the meter read every 30 seconds until they are available. The current meter reading is reported over MQTT with the topic smt/reading or to the configured Home Assistant entity. 33 | 34 | Note that the API limits each ESIID to two reads per hour and 24 reads per day. The limit is based on the time when the reading is successfully retrieved from the meter. Increasing the frequency of reads will result in an error until the hour or day resets (depending on the error). 35 | 36 | --- 37 | __Thanks:__ This code would not be possible without the previous work by [keatontaylor](https://github.com/keatontaylor/smartmetertexas-api). 38 | 39 | --- 40 | __Disclaimer:__ This information is not provided by, nor endorsed by Smart Meter Texas. As this API is unpublished, it could break at any time. 41 | -------------------------------------------------------------------------------- /Smart Meter Texas HASS.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "id": "f8297485.d32748", 4 | "type": "tab", 5 | "label": "Smart Meter Texas HASS", 6 | "disabled": false, 7 | "info": "" 8 | }, 9 | { 10 | "id": "229dbc53.b39f84", 11 | "type": "inject", 12 | "z": "f8297485.d32748", 13 | "name": "Retrieve Reading", 14 | "props": [ 15 | { 16 | "p": "payload", 17 | "v": "", 18 | "vt": "date" 19 | }, 20 | { 21 | "p": "topic", 22 | "v": "", 23 | "vt": "string" 24 | } 25 | ], 26 | "repeat": "30", 27 | "crontab": "", 28 | "once": true, 29 | "onceDelay": "1.0", 30 | "topic": "", 31 | "payload": "", 32 | "payloadType": "date", 33 | "x": 130, 34 | "y": 460, 35 | "wires": [ 36 | [ 37 | "49de2e1c.6a2d7" 38 | ] 39 | ] 40 | }, 41 | { 42 | "id": "f805b5.98485a48", 43 | "type": "change", 44 | "z": "f8297485.d32748", 45 | "name": "Apply HTTP Config", 46 | "rules": [ 47 | { 48 | "t": "set", 49 | "p": "payload", 50 | "pt": "msg", 51 | "to": "resultjson", 52 | "tot": "flow" 53 | }, 54 | { 55 | "t": "set", 56 | "p": "headers.accept", 57 | "pt": "msg", 58 | "to": "application/json, text/plain, */*", 59 | "tot": "str" 60 | }, 61 | { 62 | "t": "set", 63 | "p": "headers.accept-language", 64 | "pt": "msg", 65 | "to": "en-US,en;q=0.9", 66 | "tot": "str" 67 | }, 68 | { 69 | "t": "set", 70 | "p": "headers.cache-control", 71 | "pt": "msg", 72 | "to": "no-cache", 73 | "tot": "str" 74 | }, 75 | { 76 | "t": "set", 77 | "p": "headers.content-type", 78 | "pt": "msg", 79 | "to": "application/json", 80 | "tot": "str" 81 | }, 82 | { 83 | "t": "set", 84 | "p": "headers.origin", 85 | "pt": "msg", 86 | "to": "https://www.smartmetertexas.com", 87 | "tot": "str" 88 | }, 89 | { 90 | "t": "set", 91 | "p": "headers.pragma", 92 | "pt": "msg", 93 | "to": "no-cache", 94 | "tot": "str" 95 | }, 96 | { 97 | "t": "set", 98 | "p": "headers.referer", 99 | "pt": "msg", 100 | "to": "https://www.smartmetertexas.com/home", 101 | "tot": "str" 102 | }, 103 | { 104 | "t": "set", 105 | "p": "headers.user-agent", 106 | "pt": "msg", 107 | "to": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36", 108 | "tot": "str" 109 | }, 110 | { 111 | "t": "set", 112 | "p": "headers.authorization", 113 | "pt": "msg", 114 | "to": "token", 115 | "tot": "flow" 116 | } 117 | ], 118 | "action": "", 119 | "property": "", 120 | "from": "", 121 | "to": "", 122 | "reg": false, 123 | "x": 550, 124 | "y": 460, 125 | "wires": [ 126 | [ 127 | "e8e5474956f5c253" 128 | ] 129 | ] 130 | }, 131 | { 132 | "id": "45fd4f16.4d205", 133 | "type": "switch", 134 | "z": "f8297485.d32748", 135 | "name": "Status Complete", 136 | "property": "payload.data.odrstatus", 137 | "propertyType": "msg", 138 | "rules": [ 139 | { 140 | "t": "eq", 141 | "v": "COMPLETED", 142 | "vt": "str" 143 | } 144 | ], 145 | "checkall": "true", 146 | "repair": false, 147 | "outputs": 1, 148 | "x": 950, 149 | "y": 480, 150 | "wires": [ 151 | [ 152 | "f35231ec.019d9" 153 | ] 154 | ] 155 | }, 156 | { 157 | "id": "8f12d0a3.66f63", 158 | "type": "change", 159 | "z": "f8297485.d32748", 160 | "name": "Apply HTTP Config", 161 | "rules": [ 162 | { 163 | "t": "set", 164 | "p": "payload", 165 | "pt": "msg", 166 | "to": "authjson", 167 | "tot": "flow" 168 | }, 169 | { 170 | "t": "set", 171 | "p": "headers.accept", 172 | "pt": "msg", 173 | "to": "application/json, text/plain, */*", 174 | "tot": "str" 175 | }, 176 | { 177 | "t": "set", 178 | "p": "headers.accept-language", 179 | "pt": "msg", 180 | "to": "en-US,en;q=0.9", 181 | "tot": "str" 182 | }, 183 | { 184 | "t": "set", 185 | "p": "headers.cache-control", 186 | "pt": "msg", 187 | "to": "no-cache", 188 | "tot": "str" 189 | }, 190 | { 191 | "t": "set", 192 | "p": "headers.content-type", 193 | "pt": "msg", 194 | "to": "application/json", 195 | "tot": "str" 196 | }, 197 | { 198 | "t": "set", 199 | "p": "headers.origin", 200 | "pt": "msg", 201 | "to": "https://www.smartmetertexas.com", 202 | "tot": "str" 203 | }, 204 | { 205 | "t": "set", 206 | "p": "headers.pragma", 207 | "pt": "msg", 208 | "to": "no-cache", 209 | "tot": "str" 210 | }, 211 | { 212 | "t": "set", 213 | "p": "headers.referer", 214 | "pt": "msg", 215 | "to": "https://www.smartmetertexas.com/home", 216 | "tot": "str" 217 | }, 218 | { 219 | "t": "set", 220 | "p": "headers.user-agent", 221 | "pt": "msg", 222 | "to": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36", 223 | "tot": "str" 224 | } 225 | ], 226 | "action": "", 227 | "property": "", 228 | "from": "", 229 | "to": "", 230 | "reg": false, 231 | "x": 290, 232 | "y": 260, 233 | "wires": [ 234 | [ 235 | "e89bdd629b4ba919" 236 | ] 237 | ] 238 | }, 239 | { 240 | "id": "5a67264f.b0d4a8", 241 | "type": "change", 242 | "z": "f8297485.d32748", 243 | "name": "", 244 | "rules": [ 245 | { 246 | "t": "set", 247 | "p": "token", 248 | "pt": "flow", 249 | "to": "payload", 250 | "tot": "msg" 251 | } 252 | ], 253 | "action": "", 254 | "property": "", 255 | "from": "", 256 | "to": "", 257 | "reg": false, 258 | "x": 760, 259 | "y": 280, 260 | "wires": [ 261 | [ 262 | "197f7fb8.eb7b3" 263 | ] 264 | ] 265 | }, 266 | { 267 | "id": "9e15d26d.67d59", 268 | "type": "debug", 269 | "z": "f8297485.d32748", 270 | "name": "Debug: Login", 271 | "active": false, 272 | "tosidebar": true, 273 | "console": false, 274 | "tostatus": false, 275 | "complete": "payload", 276 | "targetType": "msg", 277 | "x": 600, 278 | "y": 240, 279 | "wires": [] 280 | }, 281 | { 282 | "id": "4b59cb1f.0b6074", 283 | "type": "function", 284 | "z": "f8297485.d32748", 285 | "name": "Add Bearer", 286 | "func": "msg.payload = \"bearer \" + msg.payload.token;\nreturn msg;", 287 | "outputs": 1, 288 | "noerr": 0, 289 | "x": 590, 290 | "y": 280, 291 | "wires": [ 292 | [ 293 | "5a67264f.b0d4a8" 294 | ] 295 | ] 296 | }, 297 | { 298 | "id": "a33f45a0.ca8a88", 299 | "type": "inject", 300 | "z": "f8297485.d32748", 301 | "name": "Build JSON", 302 | "props": [ 303 | { 304 | "p": "payload", 305 | "v": "", 306 | "vt": "date" 307 | }, 308 | { 309 | "p": "topic", 310 | "v": "", 311 | "vt": "string" 312 | } 313 | ], 314 | "repeat": "", 315 | "crontab": "", 316 | "once": true, 317 | "onceDelay": "0.1", 318 | "topic": "", 319 | "payload": "", 320 | "payloadType": "date", 321 | "x": 110, 322 | "y": 140, 323 | "wires": [ 324 | [ 325 | "4779bbf2.421be4" 326 | ] 327 | ] 328 | }, 329 | { 330 | "id": "eca68eef.a7038", 331 | "type": "function", 332 | "z": "f8297485.d32748", 333 | "name": "Create Login JSON", 334 | "func": "msg.payload = {\n \"username\": msg.username,\n \"password\": msg.password,\n \"rememberMe\": \"true\"\n};\nreturn msg;", 335 | "outputs": 1, 336 | "noerr": 0, 337 | "x": 470, 338 | "y": 100, 339 | "wires": [ 340 | [ 341 | "39f969.672e1698" 342 | ] 343 | ] 344 | }, 345 | { 346 | "id": "b72628a.cba9fd8", 347 | "type": "function", 348 | "z": "f8297485.d32748", 349 | "name": "Create Read Request JSON", 350 | "func": "msg.payload = {\n \"ESIID\": msg.esiid,\n \"MeterNumber\": msg.meternumber\n};\nreturn msg;", 351 | "outputs": 1, 352 | "noerr": 0, 353 | "x": 500, 354 | "y": 140, 355 | "wires": [ 356 | [ 357 | "896ca32e.dd642" 358 | ] 359 | ] 360 | }, 361 | { 362 | "id": "4f766b51.f67344", 363 | "type": "function", 364 | "z": "f8297485.d32748", 365 | "name": "Create Read Result JSON", 366 | "func": "msg.payload = {\n \"ESIID\": msg.esiid\n};\nreturn msg;", 367 | "outputs": 1, 368 | "noerr": 0, 369 | "x": 500, 370 | "y": 180, 371 | "wires": [ 372 | [ 373 | "33a32576.b8d44a" 374 | ] 375 | ] 376 | }, 377 | { 378 | "id": "49de2e1c.6a2d7", 379 | "type": "switch", 380 | "z": "f8297485.d32748", 381 | "name": "Waiting for Response", 382 | "property": "readrequested", 383 | "propertyType": "flow", 384 | "rules": [ 385 | { 386 | "t": "eq", 387 | "v": "1", 388 | "vt": "str" 389 | } 390 | ], 391 | "checkall": "true", 392 | "repair": false, 393 | "outputs": 1, 394 | "x": 340, 395 | "y": 460, 396 | "wires": [ 397 | [ 398 | "f805b5.98485a48" 399 | ] 400 | ] 401 | }, 402 | { 403 | "id": "f35231ec.019d9", 404 | "type": "change", 405 | "z": "f8297485.d32748", 406 | "name": "Not Waiting for Response", 407 | "rules": [ 408 | { 409 | "t": "set", 410 | "p": "readrequested", 411 | "pt": "flow", 412 | "to": "0", 413 | "tot": "str" 414 | } 415 | ], 416 | "action": "", 417 | "property": "", 418 | "from": "", 419 | "to": "", 420 | "reg": false, 421 | "x": 1170, 422 | "y": 480, 423 | "wires": [ 424 | [ 425 | "3390bb24a486cf78" 426 | ] 427 | ] 428 | }, 429 | { 430 | "id": "39f969.672e1698", 431 | "type": "change", 432 | "z": "f8297485.d32748", 433 | "name": "", 434 | "rules": [ 435 | { 436 | "t": "set", 437 | "p": "authjson", 438 | "pt": "flow", 439 | "to": "payload", 440 | "tot": "msg" 441 | } 442 | ], 443 | "action": "", 444 | "property": "", 445 | "from": "", 446 | "to": "", 447 | "reg": false, 448 | "x": 730, 449 | "y": 100, 450 | "wires": [ 451 | [] 452 | ] 453 | }, 454 | { 455 | "id": "896ca32e.dd642", 456 | "type": "change", 457 | "z": "f8297485.d32748", 458 | "name": "", 459 | "rules": [ 460 | { 461 | "t": "set", 462 | "p": "readjson", 463 | "pt": "flow", 464 | "to": "payload", 465 | "tot": "msg" 466 | } 467 | ], 468 | "action": "", 469 | "property": "", 470 | "from": "", 471 | "to": "", 472 | "reg": false, 473 | "x": 730, 474 | "y": 140, 475 | "wires": [ 476 | [] 477 | ] 478 | }, 479 | { 480 | "id": "33a32576.b8d44a", 481 | "type": "change", 482 | "z": "f8297485.d32748", 483 | "name": "", 484 | "rules": [ 485 | { 486 | "t": "set", 487 | "p": "resultjson", 488 | "pt": "flow", 489 | "to": "payload", 490 | "tot": "msg" 491 | } 492 | ], 493 | "action": "", 494 | "property": "", 495 | "from": "", 496 | "to": "", 497 | "reg": false, 498 | "x": 730, 499 | "y": 180, 500 | "wires": [ 501 | [] 502 | ] 503 | }, 504 | { 505 | "id": "8a692061.c38d8", 506 | "type": "switch", 507 | "z": "f8297485.d32748", 508 | "name": "Request Good", 509 | "property": "payload.data.statusReason", 510 | "propertyType": "msg", 511 | "rules": [ 512 | { 513 | "t": "eq", 514 | "v": "Request submitted successfully for further processing", 515 | "vt": "str" 516 | } 517 | ], 518 | "checkall": "true", 519 | "repair": false, 520 | "outputs": 1, 521 | "x": 660, 522 | "y": 380, 523 | "wires": [ 524 | [ 525 | "41ccc9f0.cb5378" 526 | ] 527 | ] 528 | }, 529 | { 530 | "id": "41ccc9f0.cb5378", 531 | "type": "change", 532 | "z": "f8297485.d32748", 533 | "name": "Waiting for Response", 534 | "rules": [ 535 | { 536 | "t": "set", 537 | "p": "readrequested", 538 | "pt": "flow", 539 | "to": "1", 540 | "tot": "str" 541 | } 542 | ], 543 | "action": "", 544 | "property": "", 545 | "from": "", 546 | "to": "", 547 | "reg": false, 548 | "x": 860, 549 | "y": 380, 550 | "wires": [ 551 | [] 552 | ] 553 | }, 554 | { 555 | "id": "ba8a2ae2.a4c338", 556 | "type": "debug", 557 | "z": "f8297485.d32748", 558 | "name": "Debug: Get Reading", 559 | "active": false, 560 | "tosidebar": true, 561 | "console": false, 562 | "tostatus": false, 563 | "complete": "payload", 564 | "targetType": "msg", 565 | "x": 960, 566 | "y": 440, 567 | "wires": [] 568 | }, 569 | { 570 | "id": "a411cabf.0a9678", 571 | "type": "change", 572 | "z": "f8297485.d32748", 573 | "name": "Apply HTTP Config", 574 | "rules": [ 575 | { 576 | "t": "set", 577 | "p": "payload", 578 | "pt": "msg", 579 | "to": "readjson", 580 | "tot": "flow" 581 | }, 582 | { 583 | "t": "set", 584 | "p": "headers.accept", 585 | "pt": "msg", 586 | "to": "application/json, text/plain, */*", 587 | "tot": "str" 588 | }, 589 | { 590 | "t": "set", 591 | "p": "headers.accept-language", 592 | "pt": "msg", 593 | "to": "en-US,en;q=0.9", 594 | "tot": "str" 595 | }, 596 | { 597 | "t": "set", 598 | "p": "headers.cache-control", 599 | "pt": "msg", 600 | "to": "no-cache", 601 | "tot": "str" 602 | }, 603 | { 604 | "t": "set", 605 | "p": "headers.content-type", 606 | "pt": "msg", 607 | "to": "application/json", 608 | "tot": "str" 609 | }, 610 | { 611 | "t": "set", 612 | "p": "headers.origin", 613 | "pt": "msg", 614 | "to": "https://www.smartmetertexas.com", 615 | "tot": "str" 616 | }, 617 | { 618 | "t": "set", 619 | "p": "headers.pragma", 620 | "pt": "msg", 621 | "to": "no-cache", 622 | "tot": "str" 623 | }, 624 | { 625 | "t": "set", 626 | "p": "headers.referer", 627 | "pt": "msg", 628 | "to": "https://www.smartmetertexas.com/home", 629 | "tot": "str" 630 | }, 631 | { 632 | "t": "set", 633 | "p": "headers.user-agent", 634 | "pt": "msg", 635 | "to": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36", 636 | "tot": "str" 637 | }, 638 | { 639 | "t": "set", 640 | "p": "headers.authorization", 641 | "pt": "msg", 642 | "to": "token", 643 | "tot": "flow" 644 | } 645 | ], 646 | "action": "", 647 | "property": "", 648 | "from": "", 649 | "to": "", 650 | "reg": false, 651 | "x": 290, 652 | "y": 360, 653 | "wires": [ 654 | [ 655 | "52e49f9332a5a83f" 656 | ] 657 | ] 658 | }, 659 | { 660 | "id": "616cab00.8d1ed4", 661 | "type": "debug", 662 | "z": "f8297485.d32748", 663 | "name": "Debug: Read Meter", 664 | "active": false, 665 | "tosidebar": true, 666 | "console": false, 667 | "tostatus": false, 668 | "complete": "payload", 669 | "targetType": "msg", 670 | "x": 680, 671 | "y": 340, 672 | "wires": [] 673 | }, 674 | { 675 | "id": "197f7fb8.eb7b3", 676 | "type": "debug", 677 | "z": "f8297485.d32748", 678 | "name": "Debug: Auth Token", 679 | "active": false, 680 | "tosidebar": true, 681 | "console": false, 682 | "tostatus": false, 683 | "complete": "payload", 684 | "targetType": "msg", 685 | "x": 950, 686 | "y": 280, 687 | "wires": [] 688 | }, 689 | { 690 | "id": "4779bbf2.421be4", 691 | "type": "credentials", 692 | "z": "f8297485.d32748", 693 | "name": "Credentials", 694 | "props": [ 695 | { 696 | "value": "username", 697 | "type": "msg" 698 | }, 699 | { 700 | "value": "password", 701 | "type": "msg" 702 | }, 703 | { 704 | "value": "esiid", 705 | "type": "msg" 706 | }, 707 | { 708 | "value": "meternumber", 709 | "type": "msg" 710 | } 711 | ], 712 | "x": 270, 713 | "y": 140, 714 | "wires": [ 715 | [ 716 | "eca68eef.a7038", 717 | "b72628a.cba9fd8", 718 | "4f766b51.f67344" 719 | ] 720 | ] 721 | }, 722 | { 723 | "id": "605199a9.192288", 724 | "type": "cronplus", 725 | "z": "f8297485.d32748", 726 | "name": "Read Meter", 727 | "outputField": "payload", 728 | "timeZone": "", 729 | "storeName": "", 730 | "commandResponseMsgOutput": "output1", 731 | "defaultLocation": "", 732 | "defaultLocationType": "default", 733 | "outputs": 1, 734 | "options": [ 735 | { 736 | "name": "0 min past the hour", 737 | "topic": "0 min past the hour", 738 | "payloadType": "str", 739 | "payload": "", 740 | "expressionType": "cron", 741 | "expression": "0 * * * * ", 742 | "location": "", 743 | "offset": "0", 744 | "solarType": "all", 745 | "solarEvents": "sunrise,sunset" 746 | } 747 | ], 748 | "x": 110, 749 | "y": 360, 750 | "wires": [ 751 | [ 752 | "a411cabf.0a9678" 753 | ] 754 | ] 755 | }, 756 | { 757 | "id": "952a9f1b.63456", 758 | "type": "cronplus", 759 | "z": "f8297485.d32748", 760 | "name": "Authenticate", 761 | "outputField": "payload", 762 | "timeZone": "", 763 | "storeName": "", 764 | "commandResponseMsgOutput": "output1", 765 | "defaultLocation": "", 766 | "defaultLocationType": "default", 767 | "outputs": 1, 768 | "options": [ 769 | { 770 | "name": "56 min past the hour", 771 | "topic": "56 min past the hour", 772 | "payloadType": "str", 773 | "payload": "", 774 | "expressionType": "cron", 775 | "expression": "0 56 * * * * ", 776 | "location": "", 777 | "offset": "0", 778 | "solarType": "all", 779 | "solarEvents": "sunrise,sunset" 780 | } 781 | ], 782 | "x": 110, 783 | "y": 260, 784 | "wires": [ 785 | [ 786 | "8f12d0a3.66f63" 787 | ] 788 | ] 789 | }, 790 | { 791 | "id": "3390bb24a486cf78", 792 | "type": "ha-sensor", 793 | "z": "f8297485.d32748", 794 | "name": "SMT Current Reading", 795 | "entityConfig": "8e5e4167.3de6a", 796 | "version": 0, 797 | "state": "payload.data.odrread", 798 | "stateType": "msg", 799 | "attributes": [ 800 | { 801 | "property": "odr_date", 802 | "value": "payload.data.odrdate", 803 | "valueType": "msg" 804 | }, 805 | { 806 | "property": "odr_usage", 807 | "value": "payload.data.odrusage", 808 | "valueType": "msg" 809 | } 810 | ], 811 | "inputOverride": "block", 812 | "outputProperties": [], 813 | "x": 1400, 814 | "y": 480, 815 | "wires": [ 816 | [] 817 | ] 818 | }, 819 | { 820 | "id": "e89bdd629b4ba919", 821 | "type": "http request", 822 | "z": "f8297485.d32748", 823 | "name": "Log In", 824 | "method": "POST", 825 | "ret": "obj", 826 | "paytoqs": "body", 827 | "url": "https://www.smartmetertexas.com/commonapi/user/authenticate", 828 | "tls": "", 829 | "persist": true, 830 | "proxy": "", 831 | "insecureHTTPParser": false, 832 | "authType": "", 833 | "senderr": false, 834 | "headers": [], 835 | "x": 450, 836 | "y": 260, 837 | "wires": [ 838 | [ 839 | "9e15d26d.67d59", 840 | "4b59cb1f.0b6074" 841 | ] 842 | ] 843 | }, 844 | { 845 | "id": "52e49f9332a5a83f", 846 | "type": "http request", 847 | "z": "f8297485.d32748", 848 | "name": "Request Read", 849 | "method": "POST", 850 | "ret": "obj", 851 | "paytoqs": "body", 852 | "url": "https://www.smartmetertexas.com/api/ondemandread", 853 | "tls": "", 854 | "persist": true, 855 | "proxy": "", 856 | "insecureHTTPParser": false, 857 | "authType": "", 858 | "senderr": false, 859 | "headers": [], 860 | "x": 480, 861 | "y": 360, 862 | "wires": [ 863 | [ 864 | "616cab00.8d1ed4", 865 | "8a692061.c38d8" 866 | ] 867 | ] 868 | }, 869 | { 870 | "id": "e8e5474956f5c253", 871 | "type": "http request", 872 | "z": "f8297485.d32748", 873 | "name": "Request Read", 874 | "method": "POST", 875 | "ret": "obj", 876 | "paytoqs": "body", 877 | "url": "https://www.smartmetertexas.com/api/usage/latestodrread", 878 | "tls": "", 879 | "persist": true, 880 | "proxy": "", 881 | "insecureHTTPParser": false, 882 | "authType": "", 883 | "senderr": false, 884 | "headers": [], 885 | "x": 740, 886 | "y": 460, 887 | "wires": [ 888 | [ 889 | "ba8a2ae2.a4c338", 890 | "45fd4f16.4d205" 891 | ] 892 | ] 893 | }, 894 | { 895 | "id": "8e5e4167.3de6a", 896 | "type": "ha-entity-config", 897 | "server": "3770e0fb.cd247", 898 | "deviceConfig": "3ef474cded84377d", 899 | "name": "sensor config for SMT Current Reading", 900 | "version": "6", 901 | "entityType": "sensor", 902 | "haConfig": [ 903 | { 904 | "property": "name", 905 | "value": "SMT Current Reading" 906 | }, 907 | { 908 | "property": "icon", 909 | "value": "" 910 | }, 911 | { 912 | "property": "entity_picture", 913 | "value": "" 914 | }, 915 | { 916 | "property": "entity_category", 917 | "value": "" 918 | }, 919 | { 920 | "property": "device_class", 921 | "value": "energy" 922 | }, 923 | { 924 | "property": "unit_of_measurement", 925 | "value": "kWh" 926 | }, 927 | { 928 | "property": "state_class", 929 | "value": "total_increasing" 930 | } 931 | ], 932 | "resend": true, 933 | "debugEnabled": false 934 | }, 935 | { 936 | "id": "3770e0fb.cd247", 937 | "type": "server", 938 | "name": "Home Assistant", 939 | "addon": true 940 | }, 941 | { 942 | "id": "3ef474cded84377d", 943 | "type": "ha-device-config", 944 | "name": "Electric Meter", 945 | "hwVersion": "", 946 | "manufacturer": "Oncor", 947 | "model": "", 948 | "swVersion": "" 949 | } 950 | ] -------------------------------------------------------------------------------- /Smart Meter Texas MQTT.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "id": "597d1fcff3b6e84f", 4 | "type": "tab", 5 | "label": "Smart Meter Texas MQTT", 6 | "disabled": false, 7 | "info": "" 8 | }, 9 | { 10 | "id": "1e8f2392d31a81b5", 11 | "type": "inject", 12 | "z": "597d1fcff3b6e84f", 13 | "name": "Retrieve Reading", 14 | "props": [ 15 | { 16 | "p": "payload", 17 | "v": "", 18 | "vt": "date" 19 | }, 20 | { 21 | "p": "topic", 22 | "v": "", 23 | "vt": "string" 24 | } 25 | ], 26 | "repeat": "30", 27 | "crontab": "", 28 | "once": true, 29 | "onceDelay": "1.0", 30 | "topic": "", 31 | "payload": "", 32 | "payloadType": "date", 33 | "x": 130, 34 | "y": 460, 35 | "wires": [ 36 | [ 37 | "23cb249ca9df1340" 38 | ] 39 | ] 40 | }, 41 | { 42 | "id": "cdc84190a6fd2db0", 43 | "type": "change", 44 | "z": "597d1fcff3b6e84f", 45 | "name": "Apply HTTP Config", 46 | "rules": [ 47 | { 48 | "t": "set", 49 | "p": "payload", 50 | "pt": "msg", 51 | "to": "resultjson", 52 | "tot": "flow" 53 | }, 54 | { 55 | "t": "set", 56 | "p": "headers.accept", 57 | "pt": "msg", 58 | "to": "application/json, text/plain, */*", 59 | "tot": "str" 60 | }, 61 | { 62 | "t": "set", 63 | "p": "headers.accept-language", 64 | "pt": "msg", 65 | "to": "en-US,en;q=0.9", 66 | "tot": "str" 67 | }, 68 | { 69 | "t": "set", 70 | "p": "headers.cache-control", 71 | "pt": "msg", 72 | "to": "no-cache", 73 | "tot": "str" 74 | }, 75 | { 76 | "t": "set", 77 | "p": "headers.content-type", 78 | "pt": "msg", 79 | "to": "application/json", 80 | "tot": "str" 81 | }, 82 | { 83 | "t": "set", 84 | "p": "headers.origin", 85 | "pt": "msg", 86 | "to": "https://www.smartmetertexas.com", 87 | "tot": "str" 88 | }, 89 | { 90 | "t": "set", 91 | "p": "headers.pragma", 92 | "pt": "msg", 93 | "to": "no-cache", 94 | "tot": "str" 95 | }, 96 | { 97 | "t": "set", 98 | "p": "headers.referer", 99 | "pt": "msg", 100 | "to": "https://www.smartmetertexas.com/home", 101 | "tot": "str" 102 | }, 103 | { 104 | "t": "set", 105 | "p": "headers.user-agent", 106 | "pt": "msg", 107 | "to": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36", 108 | "tot": "str" 109 | }, 110 | { 111 | "t": "set", 112 | "p": "headers.authorization", 113 | "pt": "msg", 114 | "to": "token", 115 | "tot": "flow" 116 | } 117 | ], 118 | "action": "", 119 | "property": "", 120 | "from": "", 121 | "to": "", 122 | "reg": false, 123 | "x": 550, 124 | "y": 460, 125 | "wires": [ 126 | [ 127 | "8b727a75d9e26e12" 128 | ] 129 | ] 130 | }, 131 | { 132 | "id": "a706bb6d540a8e26", 133 | "type": "switch", 134 | "z": "597d1fcff3b6e84f", 135 | "name": "Status Complete", 136 | "property": "payload.data.odrstatus", 137 | "propertyType": "msg", 138 | "rules": [ 139 | { 140 | "t": "eq", 141 | "v": "COMPLETED", 142 | "vt": "str" 143 | } 144 | ], 145 | "checkall": "true", 146 | "repair": false, 147 | "outputs": 1, 148 | "x": 950, 149 | "y": 480, 150 | "wires": [ 151 | [ 152 | "94e25ab15f67e0a7" 153 | ] 154 | ] 155 | }, 156 | { 157 | "id": "e72f9d0f4ff41c6c", 158 | "type": "change", 159 | "z": "597d1fcff3b6e84f", 160 | "name": "Apply HTTP Config", 161 | "rules": [ 162 | { 163 | "t": "set", 164 | "p": "payload", 165 | "pt": "msg", 166 | "to": "authjson", 167 | "tot": "flow" 168 | }, 169 | { 170 | "t": "set", 171 | "p": "headers.accept", 172 | "pt": "msg", 173 | "to": "application/json, text/plain, */*", 174 | "tot": "str" 175 | }, 176 | { 177 | "t": "set", 178 | "p": "headers.accept-language", 179 | "pt": "msg", 180 | "to": "en-US,en;q=0.9", 181 | "tot": "str" 182 | }, 183 | { 184 | "t": "set", 185 | "p": "headers.cache-control", 186 | "pt": "msg", 187 | "to": "no-cache", 188 | "tot": "str" 189 | }, 190 | { 191 | "t": "set", 192 | "p": "headers.content-type", 193 | "pt": "msg", 194 | "to": "application/json", 195 | "tot": "str" 196 | }, 197 | { 198 | "t": "set", 199 | "p": "headers.origin", 200 | "pt": "msg", 201 | "to": "https://www.smartmetertexas.com", 202 | "tot": "str" 203 | }, 204 | { 205 | "t": "set", 206 | "p": "headers.pragma", 207 | "pt": "msg", 208 | "to": "no-cache", 209 | "tot": "str" 210 | }, 211 | { 212 | "t": "set", 213 | "p": "headers.referer", 214 | "pt": "msg", 215 | "to": "https://www.smartmetertexas.com/home", 216 | "tot": "str" 217 | }, 218 | { 219 | "t": "set", 220 | "p": "headers.user-agent", 221 | "pt": "msg", 222 | "to": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36", 223 | "tot": "str" 224 | } 225 | ], 226 | "action": "", 227 | "property": "", 228 | "from": "", 229 | "to": "", 230 | "reg": false, 231 | "x": 290, 232 | "y": 260, 233 | "wires": [ 234 | [ 235 | "0c4943b8b62ab5b6" 236 | ] 237 | ] 238 | }, 239 | { 240 | "id": "f3493c22d2f64207", 241 | "type": "change", 242 | "z": "597d1fcff3b6e84f", 243 | "name": "", 244 | "rules": [ 245 | { 246 | "t": "set", 247 | "p": "token", 248 | "pt": "flow", 249 | "to": "payload", 250 | "tot": "msg" 251 | } 252 | ], 253 | "action": "", 254 | "property": "", 255 | "from": "", 256 | "to": "", 257 | "reg": false, 258 | "x": 760, 259 | "y": 280, 260 | "wires": [ 261 | [ 262 | "e2a4e9561718f396" 263 | ] 264 | ] 265 | }, 266 | { 267 | "id": "87164816306b4765", 268 | "type": "debug", 269 | "z": "597d1fcff3b6e84f", 270 | "name": "Debug: Login", 271 | "active": false, 272 | "tosidebar": true, 273 | "console": false, 274 | "tostatus": false, 275 | "complete": "payload", 276 | "targetType": "msg", 277 | "x": 600, 278 | "y": 240, 279 | "wires": [] 280 | }, 281 | { 282 | "id": "c43524ab8b651b8f", 283 | "type": "function", 284 | "z": "597d1fcff3b6e84f", 285 | "name": "Add Bearer", 286 | "func": "msg.payload = \"bearer \" + msg.payload.token;\nreturn msg;", 287 | "outputs": 1, 288 | "noerr": 0, 289 | "x": 590, 290 | "y": 280, 291 | "wires": [ 292 | [ 293 | "f3493c22d2f64207" 294 | ] 295 | ] 296 | }, 297 | { 298 | "id": "70ef89233f33cb5a", 299 | "type": "inject", 300 | "z": "597d1fcff3b6e84f", 301 | "name": "Build JSON", 302 | "props": [ 303 | { 304 | "p": "payload", 305 | "v": "", 306 | "vt": "date" 307 | }, 308 | { 309 | "p": "topic", 310 | "v": "", 311 | "vt": "string" 312 | } 313 | ], 314 | "repeat": "", 315 | "crontab": "", 316 | "once": true, 317 | "onceDelay": "0.1", 318 | "topic": "", 319 | "payload": "", 320 | "payloadType": "date", 321 | "x": 110, 322 | "y": 140, 323 | "wires": [ 324 | [ 325 | "d238a2fc96897e67" 326 | ] 327 | ] 328 | }, 329 | { 330 | "id": "afbaf4994608d1d1", 331 | "type": "function", 332 | "z": "597d1fcff3b6e84f", 333 | "name": "Create Login JSON", 334 | "func": "msg.payload = {\n \"username\": msg.username,\n \"password\": msg.password,\n \"rememberMe\": \"true\"\n};\nreturn msg;", 335 | "outputs": 1, 336 | "noerr": 0, 337 | "x": 470, 338 | "y": 100, 339 | "wires": [ 340 | [ 341 | "ddfaef7b2a651c0b" 342 | ] 343 | ] 344 | }, 345 | { 346 | "id": "d0d3b01261442029", 347 | "type": "function", 348 | "z": "597d1fcff3b6e84f", 349 | "name": "Create Read Request JSON", 350 | "func": "msg.payload = {\n \"ESIID\": msg.esiid,\n \"MeterNumber\": msg.meternumber\n};\nreturn msg;", 351 | "outputs": 1, 352 | "noerr": 0, 353 | "x": 500, 354 | "y": 140, 355 | "wires": [ 356 | [ 357 | "1f0b9380ebddf0ee" 358 | ] 359 | ] 360 | }, 361 | { 362 | "id": "876b182afad07815", 363 | "type": "function", 364 | "z": "597d1fcff3b6e84f", 365 | "name": "Create Read Result JSON", 366 | "func": "msg.payload = {\n \"ESIID\": msg.esiid\n};\nreturn msg;", 367 | "outputs": 1, 368 | "noerr": 0, 369 | "x": 500, 370 | "y": 180, 371 | "wires": [ 372 | [ 373 | "a046194916990406" 374 | ] 375 | ] 376 | }, 377 | { 378 | "id": "23cb249ca9df1340", 379 | "type": "switch", 380 | "z": "597d1fcff3b6e84f", 381 | "name": "Waiting for Response", 382 | "property": "readrequested", 383 | "propertyType": "flow", 384 | "rules": [ 385 | { 386 | "t": "eq", 387 | "v": "1", 388 | "vt": "str" 389 | } 390 | ], 391 | "checkall": "true", 392 | "repair": false, 393 | "outputs": 1, 394 | "x": 340, 395 | "y": 460, 396 | "wires": [ 397 | [ 398 | "cdc84190a6fd2db0" 399 | ] 400 | ] 401 | }, 402 | { 403 | "id": "94e25ab15f67e0a7", 404 | "type": "change", 405 | "z": "597d1fcff3b6e84f", 406 | "name": "Not Waiting for Response", 407 | "rules": [ 408 | { 409 | "t": "set", 410 | "p": "readrequested", 411 | "pt": "flow", 412 | "to": "0", 413 | "tot": "str" 414 | } 415 | ], 416 | "action": "", 417 | "property": "", 418 | "from": "", 419 | "to": "", 420 | "reg": false, 421 | "x": 1170, 422 | "y": 480, 423 | "wires": [ 424 | [ 425 | "d01bdf9250a193a0" 426 | ] 427 | ] 428 | }, 429 | { 430 | "id": "ddfaef7b2a651c0b", 431 | "type": "change", 432 | "z": "597d1fcff3b6e84f", 433 | "name": "", 434 | "rules": [ 435 | { 436 | "t": "set", 437 | "p": "authjson", 438 | "pt": "flow", 439 | "to": "payload", 440 | "tot": "msg" 441 | } 442 | ], 443 | "action": "", 444 | "property": "", 445 | "from": "", 446 | "to": "", 447 | "reg": false, 448 | "x": 730, 449 | "y": 100, 450 | "wires": [ 451 | [] 452 | ] 453 | }, 454 | { 455 | "id": "1f0b9380ebddf0ee", 456 | "type": "change", 457 | "z": "597d1fcff3b6e84f", 458 | "name": "", 459 | "rules": [ 460 | { 461 | "t": "set", 462 | "p": "readjson", 463 | "pt": "flow", 464 | "to": "payload", 465 | "tot": "msg" 466 | } 467 | ], 468 | "action": "", 469 | "property": "", 470 | "from": "", 471 | "to": "", 472 | "reg": false, 473 | "x": 730, 474 | "y": 140, 475 | "wires": [ 476 | [] 477 | ] 478 | }, 479 | { 480 | "id": "a046194916990406", 481 | "type": "change", 482 | "z": "597d1fcff3b6e84f", 483 | "name": "", 484 | "rules": [ 485 | { 486 | "t": "set", 487 | "p": "resultjson", 488 | "pt": "flow", 489 | "to": "payload", 490 | "tot": "msg" 491 | } 492 | ], 493 | "action": "", 494 | "property": "", 495 | "from": "", 496 | "to": "", 497 | "reg": false, 498 | "x": 730, 499 | "y": 180, 500 | "wires": [ 501 | [] 502 | ] 503 | }, 504 | { 505 | "id": "dea77ece1f527941", 506 | "type": "switch", 507 | "z": "597d1fcff3b6e84f", 508 | "name": "Request Good", 509 | "property": "payload.data.statusReason", 510 | "propertyType": "msg", 511 | "rules": [ 512 | { 513 | "t": "eq", 514 | "v": "Request submitted successfully for further processing", 515 | "vt": "str" 516 | } 517 | ], 518 | "checkall": "true", 519 | "repair": false, 520 | "outputs": 1, 521 | "x": 660, 522 | "y": 380, 523 | "wires": [ 524 | [ 525 | "0150f59917152fd7" 526 | ] 527 | ] 528 | }, 529 | { 530 | "id": "0150f59917152fd7", 531 | "type": "change", 532 | "z": "597d1fcff3b6e84f", 533 | "name": "Waiting for Response", 534 | "rules": [ 535 | { 536 | "t": "set", 537 | "p": "readrequested", 538 | "pt": "flow", 539 | "to": "1", 540 | "tot": "str" 541 | } 542 | ], 543 | "action": "", 544 | "property": "", 545 | "from": "", 546 | "to": "", 547 | "reg": false, 548 | "x": 860, 549 | "y": 380, 550 | "wires": [ 551 | [] 552 | ] 553 | }, 554 | { 555 | "id": "6544d74bb811947f", 556 | "type": "debug", 557 | "z": "597d1fcff3b6e84f", 558 | "name": "Debug: Get Reading", 559 | "active": false, 560 | "tosidebar": true, 561 | "console": false, 562 | "tostatus": false, 563 | "complete": "payload", 564 | "targetType": "msg", 565 | "x": 960, 566 | "y": 440, 567 | "wires": [] 568 | }, 569 | { 570 | "id": "c70f916d692a88e6", 571 | "type": "change", 572 | "z": "597d1fcff3b6e84f", 573 | "name": "Apply HTTP Config", 574 | "rules": [ 575 | { 576 | "t": "set", 577 | "p": "payload", 578 | "pt": "msg", 579 | "to": "readjson", 580 | "tot": "flow" 581 | }, 582 | { 583 | "t": "set", 584 | "p": "headers.accept", 585 | "pt": "msg", 586 | "to": "application/json, text/plain, */*", 587 | "tot": "str" 588 | }, 589 | { 590 | "t": "set", 591 | "p": "headers.accept-language", 592 | "pt": "msg", 593 | "to": "en-US,en;q=0.9", 594 | "tot": "str" 595 | }, 596 | { 597 | "t": "set", 598 | "p": "headers.cache-control", 599 | "pt": "msg", 600 | "to": "no-cache", 601 | "tot": "str" 602 | }, 603 | { 604 | "t": "set", 605 | "p": "headers.content-type", 606 | "pt": "msg", 607 | "to": "application/json", 608 | "tot": "str" 609 | }, 610 | { 611 | "t": "set", 612 | "p": "headers.origin", 613 | "pt": "msg", 614 | "to": "https://www.smartmetertexas.com", 615 | "tot": "str" 616 | }, 617 | { 618 | "t": "set", 619 | "p": "headers.pragma", 620 | "pt": "msg", 621 | "to": "no-cache", 622 | "tot": "str" 623 | }, 624 | { 625 | "t": "set", 626 | "p": "headers.referer", 627 | "pt": "msg", 628 | "to": "https://www.smartmetertexas.com/home", 629 | "tot": "str" 630 | }, 631 | { 632 | "t": "set", 633 | "p": "headers.user-agent", 634 | "pt": "msg", 635 | "to": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36", 636 | "tot": "str" 637 | }, 638 | { 639 | "t": "set", 640 | "p": "headers.authorization", 641 | "pt": "msg", 642 | "to": "token", 643 | "tot": "flow" 644 | } 645 | ], 646 | "action": "", 647 | "property": "", 648 | "from": "", 649 | "to": "", 650 | "reg": false, 651 | "x": 290, 652 | "y": 360, 653 | "wires": [ 654 | [ 655 | "d5590593db6be0a7" 656 | ] 657 | ] 658 | }, 659 | { 660 | "id": "3237e5bde125a28d", 661 | "type": "debug", 662 | "z": "597d1fcff3b6e84f", 663 | "name": "Debug: Read Meter", 664 | "active": false, 665 | "tosidebar": true, 666 | "console": false, 667 | "tostatus": false, 668 | "complete": "payload", 669 | "targetType": "msg", 670 | "x": 680, 671 | "y": 340, 672 | "wires": [] 673 | }, 674 | { 675 | "id": "e2a4e9561718f396", 676 | "type": "debug", 677 | "z": "597d1fcff3b6e84f", 678 | "name": "Debug: Auth Token", 679 | "active": false, 680 | "tosidebar": true, 681 | "console": false, 682 | "tostatus": false, 683 | "complete": "payload", 684 | "targetType": "msg", 685 | "x": 950, 686 | "y": 280, 687 | "wires": [] 688 | }, 689 | { 690 | "id": "d238a2fc96897e67", 691 | "type": "credentials", 692 | "z": "597d1fcff3b6e84f", 693 | "name": "Credentials", 694 | "props": [ 695 | { 696 | "value": "username", 697 | "type": "msg" 698 | }, 699 | { 700 | "value": "password", 701 | "type": "msg" 702 | }, 703 | { 704 | "value": "esiid", 705 | "type": "msg" 706 | }, 707 | { 708 | "value": "meternumber", 709 | "type": "msg" 710 | } 711 | ], 712 | "x": 270, 713 | "y": 140, 714 | "wires": [ 715 | [ 716 | "afbaf4994608d1d1", 717 | "d0d3b01261442029", 718 | "876b182afad07815" 719 | ] 720 | ] 721 | }, 722 | { 723 | "id": "ca166af012e6e594", 724 | "type": "cronplus", 725 | "z": "597d1fcff3b6e84f", 726 | "name": "Read Meter", 727 | "outputField": "payload", 728 | "timeZone": "", 729 | "storeName": "", 730 | "commandResponseMsgOutput": "output1", 731 | "defaultLocation": "", 732 | "defaultLocationType": "default", 733 | "outputs": 1, 734 | "options": [ 735 | { 736 | "name": "0 min past the hour", 737 | "topic": "0 min past the hour", 738 | "payloadType": "str", 739 | "payload": "", 740 | "expressionType": "cron", 741 | "expression": "0 * * * * ", 742 | "location": "", 743 | "offset": "0", 744 | "solarType": "all", 745 | "solarEvents": "sunrise,sunset" 746 | } 747 | ], 748 | "x": 110, 749 | "y": 360, 750 | "wires": [ 751 | [ 752 | "c70f916d692a88e6" 753 | ] 754 | ] 755 | }, 756 | { 757 | "id": "e1453dc93c9d6576", 758 | "type": "cronplus", 759 | "z": "597d1fcff3b6e84f", 760 | "name": "Authenticate", 761 | "outputField": "payload", 762 | "timeZone": "", 763 | "storeName": "", 764 | "commandResponseMsgOutput": "output1", 765 | "defaultLocation": "", 766 | "defaultLocationType": "default", 767 | "outputs": 1, 768 | "options": [ 769 | { 770 | "name": "56 min past the hour", 771 | "topic": "56 min past the hour", 772 | "payloadType": "str", 773 | "payload": "", 774 | "expressionType": "cron", 775 | "expression": "0 56 * * * * ", 776 | "location": "", 777 | "offset": "0", 778 | "solarType": "all", 779 | "solarEvents": "sunrise,sunset" 780 | } 781 | ], 782 | "x": 110, 783 | "y": 260, 784 | "wires": [ 785 | [ 786 | "e72f9d0f4ff41c6c" 787 | ] 788 | ] 789 | }, 790 | { 791 | "id": "0c4943b8b62ab5b6", 792 | "type": "http request", 793 | "z": "597d1fcff3b6e84f", 794 | "name": "Log In", 795 | "method": "POST", 796 | "ret": "obj", 797 | "paytoqs": "body", 798 | "url": "https://www.smartmetertexas.com/commonapi/user/authenticate", 799 | "tls": "", 800 | "persist": true, 801 | "proxy": "", 802 | "insecureHTTPParser": false, 803 | "authType": "", 804 | "senderr": false, 805 | "headers": [], 806 | "x": 450, 807 | "y": 260, 808 | "wires": [ 809 | [ 810 | "87164816306b4765", 811 | "c43524ab8b651b8f" 812 | ] 813 | ] 814 | }, 815 | { 816 | "id": "d5590593db6be0a7", 817 | "type": "http request", 818 | "z": "597d1fcff3b6e84f", 819 | "name": "Request Read", 820 | "method": "POST", 821 | "ret": "obj", 822 | "paytoqs": "body", 823 | "url": "https://www.smartmetertexas.com/api/ondemandread", 824 | "tls": "", 825 | "persist": true, 826 | "proxy": "", 827 | "insecureHTTPParser": false, 828 | "authType": "", 829 | "senderr": false, 830 | "headers": [], 831 | "x": 480, 832 | "y": 360, 833 | "wires": [ 834 | [ 835 | "3237e5bde125a28d", 836 | "dea77ece1f527941" 837 | ] 838 | ] 839 | }, 840 | { 841 | "id": "8b727a75d9e26e12", 842 | "type": "http request", 843 | "z": "597d1fcff3b6e84f", 844 | "name": "Request Read", 845 | "method": "POST", 846 | "ret": "obj", 847 | "paytoqs": "body", 848 | "url": "https://www.smartmetertexas.com/api/usage/latestodrread", 849 | "tls": "", 850 | "persist": true, 851 | "proxy": "", 852 | "insecureHTTPParser": false, 853 | "authType": "", 854 | "senderr": false, 855 | "headers": [], 856 | "x": 740, 857 | "y": 460, 858 | "wires": [ 859 | [ 860 | "6544d74bb811947f", 861 | "a706bb6d540a8e26" 862 | ] 863 | ] 864 | }, 865 | { 866 | "id": "d01bdf9250a193a0", 867 | "type": "mqtt out", 868 | "z": "597d1fcff3b6e84f", 869 | "name": "MQTT: Send Reading", 870 | "topic": "smt/reading", 871 | "qos": "", 872 | "retain": "true", 873 | "respTopic": "", 874 | "contentType": "", 875 | "userProps": "", 876 | "correl": "", 877 | "expiry": "", 878 | "broker": "", 879 | "x": 1400, 880 | "y": 480, 881 | "wires": [] 882 | } 883 | ] 884 | -------------------------------------------------------------------------------- /smartmetertexas.yaml: -------------------------------------------------------------------------------- 1 | # Needed for mqtt sensor addition to home assistant. 2 | # Can be used in the energy dashboard as is 3 | mqtt: 4 | sensor: 5 | name: SMT Current Reading 6 | state_topic: "smt/reading" 7 | unit_of_measurement: "kWh" 8 | device_class: energy 9 | state_class: total_increasing 10 | 11 | # Below is OPTIONAL 12 | # Use only if you do not want to use the sensor above IN the native Energy Dashboard 13 | # If importing file as configuration package, uncomment the entities to create the utility meter entities 14 | #sensor: 15 | # - platform: template 16 | # sensors: 17 | 18 | # smt_electricity_cost_this_hour: 19 | # friendly_name: Electricity Cost This Hour 20 | # unit_of_measurement: '$' 21 | # value_template: "{{ (states('sensor.smt_energy_hourly') | float * states('input_number.smt_energy_cost') | float) | round (2) }}" 22 | 23 | # smt_electricity_cost_last_hour: 24 | # friendly_name: Electricity Cost Last Hour 25 | # unit_of_measurement: '$' 26 | # value_template: "{{ (state_attr('sensor.smt_energy_hourly','last_period') | float * states('input_number.smt_energy_cost') | float) | round (2) }}" 27 | 28 | # smt_electricity_cost_today: 29 | # friendly_name: Electricity Cost Today 30 | # unit_of_measurement: '$' 31 | # value_template: "{{ (states('sensor.smt_energy_daily') | float * states('input_number.smt_energy_cost') | float) | round (2) }}" 32 | 33 | # smt_electricity_cost_yesterday: 34 | # friendly_name: Electricity Cost Yesterday 35 | # unit_of_measurement: '$' 36 | # value_template: "{{ (state_attr('sensor.smt_energy_daily','last_period') | float * states('input_number.smt_energy_cost') | float) | round (2) }}" 37 | 38 | # smt_electricity_cost_this_week: 39 | # friendly_name: Electricity Cost This Week 40 | # unit_of_measurement: '$' 41 | # value_template: "{{ (states('sensor.smt_energy_weekly') | float * states('input_number.smt_energy_cost') | float) | round (2) }}" 42 | 43 | # smt_electricity_cost_last_week: 44 | # friendly_name: Electricity Cost Last Week 45 | # unit_of_measurement: '$' 46 | # value_template: "{{ (state_attr('sensor.smt_energy_weekly','last_period') | float * states('input_number.smt_energy_cost') | float) | round (2) }}" 47 | 48 | # smt_electricity_cost_this_month: 49 | # friendly_name: Electricity Cost This Month 50 | # unit_of_measurement: '$' 51 | # value_template: "{{ (states('sensor.smt_energy_monthly') | float * states('input_number.smt_energy_cost') | float) | round (2) }}" 52 | 53 | # smt_electricity_cost_last_month: 54 | # friendly_name: Electricity Cost Last Month 55 | # unit_of_measurement: '$' 56 | # value_template: "{{ (state_attr('sensor.smt_energy_monthly','last_period') | float * states('input_number.smt_energy_cost') | float) | round (2) }}" 57 | 58 | # smt_electricity_cost_this_year: 59 | # friendly_name: Electricity Cost This Year 60 | # unit_of_measurement: '$' 61 | # value_template: "{{ (states('sensor.smt_energy_yearly') | float * states('input_number.smt_energy_cost') | float) | round (2) }}" 62 | 63 | # smt_electricity_cost_last_year: 64 | # friendly_name: Electricity Cost Last Year 65 | # unit_of_measurement: '$' 66 | # value_template: "{{ (state_attr('sensor.smt_energy_yearly','last_period') | float * states('input_number.smt_energy_cost') | float) | round (2) }}" 67 | 68 | # smt_energy_last_hour: 69 | # friendly_name: Energy Last Hour 70 | # unit_of_measurement: 'kWh' 71 | # value_template: "{{ state_attr('sensor.smt_energy_hourly','last_period') }}" 72 | 73 | 74 | #utility_meter: 75 | # smt_energy_hourly: 76 | # source: sensor.smt_current_reading 77 | # cycle: hourly 78 | 79 | # smt_energy_daily: 80 | # source: sensor.smt_current_reading 81 | # cycle: daily 82 | 83 | # smt_energy_weekly: 84 | # source: sensor.smt_current_reading 85 | # cycle: weekly 86 | 87 | # smt_energy_monthly: 88 | # source: sensor.smt_current_reading 89 | # cycle: monthly 90 | 91 | # smt_energy_yearly: 92 | # source: sensor.smt_current_reading 93 | # cycle: yearly 94 | 95 | #input_number: 96 | # smt_energy_cost: 97 | # name: Electricity Cost 98 | # mode: box 99 | # min: 0 100 | # max: 2.50 101 | # step: .001 102 | # unit_of_measurement: "$/kWh" 103 | --------------------------------------------------------------------------------