Unknown power to tag

Does anyone know if its possible to get the “unknown power” into a variable or tag?

I have most of my plugs monitored with the exception of the stove and pump, I’d like to calculate /guesstimate the draw of these items but I really don’t want to manually add all the known items together…

While writing this I’m thinking there might be a homeyscript solution for this, any help is appreciated.

The top value is all the values added together for the selected zone, which in the image above is Home, so the whole house.
So, the simple calculation is to subtract the measured power total (on the top) from the smart meter power (on the bottom), 4kW - 2.84kW = 1.16kW.
Sorry it doesn’t answer your question about getting the values into variables.

Thanks Adrian, I’m aware what the calculation would be, I was hoping for a ready-made solution to get this information instead of calculating it myself.

Using the Web API, you can get the values with Homey.energy.getLiveReport();
If you go to Homey Developer Tools and enter that line in the Request box, then click on Run you will see the returned data.

I’ll have a look at that one, in the meantime ive created a homeyscript and running it every 15 seconds

let devices = await Homey.devices.getDevices();
let tmp = 0 ;
let dv = "" ;
let p1 = 0 ;

//for ech device
Object.values(devices).forEach(device => {

//set name to var
dv = device.name;

//if name matches P1 e.g. the device that registers the powerdraw set the p1 variable otherwise add it to the tmp variable
if(dv!="P1 Meter"){
tmp = tmp + device.energyObj.W ;
}
else{
p1 = device.energyObj.W ;
}
});

//calculate the known usage from the total
let missing = (p1 - tmp ) ;
//todo add some rounding
//missing = missing * 100 ;
//missing = missing

console.log("totaal verbruik : " + p1);
console.log("totaal gemonitored : " + tmp);
console.log("totaal gemist : " + missing );
await tag('unknown power', missing);
return true ;

edit, it seems your “livereport” suggestion is much quicker, created this one now
Thanks!

let power = await Homey.energy.getLiveReport();
console.log(power.totalConsumed.W) ;
console.log(power.totalCumulative.W) ;
let missing = (power.totalCumulative.W - power.totalConsumed.W)
console.log(missing) ;
await tag('unknown power', missing);
return true ;
1 Like

Take a look at the Power by the Hour app. To me it is way more convenient and ‘usable’.

1 Like

Thanks but thats not what i’m looking for, I have PBtH already installed.
I want to see if i can come up with some logic to keep track of the pump/boiler and the stove.
e.g. between 17.00 and 19.00 if the “missed” power is higher than 2K it’s likely someone is cooking

1 Like