Forum

Browse topics, discover Works With Legrand community!

Home + Control : Get user plant empty

Hello,

I've looked for any suggestion for my problem but nothing found to resolve it.

 

Explanation of my problem :

I have a user + password to connect to my Home + control application. All is Ok, and I can manage my Bubendorff devices with application.

I have created a partner application account for Alexa. It works fine too (Devices and scenes voice controls Ok).

I have created a developer account and subscribed to starter kit. When I try to send a "get users plants" request by clicking on "try it" button, I receive a http 200, but json is : "plants": [] (empty).

In field "OAuth Server for Try it Eliot API", I enter my user and password used to connect to home + control Application. After this a message like "Access token expires on: 12/23/2020 5:43 PM" appears to the right of this field. Before click "Send" Button, I've checked that "Ocp-Apim-Subscription-Key" and "Subscription key" contain my primary key, and "Authorization" contains "Bearer xxxxxxxx".

Could you help me to understand why response is empty please ?

 

Thanks

 

Hello,

I tested this call via Try It and Postman : it works for me

I only see 2 possible explanations :

  • you log in in the Try It with an other end-user account than the one where your devices are linked (but according to explanations you gave me, I doubt it)
  • Or you didn't give user consents to use this application. You can check it by going in Menu > My account > Third-party applications in your Home + Control application. You should see the name or the ID of your Works with Legrand application

If you don't see it, copy/paste this URL in your web browser : https://partners-login.eliotbylegrand.com/authorize?response_type=code&redirect_uri=YOUR_URI&client_id=YOUR_ID. Then, you will be asked to authenticate with your Home + Control credentials and to accept scopes

Have a good day,

Leslie - Community Manager

Hello

Tanks.

Actually I dont see the name nor the id in my Works With legrand application.

Could you tell me where I can fini My_URI and My_ID to subit url you give me please ?

 

Thanks

Hi,

Connect to your Works with Legrand account and go in your application's details : https://mysettings.developer.legrand.com/Application

First Reply Uri is the address you defined to redirect users to consents page and to use in your /authorize request

Application Id = client_id

Have a good day,

Leslie - Community Manager

Hi,

Thanks.

 

I've vreated my application and received by mail client_id and client_secret.

 

I've tried to get users plant using two methods :

 

1/ First Method with Postman :

 

1st step : on web browser

-> https://partners-login.eliotbylegrand.com/authorize?client_id=<my client ID received by mail>&response_type=code&redirect_uri=<redirect_uri_specified in my application>

-> Login on Eliot with my home+control user and password.

-> Accept authorization => <redirect_uri specified in my application>/?code=<Code to use at next step>

 

2nd step : on Postman

https://partners-login.eliotbylegrand.com/token with body parameters :

client_id -> <client_id received by mail>

grant_type -> authorization_code

code -> <code received on first step>

client_secret -> <client_secret received by mail>

And Authorization Type -> OAuth 2.0

 

3rd step : on Postman

https://api.developer.legrand.com/hc/api/v1.0/plants with Headers parameters :

Ocp-Apim-Subscription-Key -> <Primary Key of my starter kit subscription>

Authorization type -> Bearer Token

Token -> <access_token received previous step>

 

Response : 200 Ok, but {"plants": []} (plants empty)

 

2/ Second Method with API List Try it -> Home + Control Get users' plants :

 

Ocp-Apim-Subscription-Key -> <Primary Key of my starter kit subscription>

OAuth Server for Try it Eliot API ->  Authorization code

Subscription key -> Primary-<Primary Key of my starter kit subscription>

Field Authorization updated with : Bearer xxxxxxxxxxxxxxxxxxxx And Access token expires on: 12/31/2020 1:44 PM

 

Same response as with Postman : 200 Ok, but {"plants": []} (plants empty)

 

I dont understand why plants is empty.

An idea ?

 

Thanks

 

 

 

 

Hi Ges,

Your requests seems OK for me. Are you sure about the credentials of your end-user account asked in your /authorize request ?

You can check the correct email address of your installation in your Home + Control application in "Account" section in the menu

You must use the credentials of your Home + Control application to access your plants. Otherwise, you will retrieve a 200 OK response but with an empty plant

Have a good day,

Leslie - Community Manager

Hello Ges,

I think we found why you have this issue. Can you please test :

  • Go in your Home + Control application
  • Menu > My account > Third-party applications
  • At the bottom click on the link "I can't install a partner application"
  • Follow the steps

Can you please tell me if it resolved your issue ?

Thanks and have a good day,

Leslie - Community Manager

Hi Leslie,

I also have the problem that I receive an empty plantid object after a request.

I tried pasting my application id after the url https://partners-login.eliotbylegrand.com/consent?guid= "my id" and clicked on accept but got an error message stating the site is unreachable.

The email in my account settings matches the one I use to authenticate.

I can't see what I am doing wrong, could you please assist?

Jon

  • This reply was modified 7 months, 2 weeks ago by Jon Hall.

Hello Jon,

The URL you tried doesn't work

First of all, I invite you to use the Try-it function to see if you are able to get information from your devices. Please note that the credentials to use for authentication in the pop-up are the email and password from your Home + Control end-user account

If it works, that means that you are able to perform the /authorize and /token requests as described in the documentation (https://developer.legrand.com/tutorials/0auth2-end-point-url/)

If it still doesn't work, please tell me at which step you are blocked (you can include screenshots if needed)

Have a good day,

Leslie - Community Manager

Hello Leslie,

Without the plantid's I can't get any further with the try it functions.

I get as far as the included screenshot, after going to this url:https://partners-login.eliotbylegrand.com/authorize?client_id=myapplicationid&redirect_uri=http://legrand.redhead.nl/callback/

Once I click on accept I get the message that the site is unreachable.

Kind regard,

Jon

Images:
You must be logged in to view attached files.

Hello Jon,

This screenshot comes from the authentication process, where your user has to accept consents in order for the third-party app to access its data. You can't retrieve your plantID with it

The easiest way to retrieve your plantID is to follow these instructions :

  • Sign up with your Works with Legrand account. You must have subscribed to the Starter Kit
  • Go on the “API” drop down menu, click on “APIS LIST” and choose the Smarther API or Home + Control API
  • On the left, click on “GET Plants” for the Smarther or “GET Get users’ plants” for Home + Control. Then go in the “Try it”
  • In Authorization section, choose “Authorization code” for ELIOT - Azure AD B2C - OpenID Connect for the Smarther or OAuth Server for Try it Eliot API for Home + Control. If you are logged in, other information are already filled up
  • A popup will be opened. Fill the information and validate
  • Click on “Send” button and retrieve the ID of the plant in the Response content

 

Have a good day,

Leslie - Community Manager

Hello Leslie,

Thanks for your reply.

I still get an empty plantid object, as you can gather from the included screenshot.

Kind regards,

Jon

Images:
You must be logged in to view attached files.

Jon,

In most cases, an empty plant comes from the credentials given in the pop-up from the Try-It which are not correct. Please ensure that :

  • You can correctly see your devices in your Home + Control application
  • Your Works with Legrand application's status is OK (green) and you subscribed to Starter Kit
  • You are using the credentials from your Home + Control end-user account where you can see these devices (and not the credentials of your Works with Legrand developer account)

 

Have a good day,

Leslie - Community Manager

 

Hello, i have the same problem, i unify the password for all account, but nothing change. when i try to get plantID the response is the seguent:

"
<h4 style="box-sizing: border-box; font-family: wf_segoe-ui_light, 'Segoe UI Light', 'Segoe WP Light', 'Segoe UI', 'Segoe WP', Tahoma, Arial, 'sans-serif'; font-weight: 500; line-height: 1.1; color: #be097f; margin-top: 11px; margin-bottom: 11px; font-size: 1.3em;">Response status</h4>
<p style="box-sizing: border-box; margin: 0px 0px 11px; color: #575757; font-family: wf_segoe-ui_normal, 'Segoe UI', 'Segoe WP', Tahoma, Arial, 'sans-serif'; font-size: 14px;" data-bind="text: statusCode() + ' ' + statusDescription()">204 No Content</p>

<h4 style="box-sizing: border-box; font-family: wf_segoe-ui_light, 'Segoe UI Light', 'Segoe WP Light', 'Segoe UI', 'Segoe WP', Tahoma, Arial, 'sans-serif'; font-weight: 500; line-height: 1.1; color: #be097f; margin-top: 11px; margin-bottom: 11px; font-size: 1.3em;">Response latency</h4>
<span style="box-sizing: border-box; color: #575757; font-family: wf_segoe-ui_normal, 'Segoe UI', 'Segoe WP', Tahoma, Arial, 'sans-serif'; font-size: 14px;" data-bind="text: latency">97</span><span style="color: #575757; font-family: wf_segoe-ui_normal, 'Segoe UI', 'Segoe WP', Tahoma, Arial, 'sans-serif'; font-size: 14px;"> ms</span>
<h4 style="box-sizing: border-box; font-family: wf_segoe-ui_light, 'Segoe UI Light', 'Segoe WP Light', 'Segoe UI', 'Segoe WP', Tahoma, Arial, 'sans-serif'; font-weight: 500; line-height: 1.1; color: #be097f; margin-top: 11px; margin-bottom: 11px; font-size: 1.3em;">Response content</h4>
<div id="consoleResponse" class="snippet" style="box-sizing: border-box; overflow: auto; position: relative; max-width: 942px; color: #575757; font-family: wf_segoe-ui_normal, 'Segoe UI', 'Segoe WP', Tahoma, Arial, 'sans-serif'; font-size: 14px;">

<code style="box-sizing: border-box; font-family: Menlo, Monaco, Consolas, 'Courier New', 'monospace'; font-size: inherit; padding: 0px; color: inherit; background-color: transparent; border-radius: 0px;" data-bind="text: headers">Warning: No Content
X-OneAgent-JS-Injection: true
X-MULE_SESSION: rO0ABXNyACNvcmcubXVsZS5zZXNzaW9uLkRlZmF1bHRNdWxlU2Vzc2lvbi7rdtEW7GGKAwAFWgAFdmFsaWRMAA1mbG93Q29uc3RydWN0dAAmTG9yZy9tdWxlL2FwaS9jb25zdHJ1Y3QvRmxvd0NvbnN0cnVjdDtMAAJpZHQAEkxqYXZhL2xhbmcvU3RyaW5nO0wACnByb3BlcnRpZXN0AA9MamF2YS91dGlsL01hcDtMAA9zZWN1cml0eUNvbnRleHR0ACdMb3JnL211bGUvYXBpL3NlY3VyaXR5L1NlY3VyaXR5Q29udGV4dDt4cAFwdAAkYTA3NDg0NjEtYWE3Yy0xMWVjLWI0YmUtMDA1MDU2OGE2MzE0c3IAJWphdmEudXRpbC5Db2xsZWN0aW9ucyRTeW5jaHJvbml6ZWRNYXAbc/kJS0s5ewMAAkwAAW1xAH4AA0wABW11dGV4dAASTGphdmEvbGFuZy9PYmplY3Q7eHBzcgAkb3JnLm11bGUudXRpbC5DYXNlSW5zZW5zaXRpdmVIYXNoTWFwndHZ72dFzgADAAB4cHcMP0AAAAAAABAAAAAAeHEAfgAJeHB4
Node_Id: nd1
http.status: 204
Service_Release: 3.25.3
Server-Timing: dtSInfo;desc="1"
Set-Cookie: dtCookie=v_4_srv_1_sn_01F3A86C9B551CF963C8EA42F712D1D8_perc_100000_ol_0_mul_1_app-3A92b2bc745bf97c61_1_rcs-3Acss_0; Path=/; Domain=.myhomeweb.com,My_prod_session=!ac9SHoxj7iUtPOco/jqsa5TwmA4UXUDV89cEMIcHJhljbLiYSaHIPCYxh3q+BwyQ8EDgVd/MagZspWNXs9QWvCKBSUZfBy/ZzzqncS4=; path=/; Httponly; Secure
Request-Context: appId=cid-v1:17d898fc-adbd-487e-96a4-c4287796f34d
Date: Wed, 23 Mar 2022 07:41:18 GMT
Content-Length: 0

<code style="box-sizing: border-box; font-family: Menlo, Monaco, Consolas, 'Courier New', 'monospace'; font-size: inherit; padding: 0px; color: inherit; background-color: transparent; border-radius: 0px;" data-bind="text: headers">"

What can i do?

</div>
 

Hello,

I don't well understand your log. Please first assure you followed the instructions already described in the previous posts and that you use the credentials in the popup of your end-user account on the Netatmo application (you must have devices linked to it)

If you still don't manage to make it work please send me a screenshot of the query and the response from the Try-It + the end-user account email you use via the contact form

Have a good day,

Leslie - Community Manager

Viewing 15 posts - 1 through 15 (of 24 total)

You must be logged in to reply to this topic.

Information

message23 replies
people5 participants