7:52 am


Moderators
March 7, 2017

One way you could do this is to change your local DNS server setting to something that cannot resolve api.thingspeak.com or thingspeak.com. You can also create a custom plugin that goes RED/GREEN if the device has not sent data to ThingSpeak within a certain time. Here’s an example:
Plugin HTML:
%%PLUGIN_CSS%%
%%PLUGIN_JAVASCRIPT%%
Device data collection status
Plugin CSS:
body { background-color: #fff; }
.led-box {
height: 90%;
width: 100%;
margin-top: 30px;
float: left;
}
.led-box p {
text-align: center;
font-size: 25px;
margin: 1em;
}
.red-led {
margin: 0 auto;
width: 100px;
height: 100px;
background-color: #F00;
border-radius: 50%;
box-shadow: rgba(0, 0, 0, 0.2) 0 -1px 7px 1px, inset #441313 0 -1px 9px, rgba(255, 0, 0, 0.5) 0 2px 12px;
}
.green-led {
margin: 0 auto;
width: 70px;
height: 70px;
background-color: #0F0;
border-radius: 50%;
box-shadow: rgba(0, 0, 0, 0.2) 0 -1px 7px 1px, inset #304701 0 -1px 9px, #89FF00 0 2px 12px;
}
Plugin JavaScript:
https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js
https://www.google.com/jsapi
google.setOnLoadCallback(initChart);
// load the data
function loadData() {
// get the data from thingspeak
$.getJSON('https://api.thingspeak.com/channels/_CHANNEL_ID_/feed/last.json?api_key=READ_API_KEY', function(data) {
// get the data point
p = (Date.now() - new Date(data.created_at)) / (60*1000);
q = document.getElementById('LED');
// if there is a data point display it
if (p && q) {
if (p>3){ q.className = 'red-led'; } else {q.className = 'green-led';}
}
});
}
// initialize the chart
function initChart() {
loadData();
// load new data every 15 seconds
setInterval('loadData()', 15*1000);
}
Most Users Ever Online: 166
Currently Online:
33 Guest(s)
Currently Browsing this Page:
1 Guest(s)
Top Posters:
rw950431: 272
Vinod: 240
piajola: 95
turgo: 70
vespapierre: 63
Adarsh_Murthy: 62
Member Stats:
Guest Posters: 1
Members: 8665
Moderators: 1
Admins: 2
Forum Stats:
Groups: 3
Forums: 14
Topics: 1600
Posts: 5760
Newest Members:
Advantagetreeexperts, laundrydaddyuk, techhhelp5, ken, tran, huldacormierModerators: cstapels: 460
Administrators: Hans: 405, lee: 457