I have searched and found no reference to Efergy so can only assume no one has developed a binding for this yet. Efergy Ego is a smart switch which can be turned on and off and monitors power usage. It uses WIFI 2.4G.
I’m even unsure if Efergy provide an API to allow this.
Nice to see another device that is available in New Zealand!
What I’d do is get a software tool that monitors network traffic. I’d then load up the phone app for Efergy and control the switch. You might be able to use the HTTP binding in OpenHAB to replicate those commands?
I’m still a novice so could be completely wrong but this is the approach I’d take if there isn’t a binding already…
At NZ$65 it’s about the same price as the Belkin WeMo stuff which does have a binding… Although the belkin stuff doesn’t report power usage…
Glad to find this discussion, I also have an energy for a year, do not have OpenHab yet, but are looking for excuses to load openHab, this could be one for me -will be tracking this tread. Thank you all for investigating!
How can I parse with JSON the string:
[{“cid”:“PWER”,“data”:[{“1510396870000”:683}],“sid”:“789009”,“units”:“kWm”,“age”:2},{“cid”:“PWER_GAC”,“data”:[{“1510396866000”:1962}],“sid”:“770843”,“units”:null,“age”:6}]
to have the second value (1962)? Can you help me?
I tried with JSON.parse(input)[1].data[0][Object.keys(JSON.parse(input)[0].data[0])[0]]*0.001; but does’t work …
myConsom2();
function myConsom2(){
var json = JSON.parse(input);
var ss = "0";
var ss1 = "Efergy - Probleme de lecture";
var dn;
// ajouté Avril 2018
if (json.hasOwnProperty("error"))
return "Error Reading JSON data";
try {
if (json.error && json !== null) {
return "Error Reading JSON data";
} else {
for (var index in json) {
var reading = 0;
var ts = 0;
for (var d in json[index].data[0]) {
reading = json[index].data[0][d];
// ts est le last reading time
ts = d;
}
if (json[index].cid === 'PWER') {
if (reading !== null) {
dn = reading / 1000;
if (isNaN(dn))
ss = "0";
else
ss = dn.toFixed(3);
var utcSeconds = ts / 1000;
var dddd = new Date(0); // The 0 there is the key, which sets the date to the epoch
dddd.setUTCSeconds(utcSeconds);
//console.log(dddd);
ss1 = ss + " kW @ " + dddd.toTimeString().split(' ')[0] + ' ---- ' + json[index].age + ' seconds ago';
// console.log(ss1); // donne 3.238 kW @ 05:24:24 3 seconds ago
// $('#pwer_reading').text(reading/1000 + ' kW');
// $('#sensor_id').text('SensorID:' + json[index].sid);
// $('#pwer_age').text('last reading:' + json[index].age + ' seconds ago');
}
}
}
}
return ss1;
} catch (e) {
return "Error Reading JSON data";
}
}
Just change PWER for PWER_GAC to get your second device value