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

working in Germany? #14

Open
faPU1909 opened this issue Jun 8, 2023 · 18 comments
Open

working in Germany? #14

faPU1909 opened this issue Jun 8, 2023 · 18 comments

Comments

@faPU1909
Copy link

faPU1909 commented Jun 8, 2023

I have a Ditra Heat E running at home.
In the installation process, an account was also created. However, I cannot log in to the website (https://ditra-heat-e-wifi.schluter.com/) with it. User does not exist. I cannot create an account there either.

What am I doing wrong? Or does it not work for customers from Germany? I would very much like to integrate it into Home Assistant.

@rajp1503
Copy link

Seems to be that in the European region, they are not offering the ability to login to Schluter's website so we may not be able to use this..

@IngoS11
Copy link
Owner

IngoS11 commented Aug 9, 2023

@rajp1503. Is there another URL they offer in Europe? I am in the US and might not be able to test agains it but I would be interested in giving it a try

@SpaceTeddy
Copy link

SpaceTeddy commented Sep 21, 2023

Well,
I use
"https://owd5-sl003-app.ojelectronics.com/api/UserProfile/SignIn"
for my simple python tool to get the session ID.

question: How I can change the login url in [ha-schluter]

thx

edit: ahh I see, it is based on py-schluter. this does not work

@ottosax
Copy link

ottosax commented Oct 18, 2023

@IngoS11
In europe you create your account with username (not email !) and password at your Ditra Heat device. With this we can login in the Android App called "Schlueter-HEAT-CONTROL" from Schlüter Systems KG.
A login in an other site/website from schlüter fails every time with "Wrong username/password" Error.

Do you have an idea what we can do to solve this and intigrate our Ditra Heat divices at HomeAssistant?

@IngoS11
Copy link
Owner

IngoS11 commented Nov 8, 2023

@SpaceTeddy : I base ha-schlueter on a async library aioschluter that I wrote. The URL is hardcoded at. Here in the US you can log into that website and see your thermostats and also control the thermostat via more or less REST based calls. There is no official API documentation but basically only what I reverse engineered from the original Schluter Integration.

@IngoS11
Copy link
Owner

IngoS11 commented Nov 8, 2023

@ottosax: Thank you so much for the information. Here in the US you find an app called "Schluter-DIETRA-HEAT-E-Wifi" in the iOS App Store as well as the Google Play Store. Looks like Schluter has implemented different systems (Apps as well as Backends) for the US and the European market.
I assume the European Ditra Heat devices also work on a Cloud Polling basis. If this is true it comes down to finding the European backend equivalent to the Schluter US Backend and then reverse engineering the calls that the European App makes to that backend. I assume that this will, just like the US one, not be a public API, but require reverse engineering.

Looking through the Google Play Store I also see here in the US Google Play Store this app https://play.google.com/store/apps/details?id=com.ojelectronics.owd5.sl003&hl=en_US&gl=US. Is that the app you use in Europe? I downloaded it onto an Android Device and I can not log on with my credentials.

@faPU1909
Copy link
Author

Hello Ingo,

Thank you for your commitment.
I can only talk about the IOS Store. There the app is called Schlueter-HEAT-CONTROL. As ottosax has written, the login is done with a username. I am based in Germany and have tried to log in with my user data and your URL. Unfortunately without success.

I couldn't find another URL either :\

@SpaceTeddy
Copy link

Hi,
What I mentioned above:
Here ist the login url for German iOS App
"https://owd5-sl003-app.ojelectronics.com/api/UserProfile/SignIn"

@faPU1909
Copy link
Author

Hi, What I mentioned above: Here ist the login url for German iOS App "https://owd5-sl003-app.ojelectronics.com/api/UserProfile/SignIn"

Okay, sorry I missed that. But there is still no way to integrate it into Home Assistant in Europe with what is available?

@IngoS11
Copy link
Owner

IngoS11 commented Dec 24, 2023

@faPU1909. There is no way to integrate that on my end. It would require somebody with a European Schluter heating unit and access to 240V power to run it and the ability to create a user that can access that URL to basically reverse engineer the API and add the integration. If we find somebody that is able to do that and he opens a pull request to my repo I am more than happy to accept that.

When I followed that URLs domain I found a controller on Amazon from that company OJ Microline Programmable Dual Voltage Touch Screen that looks exactly like the one I have from Shluter.

@ottosax
Copy link

ottosax commented Dec 26, 2023

Hi, What I mentioned above: Here ist the login url for German iOS App "https://owd5-sl003-app.ojelectronics.com/api/UserProfile/SignIn"

Okay, sorry I missed that. But there is still no way to integrate it into Home Assistant in Europe with what is available?

Its possible - Iam from germany and use for my Schluter bath heater this app with Home Assistant: OJ Microline Thermostat as integration. Works well, because, the Schluter system controler is the same as the one from OJ Microelektronics.
With this you can use up to 15 sensors/switches for your heater controler. :-)

@SpaceTeddy
Copy link

I can confirm that the OJ Microline integration works fine with the German Schlüter App.
I tested it some minutes ago.
unfortunatly Energy Data is missing

@ottosax
Copy link

ottosax commented Dec 27, 2023

Does any schluter integration have energy messurement? The app - yes, but the app is a grap.
An idea can be to use something like a shelly plug for this job if needed.
We use our Schlüter floor heater only in the month we have enough solar energy, so I can use it with a simple logic to switch on or off.

@SpaceTeddy
Copy link

SpaceTeddy commented Dec 28, 2023

well,
sry about my bad python skills, but you may use this as example to get energy data from German Schlüter integration. But for sure, you have to get the session_id first.

###----------get energy week data
def get_energy_data(viewtype, history):

    #ViewType: 1= day 2= week 3= week 4= month
    #History: How many of Viewtype in the past

    #read session_id from cache file
    session_id = get_session_id_from_file()

    #get current date and time
    dt_thermostat_string = now.strftime("%Y-%m-%dT%H:%M:%S")
    #get number of weekday
    weekday = datetime.today().weekday()

    url = "https://owd5-sl003-app.ojelectronics.com/api/EnergyUsage/GetEnergyUsage?sessionid=%s" %(session_id)

    headers = CaseInsensitiveDict()
    headers["Content-Type"] = "application/json; charset=utf-8"

    data = {
        "APIKEY": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
        "DateTime": dt_thermostat_string,
        "History": history,
        "ThermostatID": "xxxxxx",
        "ViewType": viewtype
    }
    resp = requests.post(url, headers=headers, json=data)
    resp_code = resp.status_code

    if resp_code == 200:
        #print("%s 3: %s HTTP POST Success - Response Code: %s" %(dt_string, application_name, resp.status_code))
        response_dict = json.loads(resp.text)

    else:
        if resp_code == 401:
            print("%s 3: %s HTTP POST Unauthorized - Log in first" %(dt_string, application_name))
            resp_code, session_id = get_session_id()
            url = "https://owd5-sl003-app.ojelectronics.com/api/EnergyUsage/GetEnergyUsage?sessionid=%s" %(session_id)
            resp = requests.post(url, headers=headers, json=data)
            resp_code = resp.status_code

            if resp_code != 200:
                    print("%s 3: %s HTTP POST Error - Response Code: %s" %(dt_string, application_name, resp.status_code))
                    response_dict = 0

            elif resp_code == 200:
                    response_dict = json.loads(resp.text)
           if args.verbose:
        print("%s 3: %s HTTP POST Success - Response Code: %s" %(dt_string, application_name, resp.status_code))
        print("%s 3: %s : %s" %(dt_string, application_name, json.dumps(response_dict, indent=4, sort_keys=True)))

        if viewtype == '2' and history == '0':
            print(response_dict['EnergyUsage'][0]['Usage'][weekday]['EnergyKWattHour'])

    return resp_code, response_dict

@ottosax
Copy link

ottosax commented Jan 10, 2024

The problem is the session-id, how do yout get it from german Schlüter integration or Android app eg?

@SpaceTeddy
Copy link

SpaceTeddy commented Jan 10, 2024

well, really easy.
Basically I traced the login from my iOS app.
my solution to receive the session ID is the following.
You need to add your APIKEY and your Login Data...

###---- Log in to OJ Electronics cloud server ------
def get_session_id():
    url = "https://owd5-sl003-app.ojelectronics.com/api/UserProfile/SignIn"

    headers = CaseInsensitiveDict()
    headers["Content-Type"] = "application/json; charset=utf-8"

    data = {

        "APIKEY": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxx",
        "ClientSWVersion": 1,
        "CustomerId": 3,
        "Password": "xxxxxxxxxxx",
        "UserName": "xxxxxxxxxxx"
    }

    resp = requests.post(url, headers=headers, json=data)
    resp_code = resp.status_code
    #print(resp.status_code)

    if resp_code == 200:
        pass #dummy
        #print("%s 3: %s Success - Response Code: %s" %(dt_string, application_name, resp.status_code))
    else:
        pass #dummy
        #print("%s 3: %s Error   - Response Code: %s" %(dt_string, application_name, resp.status_code))

    response_dict = json.loads(resp.text)

    session_id = response_dict.get('SessionId')
    #print("%s 3: %s Session_ID: %s" %(dt_string, application_name, session_id))

    with open('./session_id.txt', 'w') as f:
        f.write(session_id)

    return resp_code, session_id`

@rholighaus
Copy link

need to add your APIKEY and your Login Data...

Sorry for being ignorant but how do I find my APIKEY?

@SpaceTeddy
Copy link

SpaceTeddy commented May 30, 2024

Well, guess I traced the key with a tool like mitmproxy.

But probably also this key works

openhab/openhab-addons#9547

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

No branches or pull requests

6 participants