Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Language setting #30

Open
janpep opened this issue Apr 8, 2022 · 6 comments
Open

Language setting #30

janpep opened this issue Apr 8, 2022 · 6 comments

Comments

@janpep
Copy link

janpep commented Apr 8, 2022

Thanks for the update of this plugin. (I was still on 0.7.3, having issues to do settings from Domoticz).
Now used the plugin.py from #27
I use it in combination with the temperature from EVOhome plugin,

I found out that using the plugin changed the language from Dutch to English in the MELcloud app.
This can be solved by adding the wanted language=12 (for Dutch) to the login arguments like this:

def melcloud_login(self):
data = "AppVersion=1.9.3.0&Language=12&Email={0}&Password={1}".format(Parameters["Username"], Parameters["Password"])
self.melcloud_send_data(self.melcloud_urls["login"], data, "LOGIN")
return True

May be it can be included?

For completeness here a list with Language codes that I have found earlier.
Language codes:
0 = en English
1 = bg Български
2 = cs Čeština
3 = da Dansk
4 = de Deutsch
5 = et Eesti
6 = es Español
7 = fr Français
8 = hy Հայերեն
9 = lv Latviešu
10 = lt Lietuvių
11 = hu Magyar
12 = nl Nederlands
13 = no Norwegian
14 = pl Polski
15 = pt Português
16 = ru Русский
17 = fi Suomi
18 = sv Svenska
19 = it Italiano
20 = uk Українська
21 = tr Türkçe
22 = el Ελληνικά
23 = hr Hrvatski
24 = ro Română
25 = sl Slovenščina

Best regards
Jan Peppink, https://ict.peppink.nl

@janpep janpep changed the title Lanquage setting Language setting Apr 8, 2022
@WouterNordsiek
Copy link

WouterNordsiek commented Oct 8, 2022

To bad, this workaround is not working for me. Are you sure its working with your code from above?

@janpep
Copy link
Author

janpep commented Oct 9, 2022

Positive! I am very sure.
I have just tested again to be very sure that this code changes the language used for this user.

  1. Verified and confirm current language used in MELCloud App is Dutch and closed the MELCloud app.
  2. Changed plugin.py: the 'Language=12' from my example code to 'Language=0' and restarted Domoticz.
  3. Started MELCloud app. Verified and confirm current language used is English and closed the MELCloud app.
  4. Changed plugin.py: the 'Language=0' back to 'Language=12' and restarted Domoticz.
  5. Started MELCloud app. Verified and confirm current language used in the app is Dutch.

BTW. Not tested now, but from my earlier experience, I guess that when the language is not set here, it defaults to English. This because I discovered the language had changed from Dutch to English when I started to use the plugin without this language setting..

@omuskyo
Copy link

omuskyo commented Oct 9, 2022

Ohh ! I did not understand why the language changed on MELCloud App ! This is the reason !

So in plugin.py (I'm using #27 too), find :

def melcloud_login(self):
#data = "AppVersion=1.9.3.0&Email={0}&Password={1}".format(Parameters["Username"], Parameters["Password"])
post_fields = "Appversion:'{0}',CaptchaResponse:{1},Email:'{2}',Language:{3},Password:'{4}',Persist:{5}"
post_fields = post_fields.format(str("1.23.4.0"), "null",str(Parameters["Username"]),"1", str(Parameters["Password"]), "true")
self.melcloud_send_data_json(self.melcloud_urls["login"], "{"+post_fields+"}", "LOGIN")
return True

On second post_fields line, I changed fourth value from "1" to "7" (french language), and now it's OK.

Thanks a lot

@janpep
Copy link
Author

janpep commented Oct 9, 2022

I am still using Version: 0.7.7 where the melcloud_login is defined as in my first post.
I will look to the updated version to. Thanks.

@WouterNordsiek
Copy link

WouterNordsiek commented Oct 9, 2022

Ohh ! I did not understand why the language changed on MELCloud App ! This is the reason !

So in plugin.py (I'm using #27 too), find :

def melcloud_login(self): #data = "AppVersion=1.9.3.0&Email={0}&Password={1}".format(Parameters["Username"], Parameters["Password"]) post_fields = "Appversion:'{0}',CaptchaResponse:{1},Email:'{2}',Language:{3},Password:'{4}',Persist:{5}" post_fields = post_fields.format(str("1.23.4.0"), "null",str(Parameters["Username"]),"1", str(Parameters["Password"]), "true") self.melcloud_send_data_json(self.melcloud_urls["login"], "{"+post_fields+"}", "LOGIN") return True

On second post_fields line, I changed fourth value from "1" to "7" (french language), and now it's OK.

Thanks a lot

Thank You!!
Now its working with the latest version 0.7.9 Gysmo, 2017 Updated by nonolk 2022.

post_fields = post_fields.format(str("1.23.4.0"), "null",str(Parameters["Username"]),"1",

Replacing "1" (at the end of the line) with "12" (Dutch) did the trick!!

Thanks again!!

@janpep
Copy link
Author

janpep commented Oct 9, 2022

On the main Code <> page it is still:

  • MELCloud Plugin

  • Author: Gysmo, 2017

  • Version: 0.7.7

  • Release Notes:

  • v0.7.8: Code optimization

I will stick to that version for now, because it is working well for me, with my language edit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants