Please Note This forum exists for community support for the Mango product family and the Radix IoT Platform. Although Radix IoT employees participate in this forum from time to time, there is no guarantee of a response to anything posted here, nor can Radix IoT, LLC guarantee the accuracy of any information expressed or conveyed. Specific project questions from customers with active support contracts are asked to send requests to support@radixiot.com.

Radix IoT Website Mango 3 Documentation Website Mango 4 Documentation Website

Http retriever html to regex


  • Hello, I have just finished installing a solar array and need to get my enphase envoy gateway to communicate with mango, here is the html code of the data. All I need is the current watts to put into mango.

    366a
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
    <html lang="en">
    <!-- START HEAD CONTENT -->
    <head>
    <title>production</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <!-- include style sheet -->
    <link rel="styleSheet" type="text/css" href="/include/css/style.css" >
    <style type="text/css">.nav { width: 190px; font-size: 10px; padding: 10px; margin: 10px;float: left; background: #D8DBD4; color: #213d30; border: 2px solid #333; }
    .navholder { width: auto; height: auto; float: left; margin: 10px 0px 0 0 }
    .tbl_cap { font-size:8pt; background-color:#DD4F05; color:white; border-style:solid; border-width:1px; border-color:white; }
    .tbl_bod { font-family:arial; font-size:8pt; color:#213d30; background-color:#D8DBD4; border-style:solid; border-color:white; border-width:1px; }
    .tbl_bod_right { font-family:arial; font-size:8pt; color:#213d30; background-color:#D8DBD4; border-style:solid; border-color:white; border-width:1px; text-align:right }
    .tbl_hdr { font-size:8pt; background-color:#CCCCCC; border-style:solid; border-width:1px; border-color:white; color:#213d30; }
    .clearer { clear: both; font-size: 1px; }
    .outer { width: auto; height: auto; padding: 0px; font-size: 10px }
    .table1 { width: 100%; margin-left: auto; margin-right: auto;border: 1px solid #CCCCCC }
    .table2 { width: 100%;text-align: center;margin-left: auto; margin-right: auto;border: 1px solid #CCCCCC }
    .table3 { width: 720px;margin-left: auto; margin-right: auto;border: 1px solid #CCCCCC }
    .div_params { height: 190px; width: 380px; overflow: auto;margin-left: auto; margin-right: auto; }
    .div_edit_params { height: 230px; width: 470px; overflow: auto;margin-left: auto; margin-right: auto; }
    .div_outer_box { width: 720px;margin-left: auto; margin-right: auto;border: 1px solid #FFFFFF }
    .txt_expl_center { font-size: 12px; text-align:center;height: auto; border: 1px solid #CCCCCC;margin-top: 5px; margin-left: 5px; margin-right: auto; }
    .label_text_right { text-align: right; border: 1px solid #CCCCCC;font-size: 10px; }
    .label_text_left { text-align: left; border: 1px solid #CCCCCC;font-size: 10px; }
    .label_text_left_alert { text-align: left; color: #7d3020; border: 1px solid #CCCCCC;font-size: 12px; }
    .link_cell_right { font-size: 10px;height: auto; border: 1px solid #CCCCCC;text-align: right;margin-top: 5px; margin-left: auto; margin-right: 25px; }
    .link_cell_left { font-size: 10px;height: auto; border: 1px solid #CCCCCC;text-align: left;margin-top: 5px; margin-left: 25px; margin-right: auto; }
    .link_cell_right_out { font-size: 12px; padding: 15px;height: auto; border: 1px solid #CCCCCC;text-align: right;margin-top: 5px; margin-left: auto; margin-right: 25px; }
    .link_cell_left_out { font-size: 12px;height: auto; border: 1px solid #CCCCCC;text-align: left; padding: 15px;margin-top: 5px; margin-left: 25px; margin-right: auto; }
    .ns_fldset { height: auto; width: 720px; border: 1px solid #7d3020; background: #CCCCCC; padding: 15px; }
    .ns_fldset_inner { border: 1px solid #7d3020; background: #CCCCCC; }
    .enp_legend { text-align: left; border: 1px solid #7d3020; background: #FFD401; }
    .input_left { border: 1px solid #CCCCCC; text-align: left; }
    .grid_config { float: left; margin-left: 50px; width: 830px; text-align: center; }
    .swimgnav { width: 160px; height: auto; font-size: 10px; padding: 10px; margin: 10px;float: left; background: #D8DBD4; color: #213d30;border: 2px solid #333; }
    .frames { clear: right; width: auto; padding: 15px; height: auto; margin-left: 200px; margin-right: auto; }
    .tbl_cap_left { font-size:8pt; background-color:#DD4F05; color:white; border-style:solid; border-width:1px; border-color:white; text-align:left; }
    .tbl_cap_center { font-size:8pt; background-color:#DD4F05; color:white; border-style:solid; border-width:1px; border-color:white; text-align:center; }
    .tbl_bod_left { font-family:arial; font-size:8pt; color:#213d30; background-color:#D8DBD4; border-style:solid; border-color:white; border-width:1px; text-align:left; }
    .tablePaged { float: left;width: 100%;text-align: center;margin-left: auto; margin-right: auto;border: 1px solid #CCCCCC }
    .table.dataTable { margin: 0 auto; clear: both; width: 100%; }
    .table.dataTable thead th { padding: 3px 18px 3px 10px;border-bottom: 1px solid black;font-weight: bold;cursor: pointer;*cursor: hand; }
    .table.dataTable tfoot th { padding: 3px 18px 3px 10px;border-top: 1px solid black;font-weight: bold; }
    .table.dataTable td { padding: 3px 10px; }
    .table.dataTable td.center, table.dataTable td.dataTables_empty { text-align: center; }
    .table.dataTable tr.odd { background-color: #E2E4FF; }
    .table.dataTable tr.even { background-color: white; }
    .table.dataTable tr.odd td.sorting_1 { background-color: #D3D6FF; }
    .table.dataTable tr.odd td.sorting_2 { background-color: #DADCFF; }
    .table.dataTable tr.odd td.sorting_3 { background-color: #E0E2FF; }
    .table.dataTable tr.even td.sorting_1 { background-color: #EAEBFF; }
    .table.dataTable tr.even td.sorting_2 { background-color: #F2F3FF; }
    .table.dataTable tr.even td.sorting_3 { background-color: #F9F9FF; }
    .dataTables_wrapper { position: relative; clear: both; *zoom: 1; }
    .dataTables_length { float: left; }
    .dataTables_filter { margin: 0px 0px 2px 0px; float: right; text-align: right; }
    .DTTT_button_text { margin: 0px 0px 0px 3px; float: right; text-align: right; }
    .dataTables_info { clear: both; float: left; }
    .dataTables_paginate { float: right; text-align: right; }
    .paging_full_numbers { height: 22px; line-height: 22px; }
    .paging_full_numbers a:active { outline: none }
    .paging_full_numbers a:hover { text-decoration: none; }
    .paging_full_numbers a.paginate_button,.paging_full_numbers a.paginate_active { border: 1px solid #aaa;-webkit-border-radius: 5px;-moz-border-radius: 5px;border-radius: 5px;padding: 2px 5px;margin: 0 3px;cursor: pointer;*cursor: hand;color: #333 !important; }
    .paging_full_numbers a.paginate_button { background-color: #ddd; }
    .paging_full_numbers a.paginate_button:hover { background-color: #ccc;text-decoration: none !important; }
    .paging_full_numbers a.paginate_active { background-color: #99B3FF; }
    .paging_full_numbers a.paginate_button_disabled { border: 1px solid #aaa;-webkit-border-radius: 5px;-moz-border-radius: 5px;border-radius: 5px;padding: 2px 5px;margin: 0 3px;cursor: default;opacity: 0.6;color: gray; }
    .dataTables_processing { position: absolute;top: 50%;left: 50%;width: 250px;height: 30px;margin-left: -125px;margin-top: -15px;padding: 14px 0 2px 0;border: 1px solid #ddd;text-align: center;color: #999;font-size: 14px;background-color: white; }
    .sorting { padding: 2px 15px;background-clip: padding-box;background-origin: border-box;background-image: url('/images/sort_both.png');background-repeat: no-repeat;background-position: right center;background-color: #DD4F05; }
    .sorting_asc { padding: 2px 15px;background-clip: padding-box;background-origin: border-box;background-image: url('/images/sort_asc.png');background-repeat: no-repeat;background-position: right center;background-color: #DD4F05; }
    .sorting_desc { padding: 2px 15px;background-clip: padding-box;background-origin: border-box;background-image: url('/images/sort_desc.png');background-repeat: no-repeat;background-position: right center;background-color: #DD4F05; }
    .sorting_asc_disabled { padding: 2px 15px;background-clip: padding-box;background-origin: border-box;background-image: url('/images/sort_asc_disabled.png');background-repeat: no-repeat;background-position: right center;background-color: #DD4F05; }
    .sorting_desc_disabled { padding: 2px 15px;background-clip: padding-box;background-origin: border-box;background-image: url('/images/sort_desc_disabled.png');background-repeat: no-repeat;background-position: right center;background-color: #DD4F05; }
    .table.dataTable th:active { outline: none; }
    .p.t_fixed_header_scroll_inner { width: 100%;height: 200px; }
    .div.t_fixed_header_scroll_outer { top: 0; left: 0; visibility: hidden; width: 200px; height: 150px; overflow: hidden; }
    .div.t_fixed_header { position: relative;margin: 0;width: 100%; }
    .div.t_fixed_header * { margin: 0;padding: 0; }
    .div.t_fixed_header table.head { position: relative; }
    .div.t_fixed_header table { width: 100%;table-layout: fixed;empty-cells: show;border-collapse: collapse;border-spacing: 0; }
    .div.t_fixed_header table.headtable td.fillScrollbar { font-size: 0px;-o-text-overflow: inherit;text-overflow: inherit; }
    .div.t_fixed_header tr th, div.t_fixed_header tr td { overflow: hidden;white-space: nowrap;-o-text-overflow: ellipsis;text-overflow: ellipsis; }
    .div.t_fixed_header.t_fixed_header_wrap tr th, div.t_fixed_header.t_fixed_header_wrap tr td { white-space: normal; }
    .div.t_fixed_header div.body { overflow-x: auto;padding: 0;width: 100%; }
    .div.t_fixed_header_main_wrapper { position: relative;overflow: hidden; }
    .div.t_fixed_header_main_wrapper_child { position: relative;width: 100% }
    .div.t_fixed_header_main_wrapper.ui { border-width: 1px 1px 1px 1px;border-style: solid;font-weight: normal;font-size: 1.1em; }
    .div.t_fixed_header_main_wrapper.ui div.t_fixed_header_caption { text-align: center;font-weight: bold;padding: 0 5px;height: 30px;line-height: 30px;border-width: 0 0 1px 0;border-style: solid; }
    .div.t_fixed_header_main_wrapper.ui div.t_fixed_header_caption.toggle { border-width: 0; }
    .div.t_fixed_header div.headtable { border: 0;overflow-x: hidden;overflow-y: auto; }
    .div.t_fixed_header.ui .body { border-width: 1px 0 0 0;border-style: solid;background-image: none; }
    .div.t_fixed_header.ui .headtable th { padding: 5px;text-align: center;border-width: 0 1px 0 0;border-style: solid; }
    .div.t_fixed_header.ui .headtable .hover { cursor: pointer;height: 16px; }
    .div.t_fixed_header.ui .headtable th span.ui-resize { background: transparent;cursor: col-resize;display: inline;float: right;height: 20px;margin: -3px -5px -5px 0;width: 5px;z-index: 10000; }
    .div.t_fixed_header.ui div.ui-resize-ghost { display: none;position: absolute;top: 0;width: 2px;border: none; }
    .div.t_fixed_header.ui .body tr { border: 0px; }
    .div.t_fixed_header.ui .body td { padding: 5px;text-align: left;line-height: 15px; }
    .div.t_fixed_header.ui .body tr td { border-width: 0 1px 1px 0;border-style: solid;background: none; }
    .div.t_fixed_header.ui .body tr:last-child td { border-bottom-width: 0px; }
    .div.t_fixed_header.ui.default .headtable th:last-child, div.t_fixed_header.ui.default .body td:last-child { border-right-width: 0px; }
    .div.t_fixed_header.ui .body td.last_td, div.t_fixed_header.ui .headtable th.last_td { border-right-width: 0px; }
    .div.t_fixed_header_main_wrapper.ui div.pager { border-width: 0 0 0 0;padding: 4px 2px 2px 3px;overflow: hidden;background-image: none; }
    .div.t_fixed_header_main_wrapper.ui div.pager .button { float: right;padding: 4px 0;cursor: pointer; }
    .div.t_fixed_header_main_wrapper.ui div.pager .button.noborder { border-right-width : 0px; }
    .div.t_fixed_header_main_wrapper.ui div.pager .button span { margin: 0 4px; }
    .div.t_fixed_header_main_wrapper.ui div.pager div.page_infos { height: 27px;line-height: 27px;float: right;margin-right: 10px;font-weight: normal; }
    </style>
    <!-- include JS libraries -->
    <script type="text/JavaScript">
    <!--
    function refreshPage(period) {
    setTimeout("document.forms['tpm_status'].submit()", period);
    }
    // -->
    </script>

    </head>
    <!-- END HEAD CONTENT -->
      <body>
    <!-- START TOP NAV CONTENT -->
      <form action="/production" method="post">
      <div class="nav_header">
      <input type="hidden" name="fname" value="nav_header" >
      <input type="hidden" name="profile" value="0" >
      <input type="hidden" name="regSpec" value="0" >
      <input type="hidden" name="country" value="0" >
      <input type="hidden" name="regSpecName" value="" >
      <input type="hidden" name="profileName" value="" >
      <table width="100%" style="border-style:none;">
        <tr>
          <td class="hdr_line" valign="middle">
              <a href="http://enphase.com/en/" title="Visit the Enphase Energy website">
              <img src="/images/enphase-logo.png"
              style="background:white; text-align:left; height:50px;"
              alt="Enphase Energy, Inc.">
              </a>
              </td>
          <td class="hdr_line" valign="middle" colspan="4">Envoy Serial Number: 121329011145</td>
          <td class="hdr_line" valign="middle">
              <a href="http://enlighten.enphaseenergy.com?locale=en" title="Visit the Enlighten website">
              <img src="/images/enlighten_logo.png"
              style="background:white; text-align:right; height:40px;"
              alt="Enlighten website">
              </a>
              </td>
        </tr>
        <tr>
          <td class="hdr_line"><a href="/home?locale=en">Home</a></td>
          <td class="hdr_line"><a href="/event?locale=en">Events</a></td>
          <td class="hdr_line"><a id="nav_header_production" href="/production?locale=en">Production</a></td>           
          <td class="hdr_line"><a id="nav_header_inventory" href="/inventory?locale=en">Inventory</a></td>
          <td class="hdr_line"><a id="nav_header_admin" href="/admin/home?locale=en">Administration</a></td>
          <td class="hdr_line"></td>
          <td class="hdr_line" align="left">Language
            <select id="locale" name="locale" onchange="this.form.submit()">               <option value="it">italiano</option><option value="de">Deutsch</option><option value="fr">français</option><option value="es">Español</option><option value="en" selected="selected" >English</option>
            </select>
          </td>
        </tr>
      </table>
      </div>
      </form>
      <HR>
    <!-- END TOP NAV CONTENT -->
    <!-- START MAIN PAGE CONTENT -->
    

    1e2
    <h1>System Energy Production</h1>
    <div style="margin-right: auto; margin-left: auto;"><table>
    <tr><td colspan="3">System has been live since
    <div class=good>Fri Jan 10, 2014 10:14 AM EST</div></td></tr>
    <tr><td>Currently</td> <td> 0 W</td></tr><tr><td>Today</td> <td> 8.11 kWh</td></tr><tr><td>Past Week</td> <td> 26.9 kWh</td></tr><tr><td>Since Installation</td> <td> 26.9 kWh</td></tr>
    </table><br></div>

    187
    <!-- END MAIN PAGE CONTENT -->
    <!-- START BOTTOM NAV CONTENT -->
    <HR>
    <div style="margin-left: auto; margin-right:auto; width: 100%; text-align: center; ">
    © 2007-2012, [e] Enphase Energy, Inc. All rights reserved. |
    <a href="http://www.enphaseenergy.com/licenses">Licenses</a>
    <!-- END BOTTOM NAV CONTENT -->
    <br><br>
    </div>
    </body>
    </html>

    0


    1. Point the HTTP retriever URL to your page
    2. Create a Numeric point with value regex: Currently.?(\d+.?\d)
    3. Sit back, relax, and enjoy the sunshine.

  • Hi, I am just starting out with Mango Automation. My hardware is Spark Core (spark.io).
    I am trying to use HTTP Retriever to get sensor values exposed through spark API.
    I am having similar trouble with parsing the html response with regex. I haven't been able to replicate the results that worked at regexpal.com. Any help with this would be very much appreciated. Thanks!

    My response looks like:

    {
    "cmd": "VarReturn",
    "name": "Outlet4State",
    "result": 0,
    "coreInfo": {
    "last_app": "",
    "last_heard": "2014-08-25T00:55:52.299Z",
    "connected": true,
    "deviceID": "xx"
    }
    }

    All I care about now is the binary output "result"