Ewon TechForum
Providing technical solutions to technical requests


Flexy and Microsoft Power BI
simon Offline
eWON Support
#1
Power BI (https://powerbi.microsoft.com/en-us/) is a business analytics service provided by Microsoft.


Here is the procedure to follow for pushing Live Tag data to Power BI :

- Create and configure the  datastream :
.png   step1.png (Size: 62,12 KB / Downloads: 175)
.png   step2.png (Size: 15,39 KB / Downloads: 134)
.png   createdatastream.png (Size: 18,59 KB / Downloads: 143)
- When the datastream is created, copy the URL
.png   datastreamurl.png (Size: 9,56 KB / Downloads: 127)
- Adapt the following BASIC script with your URL and your Tags (in the Json) :

Code:
TSET 1,2
ONTIMER 1, "GOTO PusDataToPowerBI"

PusDataToPowerBI:
Url$ = "https://api.powerbi.com/beta/5c7c1590-4488-4e42-bc9c-15218f8ac994/datasets/98ec900d-3f6c-4a21-be47-be95b28f1e13/rows?key=VHEVy%2BtVzQ0DkO4t%2FhcieBr3vhQIjaEg92VMjO1H%2BWBiprP87Svxf8UlGPBFmGWNHxAfHgum%2B23u5mFwR1wQ%3D%3D"
method$ = "POST"
header$ = "Content-Type=application/json"
Json$ = '[{'
Json$ = Json$ + '"Temperature" :' + STR$ Temperature@ +","
Json$ = Json$ + '"Humidity" :' + STR$ Humidity@ +","
Json$ = Json$ + '"Timestamp" :"' + @GetTime$ +'"'
Json$ = Json$ +'}]'
REQUESTHTTPX url$, method$, header$, Json$
Print "Data Pushed"
END

Function GetTime$()
$a$ = Time$
$GetTime$ = $a$(7 To 10) + "-" + $a$(4 To 5) + "-" + $a$(1 To 2) + "T" + STR$(VAL($a$(12 To 13)) - 1)+":"+$a$(15 To 16)+":"+$a$(18 To 19)+ ".000Z"
EndFn

This script pushes the values of the Tags "Temperature" and "Humidity" every two seconds (See TSET command) :
.png   tags.png (Size: 5,85 KB / Downloads: 125) .
- Run the script
- Create a dashboard or a report

.png   dashboard.png (Size: 20,36 KB / Downloads: 120)
.png   PowerBIreport.png (Size: 34,22 KB / Downloads: 106)

Simon
Reply

kalyanbl Offline
Junior Member
#2
Nice and good information. It is very useful for beginners to learn and understand easily.
Learn more about Power BI here: https://goo.gl/fYDNDF
Reply

Gerard van Gelderen Offline
Junior Member
#3
Hello Simon,

Thanks for the script.
Yesterday it worked fine but today al i get is "Operation failed (28) 70 : REQUESTHTTPX url$, method$, header$, Json$"

It's a buffer problem i think because the frist 20 seconds it's pushing data but in PowerBI nothing is showing. (see Attachment)
Do you experinence the same problem or is it something in the Basic scrpit at my end.

Best regards
Gerard


Attached Files
.jpg   Knipsel.JPG (Size: 122,51 KB / Downloads: 27)
Reply

simon Offline
eWON Support
#4
This is strange indeed...
Do you see something in the scheduled actions ? and in the event logs ?
Reply

Gerard van Gelderen Offline
Junior Member
#5
See attachment.

Greets Gerard


Attached Files
.jpg   1.JPG (Size: 128,38 KB / Downloads: 50)
.jpg   2.JPG (Size: 121,43 KB / Downloads: 26)
Reply

simon Offline
eWON Support
#6
Hi,

From what I see in your Scheduled Actions log, you are pushing the data too often (every two seconds) and the Power BI server needs more time to process the data it seems... (You get these Pla- Queue Full errors because there are too many pending HTTP Push actions (max 20) so no other actions can be taken in account)

Simon
Reply

Gerard van Gelderen Offline
Junior Member
#7
Thanks Simon.

It seems to work perfect now.
after setting the intervaltime from 2 to 5 seconds the problem was gone.

Greetz,
Gerard
Reply

simon Offline
eWON Support
#8
ah great! Thanks for the feedback and enjoy ;-) !
Reply

IHC Offline
Junior Member
#9
Thank you for sharing this info!

Iam getting this error: label/function not found (27): Goto ewon_init_section

You guys have any idea?
Reply

simon Offline
eWON Support
#10
You probably did erase your init section.
The best is that you erase the BASIC script of your eWON (Reset Level 1 or System > Setup > Storage > Erase & Format > Erase Program) and you copy/paste this script into your Init section.
Do not forget to adapt the script with your own settings.
Reply

IHC Offline
Junior Member
#11
Thank you. It works now :-)
Reply

attila94 Offline
Junior Member
#12
Hi Simon ,

Can we do the same thing with Ewon CD4xxx instead of flexy 205 ?
Reply

attila94 Offline
Junior Member
#13
(03-06-2018, 03:59 PM)attila94 Wrote: Hi Simon ,

Can we do the same thing with Ewon CD4xxx  instead of flexy 205 ?

any answer ?
Reply

simon Offline
eWON Support
#14
Unfortunately no, the function "REQUESTHTTPX" is not supported by the CD but only by Flexy (All models).

Simon
Reply

ms9901 Offline
Junior Member
#15
Simon,

Have you played with pushing historical tag data to Power BI? It seems like it could be done with EBD but you would need to parse the result of EBD into appropriately formatted JSON using a script?

Mike
Reply



Possibly Related Threads…
24-01-2020, 09:45 PM
Last Post: tedsch
  Power Interuption Alert Started by domash
1 Replies - 328 Views
24-09-2019, 09:09 PM
Last Post: simon
03-09-2019, 02:08 PM
Last Post: simon
  Flexy SMS Alert Started by domash
11 Replies - 1.911 Views
22-08-2019, 12:10 PM
Last Post: simon
  MQTT eWon Flexy 205 Started by RFreist
3 Replies - 1.436 Views
18-07-2019, 12:30 PM
Last Post: simon
23-05-2019, 05:45 PM
Last Post: smoro
20-05-2019, 03:36 PM
Last Post: simon
03-05-2019, 10:38 AM
Last Post: simon
12-02-2019, 06:39 PM
Last Post: simon
17-12-2018, 08:35 AM
Last Post: Dmitriy



Users browsing this thread:
1 Guest(s)



Theme © Ewon 2019 - Forum software by © MyBB - Cookie policy