PHP code example of marjovanlier / ecoflow

1. Go to this page and download the library: Download marjovanlier/ecoflow library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

marjovanlier / ecoflow example snippets


use Marjovanlier\EcoFlow\EcoFlow;

// Create a new instance of the EcoFlow class
$ecoFlow = new EcoFlow('your-api-key', 'your-api-secret');

// Retrieve a list of devices associated with your account
$devices = $ecoFlow->getDevices();

// Sets the permanent wattage of a device (100 for 10W)
$ecoFlow->setParams($deviceSn, 'WN511_SET_PERMANENT_WATTS_PACK', ['permanentWatts' => 100]);