Pellet kachel

Hallo,

Iemand ervaring met het koppelen van een pelletkachel met WiFi?
Edilkamin Slide 2

1 Like

Er moet wel een app voor zijn denk ik.

Community store:

Hoi,

Heb je ooit een app gevonden ? ik ben zelf ook op zoek om de standaard App functionaliteit van Edilkamin (The Mind) vanuit Homey Pro te gebruiken. Via Home assistant werkt het perfect …

mvg
Frank

Hallo Frank,

Nee, helaas nog niet.

Ik heb via Grok een code laten genereren en deze komt ook met een AWS cognito oplossing.
Uitvoering loopt vast en ik heb te weinig codeer verstand op dit op te lossen

// HomeyScript voor Edilkamin Cherrie: Status ophalen + Aan/Uit
// Vul je gegevens in:
const USERNAME = 'xxxxx@gmail.com';  // Je Edilkamin/The Mind gebruikersnaam
const PASSWORD = 'xxxxxxx,'; // Je wachtwoord
const MAC_ADDRESS = 'xxxxxx'; // MAC van je Cherrie (lowercase, geen : )

// AWS Cognito details
const REGION = 'eu-central-1';
const USER_POOL_ID = 'eu-central-1_BYmQ2VBlo';
const CLIENT_ID = '7sc1qltkqobo3ddqsk4542dg2h';
const COGNITO_URL = `https://cognito-idp.${REGION}.amazonaws.com/`;
const API_BASE = 'https://fxtj7xkgc6.execute-api.eu-central-1.amazonaws.com/prod/';

// Homey Logic variabelen (moet je eerst aanmaken in Homey > More > Logic)
const POWER_VARIABLE = 'Cherrie_Power'; // Boolean: true (aan) / false (uit)
const TEMP_VARIABLE = 'Cherrie_Temperature'; // Number: huidige temperatuur

async function run() {
  try {
    console.log('Start authenticatie voor Cherrie...');

    // Stap 1: Authenticatie via Cognito
    const authBody = {
      AuthFlow: 'USER_PASSWORD_AUTH',
      ClientId: CLIENT_ID,
      AuthParameters: {
        USERNAME: USERNAME,
        PASSWORD: PASSWORD
      }
    };
 
    const authResponse = await fetch(COGNITO_URL, {
      method: 'POST',
      headers: {
        'Content-Type': 'application/x-amz-json-1.1',
        'X-Amz-Target': 'AWSCognitoIdentityProviderService.InitiateAuth'
      },
      body: JSON.stringify(authBody)
    });


    if (!authResponse.ok) {
      throw new Error(`Auth fout: ${authResponse.status} - ${await authResponse.text()}`);
    }
console.log('Auth sstart, token verkregen.');
    const authData = await authResponse.json();
    const idToken = authData.AuthenticationResult.IdToken;
    console.log('Auth succesvol, token verkregen.');

    // Stap 2: Haal status op
    const statusResponse = await fetch(`${API_BASE}mqtt/status/${MAC_ADDRESS}`, {
      method: 'GET',
      headers: {
        'Content-Type': 'application/json',
        'Authorization': `Bearer ${idToken}`
      }
    });

    if (!statusResponse.ok) {
      throw new Error(`Status ophalen fout: ${statusResponse.status} - ${await statusResponse.text()}`);
    }

    const statusData = await statusResponse.json();
    console.log('Status ontvangen:', statusData);

    // Verwerk status en sla op in Homey Logic
    const powerStatus = statusData.power === 1; // 1 = aan, 0 = uit
    const currentTemp = statusData.temperature || 0; // Huidige temperatuur (fallback naar 0)

    // Maak variabelen aan als ze niet bestaan
    try {
      await Homey.createVariable({ name: POWER_VARIABLE, type: 'boolean', value: powerStatus });
    } catch (e) {
      await Homey.setVariable(POWER_VARIABLE, powerStatus);
    }
    try {
      await Homey.createVariable({ name: TEMP_VARIABLE, type: 'number', value: currentTemp });
    } catch (e) {
      await Homey.setVariable(TEMP_VARIABLE, currentTemp);
    }

    console.log(`Status opgeslagen: Power=${powerStatus}, Temperature=${currentTemp}`);

    // Stap 3: Optioneel - Stuur 'aan'-commando
    const commandBody = {
      mac_address: MAC_ADDRESS,
      name: 'power',
      value: 1  // 1 = aan, 0 = uit
    };

    const commandResponse = await fetch(`${API_BASE}mqtt/command`, {
      method: 'PUT',
      headers: {
        'Content-Type': 'application/json',
        'Authorization': `Bearer ${idToken}`
      },
      body: JSON.stringify(commandBody)
    });

    if (!commandResponse.ok) {
      throw new Error(`Commando fout: ${commandResponse.status} - ${await commandResponse.text()}`);
    }

    const commandResult = await commandResponse.json();
    console.log('Cherrie aangezet! Response:', commandResult);

    // Toon melding in Homey
    await Homey.notify({ title: 'Edilkamin Cherrie', message: `Kachel is aangezet! Status: Power=${powerStatus}, Temp=${currentTemp}°C` });

  } catch (error) {
    console.error('Fout in script:', error);
  // await Homey.notify({ title: 'Edilkamin Cherrie Fout', message: error.message });
  }
}

// Voer het script uit
await run();

Mooie LLM hallucinaties.

Dus biedt geen aanknopingspunten.
Was het proberen waard………..