LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Reading the API from Energenie/MiHome products

playing around with the subdevice id's I am not getting it into the correct format....

{"status":"not-found","time":null,"flags":{},"data":{"message":"Subdevice not found"}}

 

I've found my Id number from the List working and printing all my devices out. 

 

So close....

0 Kudos
Message 11 of 14
(767 Views)

The Curl Example is here:

Fetch Usage Data:
Curl –L –X POST –H "X-Auth-Username:myaccount@hotmail.com" –H "X-Auth-Password:mypassword" –H "Content-Type: application/json" –d ’{"id" :49819, "start_time": "2017-02-16 12:34", "end_time":"2017-02-28", "data_type":"reported_temperature", "resolution":"daily"}’ https://mihome4u.co.uk/api/v1/subdevices/get_data

 

and the LabVIEW Strings that work are:

https://mihome4u.co.uk/api/v1/devices/list 

Capture2.PNG

 

James 

Message 12 of 14
(766 Views)

The Curl Example is here:

Curl –L –X POST –H "X-Auth-Username:myaccount@hotmail.com" –H "X-Auth-Password:mypassword" –H "Content-Type: application/json" –d ’{"id" :49819, "start_time": "2017-02-16 12:34", "end_time":"2017-02-28", "data_type":"reported_temperature", "resolution":"daily"}’ https://mihome4u.co.uk/api/v1/subdevices/get_data

 


I understand. So instead of doing a GET request, that API uses a POST request. Your LabVIEW code will mostly stay the same, just change the "http GET" to an "http POST" node, and link the data string (the part between "-d" and the url in the command above) to the node's "buffer" terminal.

 

As stated before, I unfortunately can't test this in lack of an MiHome account.


Ingo – LabVIEW 2013, 2014, 2015, 2016, 2017, 2018, NXG 2.0, 2.1, 3.0
CLADMSD
0 Kudos
Message 13 of 14
(757 Views)

Hey 

I have changed the Password so can allow you to have a test with... I have tried your idea but again something not quite right....

Please email me on jstigwood@hotmail.com...

 

Many thanks 🙂

James 

0 Kudos
Message 14 of 14
(747 Views)