Skip to content

POC to store and clear offpeak electricity bonus information within a blockchain using hyperledger composer and TP-Link smart wifi plug

Notifications You must be signed in to change notification settings

janbeckert/smart-socket-blockchain-POC

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Smart Socket Blockchain POC

Setup

cd businessnetwork
npm install
cd ..
composer archive create --sourceType dir --sourceName businessnetwork  -a smartsocket-network.bna

Next, import the business network.

  • Create and start the rest API server:
composer-rest-server -c USER@NETWORKCARD -n required -u true
  • Install python dependencies

Usage

usage: tplink.py [-h] [--ip PLUG_IP] --supplier SUPPLIER_ID --plug PLUG_ID
                 [--api-base APIBASE]

Run smart socket demo process

optional arguments:
  -h, --help            show this help message and exit
  --ip PLUG_IP          ip address of the H110 compatible smart socket. If no
                        ip is given, the tool will try to discover sockets and
                        will use the first one found.
  --supplier SUPPLIER_ID
                        EnergySupplier id
  --plug PLUG_ID        Plug id
  --api-base APIBASE    Base URI of the hyperledger composer REST api.
                        (default: http://localhost:3000/api/)
  • Create at least one plug instance and one EnergySupplier instance.
  • Make sure the business network is running and the rest API server is started correctly.
  • Run the python script:
./tplink.py --supplier 1234 --plug 5678

Use control-C to stop the demo.

  • Plug a load into the smart socket (eg. a light bulb)
  • As you can see, the smart socket will switch on after a given time (and off again), a bonus instance and an energy amount instance is created (see the composer playground). After that, the bonus and consumption values are multiplied and added to the current balance of the plug.

About

POC to store and clear offpeak electricity bonus information within a blockchain using hyperledger composer and TP-Link smart wifi plug

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published