Installation

Use composer

composer require gared/shelly-php-client

Getting started

Configure client

$client = new \ShellyClient\HTTP\Client('http://192.168.1.10');

If you have configured login credentials you have to create the client like this:

$client = new \ShellyClient\HTTP\Client('http://shellyuser:secret@192.168.1.10');

Get current power usage

$meter = $client->getMeter(new \ShellyClient\Model\Request\MeterRequest());
$power = $meter->getPower();
echo "Current power usage: " . $power;