[APP] YCH Control

This topic is meant for English speakers. I’ve done a similar topic in French here !

Hi all,

Let me introduce myself briefly, my name is Yann, I am an engineering student and I am quite interested in the world of new technologies and home automation.
I then embarked on creating an application for Homey that allows you to connect Legrand Home + Control (or Legrand Netatmo) compatible devices in Homey.

DESCRIPTION :

This app allows you to connect your Legrand® with Netatmo (Home + Control) environment to Homey and control your devices directly from Homey.

At this moment we support lightnings, sockets roller shutters… More family of products will be added in the future, with time we hope to cover all of Home + Control products.

SETUP GUIDE :

  1. Have access to the correct connection interface :
  • If you created your account in the Home + Control app after April 27, 2020, you will need to create a Legrand developer account (to have access to the application’s connection interface) at the following address: https: //developer.legrand.com/login/ and register by clicking on “Register or Log In” and then on the “sign up now” button at the bottom of the page.
  • If you created your account in the Home + Control app before April 27, 2020, you can go directly to step 3.
  1. Link your Gateway to your new account :
  • You must now log into the Home + Control application by clicking in the box “Did you create an account in Home + Control before April 27, 2020?”.
  • Follow the instructions in the application to link your Gateway to your account.
  1. Configure your devices in the Home + Control application before adding them to Homey :
  • You can directly name the devices, assign them a “type” (eg: a mobile socket assigned by default as a “socket” to assign it as a “light socket”) (1).
  • It is worth noting that the assignment to rooms in Home + Control will not affect the assignment in Homey.
    -It is important to properly assign the devices before adding them in YCH Control to avoid operational problems.

You are now ready to add your Legrand® products to Homey with YCH Control !!

:warning: YOU MUST BE AWARE OF THESE DIFFERENT POINTS :warning:

  • App has been coded under the guidelines of SDKV3 i.e. your Homey must have at least version 5.0.0.
  • (1): This kind of change also changes the category in which your device is located in YCH Contro (for example the product will change from socket to light).
  • YCH Control uses the Home + Control API to control your products, i.e. without internet access the application becomes unusable. However, Home + Control should still work.
  • Therefore, depending on the quality of your internet connection, the response time for actions may be longer or shorter.
  • Legrand only offers third-party developers (like me) 500 requests per day and per user, YCH Control includes a count of requests made, beyond 500 (visible on the configuration page of the app), it is normal that the application no longer interacts with your products.
  • For MyHome users you need to authorize third-parties in the app !

Hope you like the app!

NayvenFR

1 Like

Hi there!

I tried to add my devices to Homey and I was able to add correctly my sockets and some lights, but not all of them…I cannot understand why, they are all of the same type, but some of them are added correctly, while others are only shown but I cannot control them. Same for roller shutter…
Immagine 2021-05-20 100501Immagine 2021-05-20 100602Immagine 2021-05-20 100409

I tried to restart Homey and restart the app, but it doesn’t change…in the attached images the devices “Angoli su” and “Luce garage” are exactly the same type of device :thinking:

Hi Alessandro,

When devices are added the app checks the hw_type (with is a type of serial code) of each devices since they do not have the same capabilities (and that’s why I didn’t create a driver for each devices and grouped them in a class type, lights or shutters). That’s why you cannot control all your devices, can you please provide me with the informations I asked you in my private message please ?

The guide is here : Alexa + Bticino + Homey - #11 by NayvenFR

Thank you Nayven, I think I finally get the requested details. I got the following:

{
      "type": "garage",
      "modules": [{
        "id": "XXXXXXXXXXXXXXXXXXXX",
        "name": "Luce garage",
        "hw_type": "NLL",
        "device": "light"
      }, {
        "id": "XXXXXXXXXXXXXXXXXXXX",
        "name": "Modulo DIN",
        "hw_type": "NLPC",
        "device": "energymeter"
      }]
    }, {
      "type": "livingroom",
      "modules": [{
        "id": "XXXXXXXXXXXXXXXXXXXX",
        "name": "Entra & Esci",
        "hw_type": "NLT",
        "device": "remote"
      }, {
        "id": "XXXXXXXXXXXXXXXXXXXX",
        "name": "Ingresso",
        "hw_type": "NLM",
        "device": "light"
      }, {
        "id": "XXXXXXXXXXXXXXXXXXXX",
        "name": "Lampadario",
        "hw_type": "NLFN",
        "device": "light"
      }]
    }, {
      "type": "bathroom",
      "modules": [{
        "id": "XXXXXXXXXXXXXXXXXXXX",
        "name": "Specchio bagno giù",
        "hw_type": "NLL",
        "device": "light"
      }, {
        "id": "XXXXXXXXXXXXXXXXXXXX",
        "name": "Luce Bagno Giù",
        "hw_type": "NLL",
        "device": "light"
      }, {
        "id": "XXXXXXXXXXXXXXXXXXXX",
        "name": "Termoarredo bagno giù",
        "hw_type": "NLP",
        "type": "other",
        "device": "plug"
      }]
    }, {
      "type": "laundry",
      "modules": [{
        "id": "XXXXXXXXXXXXXXXXXXXX",
        "name": "Disimpegno",
        "hw_type": "NLL",
        "device": "light"
      }, {
        "id": "XXXXXXXXXXXXXXXXXXXX",
        "name": "Lavanderia",
        "hw_type": "NLL",
        "device": "light"
      }, {
        "id": "XXXXXXXXXXXXXXXXXXXX",
        "name": "Lavatrice",
        "hw_type": "NLP",
        "type": "washing_machine",
        "device": "plug"
      }, {
        "id": "XXXXXXXXXXXXXXXXXXXX",
        "name": "Asciugatrice",
        "hw_type": "NLP",
        "type": "tumble_dryer",
        "device": "plug"
      }]
    }, {
      "type": "kitchen",
      "modules": [{
        "id": "XXXXXXXXXXXXXXXXXXXX",
        "name": "Sottopensili",
        "hw_type": "NLL",
        "device": "light"
      }, {
        "id": "XXXXXXXXXXXXXXXXXXXX",
        "name": "Luce cucina",
        "hw_type": "NLL",
        "device": "light"
      }, {
        "id": "XXXXXXXXXXXXXXXXXXXX",
        "name": "Forno",
        "hw_type": "NLP",
        "type": "oven",
        "device": "plug"
      }, {
        "id": "XXXXXXXXXXXXXXXXXXXX",
        "name": "Lavastoviglie",
        "hw_type": "NLP",
        "type": "dishwasher",
        "device": "plug"
      }]
    }, {
      "type": "bedroom",
      "modules": [{
        "id": "XXXXXXXXXXXXXXXXXXXX",
        "name": "Luce camera",
        "hw_type": "NLL",
        "device": "light"
      }, {
        "id": "XXXXXXXXXXXXXXXXXXXX",
        "name": "Applique camera",
        "hw_type": "NLL",
        "device": "light"
      }]
    }, {
      "type": "bedroom",
      "modules": [{
        "id": "XXXXXXXXXXXXXXXXXXXX",
        "name": "Piantana Chicco",
        "hw_type": "NLL",
        "device": "light"
      }, {
        "id": "XXXXXXXXXXXXXXXXXXXX",
        "name": "Luce Chicco",
        "hw_type": "NLL",
        "device": "light"
      }]
    }, {
      "type": "bedroom",
      "modules": [{
        "id": "XXXXXXXXXXXXXXXXXXXX",
        "name": "Piantana armadio",
        "hw_type": "NLL",
        "device": "light"
      }, {
        "id": "XXXXXXXXXXXXXXXXXXXX",
        "name": "Soffitto Cabina",
        "hw_type": "NLL",
        "device": "light"
      }, {
        "id": "XXXXXXXXXXXXXXXXXXXX",
        "name": "Cabina Armadio",
        "hw_type": "NLL",
        "device": "light"
      }]
    }, {
      "type": "bathroom",
      "modules": [{
        "id": "XXXXXXXXXXXXXXXXXXXX",
        "name": "Luce bagno su",
        "hw_type": "NLL",
        "device": "light"
      }, {
        "id": "XXXXXXXXXXXXXXXXXXXX",
        "name": "Specchio bagno su",
        "hw_type": "NLL",
        "device": "light"
      }, {
        "id": "XXXXXXXXXXXXXXXXXXXX",
        "name": "Termoarredo bagno su",
        "hw_type": "NLP",
        "type": "other",
        "device": "plug"
      }]
    }, {
      "type": "home_office",
      "modules": [{
        "id": "XXXXXXXXXXXXXXXXXXXX",
        "name": "Luce Studio",
        "hw_type": "NLL",
        "device": "light"
      }, {
        "id": "XXXXXXXXXXXXXXXXXXXX",
        "name": "Piantana studio",
        "hw_type": "NLL",
        "device": "light"
      }]
    }, {
      "type": "custom",
      "modules": [{
        "id": "XXXXXXXXXXXXXXXXXXXX",
        "name": "Luce Jolly",
        "hw_type": "NLL",
        "device": "light"
      }]
    }, {
      "type": "custom",
      "modules": [{
        "id": "XXXXXXXXXXXXXXXXXXXX",
        "name": "Dispensa",
        "hw_type": "NLL",
        "device": "light"
      }]
    }, {
      "type": "stairs",
      "modules": [{
        "id": "XXXXXXXXXXXXXXXXXXXX",
        "name": "Angoli giù",
        "hw_type": "NLL",
        "device": "light"
      }, {
        "id": "XXXXXXXXXXXXXXXXXXXX",
        "name": "Angoli su",
        "hw_type": "NLM",
        "device": "light"
      }, {
        "id": "XXXXXXXXXXXXXXXXXXXX",
        "name": "Velux",
        "hw_type": "NLLV",
        "device": "automation"
      }]
    }, {
      "type": "outdoor",
      "modules": [{
        "id": "XXXXXXXXXXXXXXXXXXXX",
        "name": "Gazebo",
        "hw_type": "NLL",
        "device": "light"
      }]
    }],
    "modules": [ ]
  }
}

Hope this can help! Thank you very much in advance!!! :+1:

1 Like

Hi,

Can you provide me what does the NLL type light ? Is it dimmable and can it measure energy ?

Thank you in advance!

Sure!

NLL = Light Switch with Neutral, “ON-OFF” capability (not dimmable and it doesen’t measure energy, but in MyHome app I can attribute an energy consumption to each light). In my reply dated 20th May the first image is a NLL device…if I turn it on, the power shown will be the one I added in the app as “energy when on”.

NLPC = Connected DIN meter, installed in the energy cabinet, it measures the whole energy in use in my house.

NLT = It’s the remote used to configure the plant, add new devices and control “In & Out” scenarios.

NLM = Micro Module light switch, same capabilities like as NLL.

NLFN = Dimmable switch (same considerations made for NLL, but with dimmer capability 0-100%).

NLP = In-wall Power plug, can measure energy and power ON/OFF the plugged device.

NLLV = Roller Shutter Switch (with Level Detection). Open / Close a roller shutter, or it can be set to a specific opening percentage 0-100%.

For more information, here is a complete list with some additional specifications:
https://developer.legrand.com/documentation/compatible-product/

Thank you very much for your work!!! I owe you a beer :beers: :smiley:

1 Like

I added correctly all the lights and they work perfectly! Unfortunately the necessary delay (due to the 500 requests limit set by Legrand dev) makes the “device status” not very reliable being updated after several minutes…but everything works with lights.

Some additional details:

  • The dimmer value is shown correctly in the tile, but in the flows it makes me choose between 0 and 10.000%
  • I cannot add the energy meter…Homey doesn’t show any device
  • I can add the roller shutter device and it works correctly, but I cannot use it in flows…the device isn’t listed in flows creation

I will keep testing the app, if you have more specific things to try don’t hesitate to ask!
Thanks again, nice work!!

The app seems broken in the last 5-6 hours…all of my devices are not responding and it’s not possible to restart the app. :thinking:


Hi,

Yes I messed up with the code. I tried to fix the problems above but since I can’t test it right now I pushed the update as a test build and it seems broken. That’s why I deleted my message above.

I recommend you to go back to the normal build till I can test what goes wrong.

I’m verry sorry about that!

1 Like

Don’t worry, I’m at disposal in case you need some more details or tests!

:slightly_smiling_face:

Hi! Do you have some news about your app? Do you need help or more details about the devices?
Don’t hesitate to ask if I can help someway!

Thanks in advance for your work, ciao!

Hi,

I’m having my exams right now. I will be back on the app very soon!

Thank you!! Good luck for your exams!! :four_leaf_clover:

Hi,
I tried to contact you @NayvenFR via email.
In any case, using the app present on the homey app store (version 1.0.5) I saw that roller shutter and lights doesn’t work…I tried also to run the source code present on github (version 1.1.0) and I can’t run the app.
Than I will edited your source code, added the italian translation and now the roller shutter and light works fine.
Now I would add the possibility to execute Legrand scenes.

Could you please contact me so we can work together?

Thank you

1 Like

Hi, it would be great if you and @NayvenFR can work togheter to make this App working 100%!
If I can help in any way, don’t hesitate to ask (I have a complete Bticino Living Now plant in my home).

For your more information, there is also a test version 1.1.2 with some improvements and new devices added, but there are some parts of code to be fixed.

Hi @Alessandro_Rossi , I downloaded version 1.1.2 source code but I think that @NayvenFR forgot to commit the entire source code so I had to recreate the source code missed.

Now it works with my plant but I don’t know if it will cover your issues…I have to read the entire thread.

That version was working fine for me for some days; I only found some issues as listed here in my reply dated 27th May:

Don’t hesitate to ask me if you need some more details.
Ciao!

Hi sorry for the late answer, I just finished my exams !

I fixed the problems in your post except for the energy meter since I don’t have one ! The new version in test should run correctly for all the other products so !

Hi thanks for your work, I pushed the entire source code on GitHub for version 1.1.3 !

Yes I would appreciate the help for adding Legrand Scenes.

Thanks @NayvenFR, I will test the new version immediately as soon I will come back home!!

Feel free to ask for any detail you may need in order to improve the app!!
I will let you know about my tests :slight_smile:

Thanks again