JQuery Extension (Plugin) to bind IoT devices to a Corrently UI.
This JQuery extension will replace the html code of a DOM Element with values from an IoT Device. Purpose of this extension to jquery is to easy work with /things-values/ within a corrently based UI/dashboard.
Insert script tag after JQuery Include
<script src="https://unpkg.com/corrently-iot-jquery@latest/index.js"></script>
<span class="iot" data-iot="0x12345678" data-subscribe="20">-</span>
$(document).ready(function() {
$('.iot').iot();
});
data-iot
set the device address
data-subscribe
refresh value every x seconds
<span class="account" data-account="0x12345678" data-field="totalConsumption">-</span>
$(document).ready(function() {
$('.account').account();
});
data-account
set the wallet account
data-field
field to set as given by Corrently API Endpoint (meteredconsumption, convertedSupply, generation, ...)