Skip to Content

Electricity-Fiori-App for home

Motivation:

Previous assumption: Fiori or SAPUI5 is (exclusively) used for user interfaces to SAP backend systems! (Display / Edit SAP Data)

New assumption: Fiori (UI5) can also be used outside the SAP context to connect non-SAP systems. Example here: At home in a private environment.

Fiori (UI5) – APP: Electricity Data Overview

Make consumption and feed-in data evaluable

Requirements for this: Collect data for consumption and feed-in by photovoltaics into mysql-tables with raspberry-pi.

So, for my example I need tables for today, week, month and years.

These tables in mysql on raspberry pi need an excellent easy to use user interface: Fiori

 

We do not have an SAP Gateway server in the private environment, which provides us ODATA services.

But we also want to use a standard way to receive the data. We use the JSONModel.

So we need something for reading mysql-tables that is compatiple with JSONModel in SAPUI5.

So we can reach this goal with php.

What is PHP? OpenSource scripting language especially for web development, can be well embedded in HTML.

PHP has a good integration with mysql.

That we need a source in the LAN which returns the stream data in JSON format when we call it up.

Example for reading mysql and providing jsondata:

PHP:

Json result of this php:

So we have to call up these php-connectors to build a model in ui5-App:

oModel.loadData("http://192.168.2.140/STROM/get_data_json.php", oPara, true, "POST");

Now it is fun to create nice user-interfaces to show the data:

Main-App:

Actual data overview:

Monitor: To display power on distance.

Period-report:

 

Here the app in action on a tablet to display current power on roof.

 

Green value is high so the sun is shining…

Have fun…

Jörn

6 Comments
You must be Logged on to comment or reply to a post.