Introduction:
This guide provides step-by-step instructions on how to create a virtual device in Homey Pro to read values from the Eplucon Ecoforest Heatpump. This process involves using the “Device Capabilities” app to simulate a virtual app that communicates with your heat pump.
Preparation:
- Confirm that your Eplucon Ecoforest Heatpump is operational and connected to the Eplucon Portal
- Install the “Device Capabilities” app from the Homey App Store.
- Install HomeyScript app from the Homey App Store
Step 1: Accessing Device Capabilities
- After installing, open the Homey Pro app on your smartphone or tablet.
- Navigate to “Apps” and select the “Device Capabilities” app.
Step 2: Creating a Virtual Device
- In the “Device” section, select the option to create a new virtual device.
- Choose a relevant name and icon for your virtual device that represents the Eplucon Ecoforest Heatpump.
Step 3: Configuring Device Settings
- Define the capabilities your virtual device will have
- See screenshot below which fields I created (and matches my script)
- You could also import this String in the app”
[tef:AVD:"H4sIAAAAAAACA42WbY+qOBSA/8qkX3VWgfKa3A+AOjKjTry+hs1mUvCgVShayqDezH/fuDszknuVwBeSnvac5zk0pb/QCt5pCF6YMmShPs48+//HtSV5fJ5p3aEz6S0byyQX3Z4akdbIn/SCthc6Bz7uHjZ21E/Pfnr+eZwn4UCOzmwRBM5xq796RZx2oJsNowYMYza2PTfQtU44/Dl4gsYgVPVJj9mZv0xyrTHEstvzl+mKdHtPpj5+lc+rl3l3gh3/hGeG8fzsqgfPXYCIqT3ypb0/mK69gx+fp9usN4tZIgbO7iA1tLnpTbBa8CALXnYJvEzsrUKX7qh9HBfqarwNnpYjXVFs5zTQyGo2m7VaZDDuL1vP3TxqOcE237Xez5k2phse6z5f5mCHUrSAjrroP2n9uXMyzN0xxbjd8YvTdLGhnHEnT1ShN4rFrAjgMFt3bdv+8QM1UZhnIk0u/c2Q9eujiVJO15SR2FshC2GCsQy4/QhgRI8Yh8YjMTX5EZMoUHRiSpKCURNlIARl60sGBAz4+vT2TuIc3i5pBWECWU3E8iQA/hpN4Sh6FOJVhqz2dXj03/srIJUiTprGQNiNNU4uRHor4JIEOLkRGNCsXDyMM2ShVGyAo69J0ogkgCzkUMaACUj2wInI89KMCewJJwJcsicBjamgkCErInEG1zmbtLAv2RMgWc7h7TsTh2smlwMR0IvTwiX8AiV4Dr9Fp2R9c9xjGV1vxG+L5E/8BeFJQQTwh1sKcg0FuZaCXKkg31GQqxSUry/AU/ZA2XcppQa0UgtaqYRW7kArVdC4DJ1T8V0L16DGtahxJTW+Q61+gs2BF4QnlK3LPVVr0Km16NRKOvUeXWVPq4Lan17ltms1xLRaYlqlmHZHTKti1782S07F7TNGr4Gv18LXK/H1O/h6Fb7xie/OH1Y8332XMmpAG39A7zlkWZnYqCQ27hAblcRDypDV/ku9DpAjsuTrgHndTgHP6VXKrCFllqQE8Ld9WpT+KGalj3nHx6z06UBIE3L5fUkfzc9bUunkF7BPk/1Ddx/nl6tTExFk/f3Px7+CkMFCUAkAAA==":/tef]
Step 4: Establishing Communication with Eplucon Portal API
- Use the same credentials as you use for the portal Eplucon portaal
- Install Homeyscript in Homey
- use this script to fetch your Module ID (one time). You need to ensure that the module ID in the URL of the below below script (modules/1000704) is applied and corresponds to your actual heat pump module.
// Login and get access token
var result = await fetch("https://portaal.eplucon.nl/api/v2/auth/login", {
method: 'post',
headers: {
'Content-Type': 'application/json',
'Accept': 'application/json'
},
body: JSON.stringify({
username: 'USERNAME',
password: 'PASSWORD'
}),
});
if (!result.ok) throw new Error(result.statusText);
const body = await result.json();
console.log(body)
var access_token = body.access_token;
await tag("eplucon_access_token", access_token);
// Fetch account info
var accountInfo = await fetch("https://portaal.eplucon.nl/api/v2/account/info", {
method: 'get',
headers: {
'Authorization': `Bearer ${access_token}`,
'Content-Type': 'application/json',
'Accept': 'application/json'
}
});
if (!accountInfo.ok) throw new Error(accountInfo.statusText);
const accountInfoBody = await accountInfo.json();
console.log(accountInfoBody);
// Fetch list of accounts modules
var modules = await fetch("https://portaal.eplucon.nl/api/v2/econtrol/modules", {
method: 'get',
headers: {
'Authorization': `Bearer ${access_token}`,
'Content-Type': 'application/json',
'Accept': 'application/json'
}
});
if (!modules.ok) throw new Error(modules.statusText);
const modulesBody = await modules.json();
console.log(modulesBody);
- Use this script to fetch the variables from Eplucon on a continuous base, only amend
USERNAME
PASSWORD
MODULEID in the url (modules/1000704)
// Login and get access token
var result = await fetch("https://portaal.eplucon.nl/api/v2/auth/login", {
method: 'post',
headers: {
'Content-Type': 'application/json',
'Accept': 'application/json'
},
body: JSON.stringify({
username: 'USERNAME',
password: 'PASSWORD'
}),
});
if (!result.ok) throw new Error(result.statusText);
const body = await result.json();
var access_token = body.access_token;
await tag("eplucon_access_token", access_token);
// Get the current date
const currentDate = new Date();
// Fetch statistics
const urlStats = `https://portaal.eplucon.nl/api/v2/econtrol/modules/1000704/statistics?range=day&day=${currentDate.getDate()}&month=${currentDate.getMonth() + 1}&year=${currentDate.getFullYear()}`;
const optionsStats = {
method: 'GET',
headers: {
'Authorization': `Bearer ${access_token}`,
'Accept': 'application/json'
}
};
try {
const responseStats = await fetch(urlStats, optionsStats);
const dataStats = await responseStats.json();
// Get the latest data point
const latestDataStats = dataStats.data.data[dataStats.data.data.length - 1];
// Create an object with the desired structure
const output = {
Binnentemperatuur: { value: parseFloat(latestDataStats.Binnentemperatuur) },
WW_temperatuur: { value: parseFloat(latestDataStats['WW temperatuur']) },
Actuele_temp_DG1: { value: parseFloat(latestDataStats['Actuele temp. DG1']) },
Brine_in_temperatuur: { value: parseFloat(latestDataStats['Brine in temperatuur']) },
Brine_out_temperatuur: { value: parseFloat(latestDataStats['Brine out temperatuur']) },
Heating_in_temperatuur: { value: parseFloat(latestDataStats['Heating in temperatuur']) },
Heating_out_temperatuur: { value: parseFloat(latestDataStats['Heating out temperatuur']) },
Buitentemp: { value: parseFloat(latestDataStats['Buitentemp.']) },
Timestamp: { value: latestDataStats.created_at },
// Added values
Cv_druk: { value: parseFloat(latestDataStats['Cv druk']) },
Actueel_verbruik: { value: parseFloat(latestDataStats['Actueel verbruik']) },
};
// Create tags from the output object
for (let key in output) {
await tag(key, output[key].value);
}
// Return the output
return output;
} catch (error) {
console.error(error);
}
- If you want more values, you might consider to ask ChatGPT to extend the script in the same manner for these variables:
Binnentemperatuur":20.5,“WW”:1,“Ingestelde temp. WW”:45,“Aanvoer setpoint verwarming”:21,“Aanvoer setpoint koeling”:15,“Ingestelde temp.”:20,“Brine in temperatuur”:2,“Brine druk”:1.9,“Brine out temperatuur”:-0.3,“Heating out temperatuur”:34.2,“Cv druk”:1.8,“Heating in temperatuur”:29.4,“Verdamping temperatuuur”:-3,“Condensatie temp.”:34.5,“Inverter temp.”:4,“Compressor toerental”:179.5,“Zuig gas temperatuur”:2.5,“Compressorzuigdruk”:6.3,“Pers gas temperatuur”:61.2,“Compressorafvoerdruk”:20.1,“Oververhitting”:5.4,“Positie expansie ventiel”:41,“Buitentemp.”:4.5,“WW temperatuur”:48.4,“Actueel verbruik”:0,“Totaal import energie”:0,“Totaal export energie”:0,“Act. vent. toerental”:25,“Actuele temp. DG1”:34.2,“Actuele temp. SG2”:0,“Actuele temp. SG3”:-999.9,“Actuele temp. SG4”:-999.9,“Setpoint verwarming DG1”:31.6,“Setpoint verwarming SG2”:0,“Setpoint verwarming SG3”:0,“Setpoint verwarming SG4”:0,“Setpoint koeling DG1”:18,“Setpoint koeling SG2”:10,“Setpoint koeling SG3”:10,“Setpoint koeling SG4”:10,“Positie ventiel SG2”:100,“Positie ventiel SG3”:100,“Positie ventiel SG4”:100,“created_at”:"2024-03-24T00:00:00
Step 5: Create a flow to fetch the data
Step 6: The fun part
- In Insights you can track performance of the values.
- I use it to compare “graaddagen” with the performance of the pump
- I use it to prevent the CV Druk will be below 1,2 then refill and warning below 0,8 unstable situation, and 0,5 Heatpump stops operating
- I want to use to also track Energy consumption, but need to install first the energy meter in the fuse box… That will also make the connection between solar panels and optimize the heat pump energy usage
Your help is highly appreciated
In essence, your expertise can elevate this guide to the next level. I welcome your feedback and any additional insights or flows you’ve crafted. Let’s collaborate to optimize our use of the Eplucon Ecoforest Heatpump in the smartest ways possible. Share your thoughts and findings here. Thank you for contributing to this innovative journey.