Skip to content
  • Home
  • Aktuell
  • Tags
  • 0 Ungelesen 0
  • Kategorien
  • Unreplied
  • Beliebt
  • GitHub
  • Docu
  • Hilfe
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Standard: (Kein Skin)
  • Kein Skin
Einklappen
ioBroker Logo

Community Forum

donate donate
  1. ioBroker Community Home
  2. Deutsch
  3. Tester
  4. Adapter Hyundai (Bluelink) oder KIA (UVO)

NEWS

  • Jahresrückblick 2025 – unser neuer Blogbeitrag ist online! ✨
    BluefoxB
    Bluefox
    16
    1
    1.2k

  • Neuer Blogbeitrag: Monatsrückblick - Dezember 2025 🎄
    BluefoxB
    Bluefox
    13
    1
    757

  • Weihnachtsangebot 2025! 🎄
    BluefoxB
    Bluefox
    25
    1
    2.0k

Adapter Hyundai (Bluelink) oder KIA (UVO)

Geplant Angeheftet Gesperrt Verschoben Tester
2.4k Beiträge 155 Kommentatoren 913.9k Aufrufe 143 Watching
  • Älteste zuerst
  • Neuste zuerst
  • Meiste Stimmen
Antworten
  • In einem neuen Thema antworten
Anmelden zum Antworten
Dieses Thema wurde gelöscht. Nur Nutzer mit entsprechenden Rechten können es sehen.
  • F Offline
    F Offline
    fichte_112
    schrieb am zuletzt editiert von fichte_112
    #2249

    Anleitung zur Erstellung eines Tokens für Hyundai oder KIA mit Windows

    Python Releases for Windows installieren.
    Google Chrome installieren

    In der Konsole folgenden Befehl ausführen. (oder den Adapter Bluelink löschen)

    rm -r /opt/iobroker/node_modules/bluelinky/
    

    Im Iobroker den Reiter Adapter anklicken. Dan den Expertenmodus aktivieren und die Katze anklicken.
    Screenshot 2025-10-22 114413.png

    Screenshot 2025-10-22 150641.png

    Den Reiter Benutzerdefiniert auswählen und folgendes eintragen und installieren.

    https://github.com/Newan/ioBroker.bluelink.git
    

    Jetzt Windows PowerShell mit administrativen Rechten starten.

    Jetzt folgende Befehle nacheinander ausführen.

    Set-ExecutionPolicy Unrestricted
    

    A eingeben und mit Enter bestätigen.

    mkdir $env:TEMP\token 2>$null; cd $env:TEMP\token
    
    $code = @"
    # Original authors:
    # Kia: fuatakgun (https://gist.githubusercontent.com/fuatakgun/fa4ef1e1d48b8dca2d22133d4d028dc9#gistfile1.txt)
    # Hyundai: Maaxion (https://gist.github.com/Maaxion/22a38ba8fb06937da18482ddf35171ac#file-gistfile1-txt)
    #
    import argparse
    import re
    from selenium import webdriver
    from selenium.webdriver.common.by import By
    from selenium.webdriver.support.ui import WebDriverWait
    from selenium.webdriver.support import expected_conditions as EC
    from selenium.common.exceptions import TimeoutException
    import requests
    
    import time
    
    def main():
        """
        Determine brand to get the refresh token for
        """
        parser = argparse.ArgumentParser()
        parser.add_argument("--brand", help="Brand of vehicle (Hyundai/Kia)", type=str.lower, required=True, choices=['hyundai','kia'])
        args = parser.parse_args()
    
        """
        Populate global variables
        """
        BASE_URL = f"https://idpconnect-eu.{args.brand}.com/auth/api/v2/user/oauth2/"
        TOKEN_URL = f"{BASE_URL}token"
    
        if args.brand == 'kia':
            # Kia specific variables here
            CLIENT_ID = "fdc85c00-0a2f-4c64-bcb4-2cfb1500730a"
            CLIENT_SECRET = "secret"
            REDIRECT_URL_FINAL = "https://prd.eu-ccapi.kia.com:8080/api/v1/user/oauth2/redirect"
            SUCCESS_ELEMENT_SELECTOR = "a[class='logout user']" 
            LOGIN_URL = f"{BASE_URL}authorize?ui_locales=de&scope=openid%20profile%20email%20phone&response_type=code&client_id=peukiaidm-online-sales&redirect_uri=https://www.kia.com/api/bin/oneid/login&state=aHR0cHM6Ly93d3cua2lhLmNvbTo0NDMvZGUvP21zb2NraWQ9MjM1NDU0ODBmNmUyNjg5NDIwMmU0MDBjZjc2OTY5NWQmX3RtPTE3NTYzMTg3MjY1OTImX3RtPTE3NTYzMjQyMTcxMjY=_default" 
        elif args.brand == 'hyundai':
            # Hyundai specific variables
            CLIENT_ID = "6d477c38-3ca4-4cf3-9557-2a1929a94654"
            CLIENT_SECRET = "KUy49XxPzLpLuoK0xhBC77W6VXhmtQR9iQhmIFjjoY4IpxsV"
            REDIRECT_URL_FINAL = "https://prd.eu-ccapi.hyundai.com:8080/api/v1/user/oauth2/token"
            SUCCESS_ELEMENT_SELECTOR = "button.mail_check" 
            LOGIN_URL = f"{BASE_URL}authorize?client_id=peuhyundaiidm-ctb&redirect_uri=https%3A%2F%2Fctbapi.hyundai-europe.com%2Fapi%2Fauth&nonce=&state=NL_&scope=openid+profile+email+phone&response_type=code&connector_client_id=peuhyundaiidm-ctb&connector_scope=&connector_session_key=&country=&captcha=1&ui_locales=en-US" 
    
        REDIRECT_URL = f"{BASE_URL}authorize?response_type=code&client_id={CLIENT_ID}&redirect_uri={REDIRECT_URL_FINAL}&lang=de&state=ccsp"
    
        """
        Main function to run the Selenium automation.
        """
        # Initialize the Chrome WebDriver
        # Make sure you have chromedriver installed and in your PATH,
        # or specify the path to it.
        options = webdriver.ChromeOptions()
        options.add_argument("user-agent=Mozilla/5.0 (Linux; Android 4.1.1; Galaxy Nexus Build/JRO03C) AppleWebKit/535.19 (KHTML, like Gecko) Chrome/18.0.1025.166 Mobile Safari/535.19_CCS_APP_AOS")
        options.add_argument("--auto-open-devtools-for-tabs")
        driver = webdriver.Chrome(options=options)
        driver.maximize_window()
    
        # 1. Open the login page
        print(f"Opening login page: {LOGIN_URL}")
        driver.get(LOGIN_URL)
    
        print("\n" + "="*50)
        print("Please log in manually in the browser window.")
        print("The script will wait for you to complete the login...")
        print("="*50 + "\n")
    
        try:
            wait = WebDriverWait(driver, 300) # 300-second timeout
            if args.brand == "kia":
                wait.until(EC.presence_of_element_located((By.CSS_SELECTOR, SUCCESS_ELEMENT_SELECTOR)))
            else:
                wait.until(EC.any_of(
                    EC.presence_of_element_located((By.CSS_SELECTOR, SUCCESS_ELEMENT_SELECTOR)),
                    EC.presence_of_element_located((By.CSS_SELECTOR, "button.ctb_button"))
                    )
                )
                
            print("✅ Login successful! Element found.")
            print(f"Redirecting to: {REDIRECT_URL}")
            driver.get(REDIRECT_URL)
            wait = WebDriverWait(driver, 15) # 15-second timeout
            
            current_url = ""
    
            tries_left = 10
            redir_found = False
            
            while (tries_left > 0):
                current_url = driver.current_url
                print(f" - [{11 - tries_left}] Waiting for redirect URLwith code")
                if args.brand == "kia":
                    if re.match(r'^https://.*:8080/api/v1/user/oauth2/redirect', current_url):
                        redir_found = True
                        break
                elif args.brand == "hyundai":
                    if re.match(r'^https://.*:8080/api/v1/user/oauth2/token', current_url):
                        redir_found = True
                        break
                tries_left -= 1
                time.sleep(1)
            
            if redir_found == False:
                print(f"\n❌ Failed to get redirected to correct URL, got {current_url} instead")
                
            code = re.search(
                    r'code=([0-9a-fA-F-]{36}\.[0-9a-fA-F-]{36}\.[0-9a-fA-F-]{36})',
                    current_url
                ).group(1)
            data = {
                "grant_type": "authorization_code",
                "code": code,
                "redirect_uri": REDIRECT_URL_FINAL,
                "client_id": CLIENT_ID,
                "client_secret": CLIENT_SECRET,
            }
            session = requests.Session()
            response = session.post(TOKEN_URL, data=data)
            if response.status_code == 200:
                tokens = response.json()
                if tokens is not None:
                    refresh_token = tokens["refresh_token"]
                    access_token = tokens["access_token"]
                    print(f"\n✅ Your tokens are:\n\n- Refresh Token: {refresh_token}\n- Access Token: {access_token}")
            else:
                print(f"\n❌ Error getting tokens from der API!\n{response.text}")
    
        except TimeoutException:
            print("❌ Timed out after 5 minutes. Login was not completed or the success element was not found.")
        except Exception as e:
            print(f"An unexpected error occurred: {e}")
            time.sleep(3600)
        finally:
            print("Cleaning up and closing the browser.")
            driver.quit()        
    
    if __name__ == "__main__":
        main()
    "@
    $code | Out-File -FilePath "$env:TEMP\token\ApiToken.py" -Encoding UTF8
     
    
    
    py -m venv .venv
    
    .\.venv\Scripts\Activate.ps1
    
    pip install --upgrade pip
    
    pip install selenium requests webdriver-manager
    
    py -m pip install --upgrade pip selenium requests
    

    Achtung jetzt nur den Befehl für Hyundai oder KIA verwenden!!!

    für Hyundai

    cls
    
    py .\ApiToken.py --brand hyundai
    

    für KIA

    cls
    
    py .\ApiToken.py --brand kia
    

    Hier geht es für beide weiter.

    Jetzt sollte sich Chrome öffnen. Dort mit den Benutzerdaten einloggen.
    Nun sollte im Fenster von PowerShell ein Refresh Token und ein Access Token erscheinen.
    Diese mit der Maus markieren und mit Strg-C kopieren und in eine leere Textdatei mit Strg-V einfügen.
    Der Refresh Token ist das Passwort für den Bluelink Adapter

    Als letztes kann nun noch die Ausführungsrichtlinien (Unrestricted) für PowerShell-Scripts entfernt und der temporäre Ordner gelöscht werden. Dazu in der Powershell die folgenden Befehle eingeben.

    Set-ExecutionPolicy Undefined
    

    A eingeben und mit Enter bestätigen.

    cd..
    
    Remove-item $env:TEMP\token
    

    A eingeben und mit Enter bestätigen.

    Viel Spass

    R meuteM S C arteckA 9 Antworten Letzte Antwort
    4
    • F fichte_112

      Anleitung zur Erstellung eines Tokens für Hyundai oder KIA mit Windows

      Python Releases for Windows installieren.
      Google Chrome installieren

      In der Konsole folgenden Befehl ausführen. (oder den Adapter Bluelink löschen)

      rm -r /opt/iobroker/node_modules/bluelinky/
      

      Im Iobroker den Reiter Adapter anklicken. Dan den Expertenmodus aktivieren und die Katze anklicken.
      Screenshot 2025-10-22 114413.png

      Screenshot 2025-10-22 150641.png

      Den Reiter Benutzerdefiniert auswählen und folgendes eintragen und installieren.

      https://github.com/Newan/ioBroker.bluelink.git
      

      Jetzt Windows PowerShell mit administrativen Rechten starten.

      Jetzt folgende Befehle nacheinander ausführen.

      Set-ExecutionPolicy Unrestricted
      

      A eingeben und mit Enter bestätigen.

      mkdir $env:TEMP\token 2>$null; cd $env:TEMP\token
      
      $code = @"
      # Original authors:
      # Kia: fuatakgun (https://gist.githubusercontent.com/fuatakgun/fa4ef1e1d48b8dca2d22133d4d028dc9#gistfile1.txt)
      # Hyundai: Maaxion (https://gist.github.com/Maaxion/22a38ba8fb06937da18482ddf35171ac#file-gistfile1-txt)
      #
      import argparse
      import re
      from selenium import webdriver
      from selenium.webdriver.common.by import By
      from selenium.webdriver.support.ui import WebDriverWait
      from selenium.webdriver.support import expected_conditions as EC
      from selenium.common.exceptions import TimeoutException
      import requests
      
      import time
      
      def main():
          """
          Determine brand to get the refresh token for
          """
          parser = argparse.ArgumentParser()
          parser.add_argument("--brand", help="Brand of vehicle (Hyundai/Kia)", type=str.lower, required=True, choices=['hyundai','kia'])
          args = parser.parse_args()
      
          """
          Populate global variables
          """
          BASE_URL = f"https://idpconnect-eu.{args.brand}.com/auth/api/v2/user/oauth2/"
          TOKEN_URL = f"{BASE_URL}token"
      
          if args.brand == 'kia':
              # Kia specific variables here
              CLIENT_ID = "fdc85c00-0a2f-4c64-bcb4-2cfb1500730a"
              CLIENT_SECRET = "secret"
              REDIRECT_URL_FINAL = "https://prd.eu-ccapi.kia.com:8080/api/v1/user/oauth2/redirect"
              SUCCESS_ELEMENT_SELECTOR = "a[class='logout user']" 
              LOGIN_URL = f"{BASE_URL}authorize?ui_locales=de&scope=openid%20profile%20email%20phone&response_type=code&client_id=peukiaidm-online-sales&redirect_uri=https://www.kia.com/api/bin/oneid/login&state=aHR0cHM6Ly93d3cua2lhLmNvbTo0NDMvZGUvP21zb2NraWQ9MjM1NDU0ODBmNmUyNjg5NDIwMmU0MDBjZjc2OTY5NWQmX3RtPTE3NTYzMTg3MjY1OTImX3RtPTE3NTYzMjQyMTcxMjY=_default" 
          elif args.brand == 'hyundai':
              # Hyundai specific variables
              CLIENT_ID = "6d477c38-3ca4-4cf3-9557-2a1929a94654"
              CLIENT_SECRET = "KUy49XxPzLpLuoK0xhBC77W6VXhmtQR9iQhmIFjjoY4IpxsV"
              REDIRECT_URL_FINAL = "https://prd.eu-ccapi.hyundai.com:8080/api/v1/user/oauth2/token"
              SUCCESS_ELEMENT_SELECTOR = "button.mail_check" 
              LOGIN_URL = f"{BASE_URL}authorize?client_id=peuhyundaiidm-ctb&redirect_uri=https%3A%2F%2Fctbapi.hyundai-europe.com%2Fapi%2Fauth&nonce=&state=NL_&scope=openid+profile+email+phone&response_type=code&connector_client_id=peuhyundaiidm-ctb&connector_scope=&connector_session_key=&country=&captcha=1&ui_locales=en-US" 
      
          REDIRECT_URL = f"{BASE_URL}authorize?response_type=code&client_id={CLIENT_ID}&redirect_uri={REDIRECT_URL_FINAL}&lang=de&state=ccsp"
      
          """
          Main function to run the Selenium automation.
          """
          # Initialize the Chrome WebDriver
          # Make sure you have chromedriver installed and in your PATH,
          # or specify the path to it.
          options = webdriver.ChromeOptions()
          options.add_argument("user-agent=Mozilla/5.0 (Linux; Android 4.1.1; Galaxy Nexus Build/JRO03C) AppleWebKit/535.19 (KHTML, like Gecko) Chrome/18.0.1025.166 Mobile Safari/535.19_CCS_APP_AOS")
          options.add_argument("--auto-open-devtools-for-tabs")
          driver = webdriver.Chrome(options=options)
          driver.maximize_window()
      
          # 1. Open the login page
          print(f"Opening login page: {LOGIN_URL}")
          driver.get(LOGIN_URL)
      
          print("\n" + "="*50)
          print("Please log in manually in the browser window.")
          print("The script will wait for you to complete the login...")
          print("="*50 + "\n")
      
          try:
              wait = WebDriverWait(driver, 300) # 300-second timeout
              if args.brand == "kia":
                  wait.until(EC.presence_of_element_located((By.CSS_SELECTOR, SUCCESS_ELEMENT_SELECTOR)))
              else:
                  wait.until(EC.any_of(
                      EC.presence_of_element_located((By.CSS_SELECTOR, SUCCESS_ELEMENT_SELECTOR)),
                      EC.presence_of_element_located((By.CSS_SELECTOR, "button.ctb_button"))
                      )
                  )
                  
              print("✅ Login successful! Element found.")
              print(f"Redirecting to: {REDIRECT_URL}")
              driver.get(REDIRECT_URL)
              wait = WebDriverWait(driver, 15) # 15-second timeout
              
              current_url = ""
      
              tries_left = 10
              redir_found = False
              
              while (tries_left > 0):
                  current_url = driver.current_url
                  print(f" - [{11 - tries_left}] Waiting for redirect URLwith code")
                  if args.brand == "kia":
                      if re.match(r'^https://.*:8080/api/v1/user/oauth2/redirect', current_url):
                          redir_found = True
                          break
                  elif args.brand == "hyundai":
                      if re.match(r'^https://.*:8080/api/v1/user/oauth2/token', current_url):
                          redir_found = True
                          break
                  tries_left -= 1
                  time.sleep(1)
              
              if redir_found == False:
                  print(f"\n❌ Failed to get redirected to correct URL, got {current_url} instead")
                  
              code = re.search(
                      r'code=([0-9a-fA-F-]{36}\.[0-9a-fA-F-]{36}\.[0-9a-fA-F-]{36})',
                      current_url
                  ).group(1)
              data = {
                  "grant_type": "authorization_code",
                  "code": code,
                  "redirect_uri": REDIRECT_URL_FINAL,
                  "client_id": CLIENT_ID,
                  "client_secret": CLIENT_SECRET,
              }
              session = requests.Session()
              response = session.post(TOKEN_URL, data=data)
              if response.status_code == 200:
                  tokens = response.json()
                  if tokens is not None:
                      refresh_token = tokens["refresh_token"]
                      access_token = tokens["access_token"]
                      print(f"\n✅ Your tokens are:\n\n- Refresh Token: {refresh_token}\n- Access Token: {access_token}")
              else:
                  print(f"\n❌ Error getting tokens from der API!\n{response.text}")
      
          except TimeoutException:
              print("❌ Timed out after 5 minutes. Login was not completed or the success element was not found.")
          except Exception as e:
              print(f"An unexpected error occurred: {e}")
              time.sleep(3600)
          finally:
              print("Cleaning up and closing the browser.")
              driver.quit()        
      
      if __name__ == "__main__":
          main()
      "@
      $code | Out-File -FilePath "$env:TEMP\token\ApiToken.py" -Encoding UTF8
       
      
      
      py -m venv .venv
      
      .\.venv\Scripts\Activate.ps1
      
      pip install --upgrade pip
      
      pip install selenium requests webdriver-manager
      
      py -m pip install --upgrade pip selenium requests
      

      Achtung jetzt nur den Befehl für Hyundai oder KIA verwenden!!!

      für Hyundai

      cls
      
      py .\ApiToken.py --brand hyundai
      

      für KIA

      cls
      
      py .\ApiToken.py --brand kia
      

      Hier geht es für beide weiter.

      Jetzt sollte sich Chrome öffnen. Dort mit den Benutzerdaten einloggen.
      Nun sollte im Fenster von PowerShell ein Refresh Token und ein Access Token erscheinen.
      Diese mit der Maus markieren und mit Strg-C kopieren und in eine leere Textdatei mit Strg-V einfügen.
      Der Refresh Token ist das Passwort für den Bluelink Adapter

      Als letztes kann nun noch die Ausführungsrichtlinien (Unrestricted) für PowerShell-Scripts entfernt und der temporäre Ordner gelöscht werden. Dazu in der Powershell die folgenden Befehle eingeben.

      Set-ExecutionPolicy Undefined
      

      A eingeben und mit Enter bestätigen.

      cd..
      
      Remove-item $env:TEMP\token
      

      A eingeben und mit Enter bestätigen.

      Viel Spass

      R Online
      R Online
      RISSN
      schrieb am zuletzt editiert von
      #2250

      @fichte_112 besser geht es nicht, super Anleitung dafür.

      1 Antwort Letzte Antwort
      0
      • F fichte_112

        Anleitung zur Erstellung eines Tokens für Hyundai oder KIA mit Windows

        Python Releases for Windows installieren.
        Google Chrome installieren

        In der Konsole folgenden Befehl ausführen. (oder den Adapter Bluelink löschen)

        rm -r /opt/iobroker/node_modules/bluelinky/
        

        Im Iobroker den Reiter Adapter anklicken. Dan den Expertenmodus aktivieren und die Katze anklicken.
        Screenshot 2025-10-22 114413.png

        Screenshot 2025-10-22 150641.png

        Den Reiter Benutzerdefiniert auswählen und folgendes eintragen und installieren.

        https://github.com/Newan/ioBroker.bluelink.git
        

        Jetzt Windows PowerShell mit administrativen Rechten starten.

        Jetzt folgende Befehle nacheinander ausführen.

        Set-ExecutionPolicy Unrestricted
        

        A eingeben und mit Enter bestätigen.

        mkdir $env:TEMP\token 2>$null; cd $env:TEMP\token
        
        $code = @"
        # Original authors:
        # Kia: fuatakgun (https://gist.githubusercontent.com/fuatakgun/fa4ef1e1d48b8dca2d22133d4d028dc9#gistfile1.txt)
        # Hyundai: Maaxion (https://gist.github.com/Maaxion/22a38ba8fb06937da18482ddf35171ac#file-gistfile1-txt)
        #
        import argparse
        import re
        from selenium import webdriver
        from selenium.webdriver.common.by import By
        from selenium.webdriver.support.ui import WebDriverWait
        from selenium.webdriver.support import expected_conditions as EC
        from selenium.common.exceptions import TimeoutException
        import requests
        
        import time
        
        def main():
            """
            Determine brand to get the refresh token for
            """
            parser = argparse.ArgumentParser()
            parser.add_argument("--brand", help="Brand of vehicle (Hyundai/Kia)", type=str.lower, required=True, choices=['hyundai','kia'])
            args = parser.parse_args()
        
            """
            Populate global variables
            """
            BASE_URL = f"https://idpconnect-eu.{args.brand}.com/auth/api/v2/user/oauth2/"
            TOKEN_URL = f"{BASE_URL}token"
        
            if args.brand == 'kia':
                # Kia specific variables here
                CLIENT_ID = "fdc85c00-0a2f-4c64-bcb4-2cfb1500730a"
                CLIENT_SECRET = "secret"
                REDIRECT_URL_FINAL = "https://prd.eu-ccapi.kia.com:8080/api/v1/user/oauth2/redirect"
                SUCCESS_ELEMENT_SELECTOR = "a[class='logout user']" 
                LOGIN_URL = f"{BASE_URL}authorize?ui_locales=de&scope=openid%20profile%20email%20phone&response_type=code&client_id=peukiaidm-online-sales&redirect_uri=https://www.kia.com/api/bin/oneid/login&state=aHR0cHM6Ly93d3cua2lhLmNvbTo0NDMvZGUvP21zb2NraWQ9MjM1NDU0ODBmNmUyNjg5NDIwMmU0MDBjZjc2OTY5NWQmX3RtPTE3NTYzMTg3MjY1OTImX3RtPTE3NTYzMjQyMTcxMjY=_default" 
            elif args.brand == 'hyundai':
                # Hyundai specific variables
                CLIENT_ID = "6d477c38-3ca4-4cf3-9557-2a1929a94654"
                CLIENT_SECRET = "KUy49XxPzLpLuoK0xhBC77W6VXhmtQR9iQhmIFjjoY4IpxsV"
                REDIRECT_URL_FINAL = "https://prd.eu-ccapi.hyundai.com:8080/api/v1/user/oauth2/token"
                SUCCESS_ELEMENT_SELECTOR = "button.mail_check" 
                LOGIN_URL = f"{BASE_URL}authorize?client_id=peuhyundaiidm-ctb&redirect_uri=https%3A%2F%2Fctbapi.hyundai-europe.com%2Fapi%2Fauth&nonce=&state=NL_&scope=openid+profile+email+phone&response_type=code&connector_client_id=peuhyundaiidm-ctb&connector_scope=&connector_session_key=&country=&captcha=1&ui_locales=en-US" 
        
            REDIRECT_URL = f"{BASE_URL}authorize?response_type=code&client_id={CLIENT_ID}&redirect_uri={REDIRECT_URL_FINAL}&lang=de&state=ccsp"
        
            """
            Main function to run the Selenium automation.
            """
            # Initialize the Chrome WebDriver
            # Make sure you have chromedriver installed and in your PATH,
            # or specify the path to it.
            options = webdriver.ChromeOptions()
            options.add_argument("user-agent=Mozilla/5.0 (Linux; Android 4.1.1; Galaxy Nexus Build/JRO03C) AppleWebKit/535.19 (KHTML, like Gecko) Chrome/18.0.1025.166 Mobile Safari/535.19_CCS_APP_AOS")
            options.add_argument("--auto-open-devtools-for-tabs")
            driver = webdriver.Chrome(options=options)
            driver.maximize_window()
        
            # 1. Open the login page
            print(f"Opening login page: {LOGIN_URL}")
            driver.get(LOGIN_URL)
        
            print("\n" + "="*50)
            print("Please log in manually in the browser window.")
            print("The script will wait for you to complete the login...")
            print("="*50 + "\n")
        
            try:
                wait = WebDriverWait(driver, 300) # 300-second timeout
                if args.brand == "kia":
                    wait.until(EC.presence_of_element_located((By.CSS_SELECTOR, SUCCESS_ELEMENT_SELECTOR)))
                else:
                    wait.until(EC.any_of(
                        EC.presence_of_element_located((By.CSS_SELECTOR, SUCCESS_ELEMENT_SELECTOR)),
                        EC.presence_of_element_located((By.CSS_SELECTOR, "button.ctb_button"))
                        )
                    )
                    
                print("✅ Login successful! Element found.")
                print(f"Redirecting to: {REDIRECT_URL}")
                driver.get(REDIRECT_URL)
                wait = WebDriverWait(driver, 15) # 15-second timeout
                
                current_url = ""
        
                tries_left = 10
                redir_found = False
                
                while (tries_left > 0):
                    current_url = driver.current_url
                    print(f" - [{11 - tries_left}] Waiting for redirect URLwith code")
                    if args.brand == "kia":
                        if re.match(r'^https://.*:8080/api/v1/user/oauth2/redirect', current_url):
                            redir_found = True
                            break
                    elif args.brand == "hyundai":
                        if re.match(r'^https://.*:8080/api/v1/user/oauth2/token', current_url):
                            redir_found = True
                            break
                    tries_left -= 1
                    time.sleep(1)
                
                if redir_found == False:
                    print(f"\n❌ Failed to get redirected to correct URL, got {current_url} instead")
                    
                code = re.search(
                        r'code=([0-9a-fA-F-]{36}\.[0-9a-fA-F-]{36}\.[0-9a-fA-F-]{36})',
                        current_url
                    ).group(1)
                data = {
                    "grant_type": "authorization_code",
                    "code": code,
                    "redirect_uri": REDIRECT_URL_FINAL,
                    "client_id": CLIENT_ID,
                    "client_secret": CLIENT_SECRET,
                }
                session = requests.Session()
                response = session.post(TOKEN_URL, data=data)
                if response.status_code == 200:
                    tokens = response.json()
                    if tokens is not None:
                        refresh_token = tokens["refresh_token"]
                        access_token = tokens["access_token"]
                        print(f"\n✅ Your tokens are:\n\n- Refresh Token: {refresh_token}\n- Access Token: {access_token}")
                else:
                    print(f"\n❌ Error getting tokens from der API!\n{response.text}")
        
            except TimeoutException:
                print("❌ Timed out after 5 minutes. Login was not completed or the success element was not found.")
            except Exception as e:
                print(f"An unexpected error occurred: {e}")
                time.sleep(3600)
            finally:
                print("Cleaning up and closing the browser.")
                driver.quit()        
        
        if __name__ == "__main__":
            main()
        "@
        $code | Out-File -FilePath "$env:TEMP\token\ApiToken.py" -Encoding UTF8
         
        
        
        py -m venv .venv
        
        .\.venv\Scripts\Activate.ps1
        
        pip install --upgrade pip
        
        pip install selenium requests webdriver-manager
        
        py -m pip install --upgrade pip selenium requests
        

        Achtung jetzt nur den Befehl für Hyundai oder KIA verwenden!!!

        für Hyundai

        cls
        
        py .\ApiToken.py --brand hyundai
        

        für KIA

        cls
        
        py .\ApiToken.py --brand kia
        

        Hier geht es für beide weiter.

        Jetzt sollte sich Chrome öffnen. Dort mit den Benutzerdaten einloggen.
        Nun sollte im Fenster von PowerShell ein Refresh Token und ein Access Token erscheinen.
        Diese mit der Maus markieren und mit Strg-C kopieren und in eine leere Textdatei mit Strg-V einfügen.
        Der Refresh Token ist das Passwort für den Bluelink Adapter

        Als letztes kann nun noch die Ausführungsrichtlinien (Unrestricted) für PowerShell-Scripts entfernt und der temporäre Ordner gelöscht werden. Dazu in der Powershell die folgenden Befehle eingeben.

        Set-ExecutionPolicy Undefined
        

        A eingeben und mit Enter bestätigen.

        cd..
        
        Remove-item $env:TEMP\token
        

        A eingeben und mit Enter bestätigen.

        Viel Spass

        meuteM Online
        meuteM Online
        meute
        schrieb am zuletzt editiert von
        #2251

        @fichte_112 sagte in Adapter Hyundai (Bluelink) oder KIA (UVO):

        Anleitung zur Erstellung eines Tokens für Hyundai mit Windows

        :+1:

        Es wäre gut, wenn so eine Top-Anleitung nicht hier im Thread-Nirvana vergammelt, sondern ins Wiki kommt.
        Da gehört sowas hin.

        Ist das hier das richtige Wiki?
        https://github.com/Newan/ioBroker.bluelink/wiki

        fraenk for friends Code: MATF103

        F 1 Antwort Letzte Antwort
        0
        • F fichte_112

          Anleitung zur Erstellung eines Tokens für Hyundai oder KIA mit Windows

          Python Releases for Windows installieren.
          Google Chrome installieren

          In der Konsole folgenden Befehl ausführen. (oder den Adapter Bluelink löschen)

          rm -r /opt/iobroker/node_modules/bluelinky/
          

          Im Iobroker den Reiter Adapter anklicken. Dan den Expertenmodus aktivieren und die Katze anklicken.
          Screenshot 2025-10-22 114413.png

          Screenshot 2025-10-22 150641.png

          Den Reiter Benutzerdefiniert auswählen und folgendes eintragen und installieren.

          https://github.com/Newan/ioBroker.bluelink.git
          

          Jetzt Windows PowerShell mit administrativen Rechten starten.

          Jetzt folgende Befehle nacheinander ausführen.

          Set-ExecutionPolicy Unrestricted
          

          A eingeben und mit Enter bestätigen.

          mkdir $env:TEMP\token 2>$null; cd $env:TEMP\token
          
          $code = @"
          # Original authors:
          # Kia: fuatakgun (https://gist.githubusercontent.com/fuatakgun/fa4ef1e1d48b8dca2d22133d4d028dc9#gistfile1.txt)
          # Hyundai: Maaxion (https://gist.github.com/Maaxion/22a38ba8fb06937da18482ddf35171ac#file-gistfile1-txt)
          #
          import argparse
          import re
          from selenium import webdriver
          from selenium.webdriver.common.by import By
          from selenium.webdriver.support.ui import WebDriverWait
          from selenium.webdriver.support import expected_conditions as EC
          from selenium.common.exceptions import TimeoutException
          import requests
          
          import time
          
          def main():
              """
              Determine brand to get the refresh token for
              """
              parser = argparse.ArgumentParser()
              parser.add_argument("--brand", help="Brand of vehicle (Hyundai/Kia)", type=str.lower, required=True, choices=['hyundai','kia'])
              args = parser.parse_args()
          
              """
              Populate global variables
              """
              BASE_URL = f"https://idpconnect-eu.{args.brand}.com/auth/api/v2/user/oauth2/"
              TOKEN_URL = f"{BASE_URL}token"
          
              if args.brand == 'kia':
                  # Kia specific variables here
                  CLIENT_ID = "fdc85c00-0a2f-4c64-bcb4-2cfb1500730a"
                  CLIENT_SECRET = "secret"
                  REDIRECT_URL_FINAL = "https://prd.eu-ccapi.kia.com:8080/api/v1/user/oauth2/redirect"
                  SUCCESS_ELEMENT_SELECTOR = "a[class='logout user']" 
                  LOGIN_URL = f"{BASE_URL}authorize?ui_locales=de&scope=openid%20profile%20email%20phone&response_type=code&client_id=peukiaidm-online-sales&redirect_uri=https://www.kia.com/api/bin/oneid/login&state=aHR0cHM6Ly93d3cua2lhLmNvbTo0NDMvZGUvP21zb2NraWQ9MjM1NDU0ODBmNmUyNjg5NDIwMmU0MDBjZjc2OTY5NWQmX3RtPTE3NTYzMTg3MjY1OTImX3RtPTE3NTYzMjQyMTcxMjY=_default" 
              elif args.brand == 'hyundai':
                  # Hyundai specific variables
                  CLIENT_ID = "6d477c38-3ca4-4cf3-9557-2a1929a94654"
                  CLIENT_SECRET = "KUy49XxPzLpLuoK0xhBC77W6VXhmtQR9iQhmIFjjoY4IpxsV"
                  REDIRECT_URL_FINAL = "https://prd.eu-ccapi.hyundai.com:8080/api/v1/user/oauth2/token"
                  SUCCESS_ELEMENT_SELECTOR = "button.mail_check" 
                  LOGIN_URL = f"{BASE_URL}authorize?client_id=peuhyundaiidm-ctb&redirect_uri=https%3A%2F%2Fctbapi.hyundai-europe.com%2Fapi%2Fauth&nonce=&state=NL_&scope=openid+profile+email+phone&response_type=code&connector_client_id=peuhyundaiidm-ctb&connector_scope=&connector_session_key=&country=&captcha=1&ui_locales=en-US" 
          
              REDIRECT_URL = f"{BASE_URL}authorize?response_type=code&client_id={CLIENT_ID}&redirect_uri={REDIRECT_URL_FINAL}&lang=de&state=ccsp"
          
              """
              Main function to run the Selenium automation.
              """
              # Initialize the Chrome WebDriver
              # Make sure you have chromedriver installed and in your PATH,
              # or specify the path to it.
              options = webdriver.ChromeOptions()
              options.add_argument("user-agent=Mozilla/5.0 (Linux; Android 4.1.1; Galaxy Nexus Build/JRO03C) AppleWebKit/535.19 (KHTML, like Gecko) Chrome/18.0.1025.166 Mobile Safari/535.19_CCS_APP_AOS")
              options.add_argument("--auto-open-devtools-for-tabs")
              driver = webdriver.Chrome(options=options)
              driver.maximize_window()
          
              # 1. Open the login page
              print(f"Opening login page: {LOGIN_URL}")
              driver.get(LOGIN_URL)
          
              print("\n" + "="*50)
              print("Please log in manually in the browser window.")
              print("The script will wait for you to complete the login...")
              print("="*50 + "\n")
          
              try:
                  wait = WebDriverWait(driver, 300) # 300-second timeout
                  if args.brand == "kia":
                      wait.until(EC.presence_of_element_located((By.CSS_SELECTOR, SUCCESS_ELEMENT_SELECTOR)))
                  else:
                      wait.until(EC.any_of(
                          EC.presence_of_element_located((By.CSS_SELECTOR, SUCCESS_ELEMENT_SELECTOR)),
                          EC.presence_of_element_located((By.CSS_SELECTOR, "button.ctb_button"))
                          )
                      )
                      
                  print("✅ Login successful! Element found.")
                  print(f"Redirecting to: {REDIRECT_URL}")
                  driver.get(REDIRECT_URL)
                  wait = WebDriverWait(driver, 15) # 15-second timeout
                  
                  current_url = ""
          
                  tries_left = 10
                  redir_found = False
                  
                  while (tries_left > 0):
                      current_url = driver.current_url
                      print(f" - [{11 - tries_left}] Waiting for redirect URLwith code")
                      if args.brand == "kia":
                          if re.match(r'^https://.*:8080/api/v1/user/oauth2/redirect', current_url):
                              redir_found = True
                              break
                      elif args.brand == "hyundai":
                          if re.match(r'^https://.*:8080/api/v1/user/oauth2/token', current_url):
                              redir_found = True
                              break
                      tries_left -= 1
                      time.sleep(1)
                  
                  if redir_found == False:
                      print(f"\n❌ Failed to get redirected to correct URL, got {current_url} instead")
                      
                  code = re.search(
                          r'code=([0-9a-fA-F-]{36}\.[0-9a-fA-F-]{36}\.[0-9a-fA-F-]{36})',
                          current_url
                      ).group(1)
                  data = {
                      "grant_type": "authorization_code",
                      "code": code,
                      "redirect_uri": REDIRECT_URL_FINAL,
                      "client_id": CLIENT_ID,
                      "client_secret": CLIENT_SECRET,
                  }
                  session = requests.Session()
                  response = session.post(TOKEN_URL, data=data)
                  if response.status_code == 200:
                      tokens = response.json()
                      if tokens is not None:
                          refresh_token = tokens["refresh_token"]
                          access_token = tokens["access_token"]
                          print(f"\n✅ Your tokens are:\n\n- Refresh Token: {refresh_token}\n- Access Token: {access_token}")
                  else:
                      print(f"\n❌ Error getting tokens from der API!\n{response.text}")
          
              except TimeoutException:
                  print("❌ Timed out after 5 minutes. Login was not completed or the success element was not found.")
              except Exception as e:
                  print(f"An unexpected error occurred: {e}")
                  time.sleep(3600)
              finally:
                  print("Cleaning up and closing the browser.")
                  driver.quit()        
          
          if __name__ == "__main__":
              main()
          "@
          $code | Out-File -FilePath "$env:TEMP\token\ApiToken.py" -Encoding UTF8
           
          
          
          py -m venv .venv
          
          .\.venv\Scripts\Activate.ps1
          
          pip install --upgrade pip
          
          pip install selenium requests webdriver-manager
          
          py -m pip install --upgrade pip selenium requests
          

          Achtung jetzt nur den Befehl für Hyundai oder KIA verwenden!!!

          für Hyundai

          cls
          
          py .\ApiToken.py --brand hyundai
          

          für KIA

          cls
          
          py .\ApiToken.py --brand kia
          

          Hier geht es für beide weiter.

          Jetzt sollte sich Chrome öffnen. Dort mit den Benutzerdaten einloggen.
          Nun sollte im Fenster von PowerShell ein Refresh Token und ein Access Token erscheinen.
          Diese mit der Maus markieren und mit Strg-C kopieren und in eine leere Textdatei mit Strg-V einfügen.
          Der Refresh Token ist das Passwort für den Bluelink Adapter

          Als letztes kann nun noch die Ausführungsrichtlinien (Unrestricted) für PowerShell-Scripts entfernt und der temporäre Ordner gelöscht werden. Dazu in der Powershell die folgenden Befehle eingeben.

          Set-ExecutionPolicy Undefined
          

          A eingeben und mit Enter bestätigen.

          cd..
          
          Remove-item $env:TEMP\token
          

          A eingeben und mit Enter bestätigen.

          Viel Spass

          S Offline
          S Offline
          sansibar
          schrieb am zuletzt editiert von
          #2252

          @fichte_112 said in Adapter Hyundai (Bluelink) oder KIA (UVO):

          Anleitung zur Erstellung eines Tokens für Hyundai oder KIA mit Windows
          Vielen Dank für die super-Anleitung!

          Hatte vor einigen Wochen schon mal einen refresh Token erstellt und eingetragen, damals lief alles. Zumindest so lange, bis mein Raspberry Pi wegen dem automatischen Backup-Lauf die iobroker-Instanz für einige Stunden gestoppt hat, danach ging es wieder nicht mehr.
          Dann war es mir ein paar Tage egal und nun versuche ich es seit zwei Tagen wieder eine Verbindung hinzubekommen. Der Adapter geht auch auf grün, aber im Log erscheint bei jedem Datenabruf der folgende Fehler:

          bluelink.0
          	2025-10-22 16:24:54.358	error	@EuropeController.pin: [400] Bad Request on [PUT] https://prd.eu-ccapi.kia.com:8080/api/v1/user/pin - {"errId":"76563607-152a-479a-8b8a-5cc0420be32b","errCode":"4003","errMsg":"Invalid values","errBody":{"remainCount":0,"remainTime":157}}
          bluelink.0
          	2025-10-22 16:24:54.357	error	Error on API-Request Status, ErrorCount:1
          

          Habe es jetzt einige male versucht, jedes mal ein neues Token bekommen, mal mit und ohne Pin (Fin) versucht usw., aber es will einfach nicht.

          Jemand eine Idee?

          F 1 Antwort Letzte Antwort
          0
          • S sansibar

            @fichte_112 said in Adapter Hyundai (Bluelink) oder KIA (UVO):

            Anleitung zur Erstellung eines Tokens für Hyundai oder KIA mit Windows
            Vielen Dank für die super-Anleitung!

            Hatte vor einigen Wochen schon mal einen refresh Token erstellt und eingetragen, damals lief alles. Zumindest so lange, bis mein Raspberry Pi wegen dem automatischen Backup-Lauf die iobroker-Instanz für einige Stunden gestoppt hat, danach ging es wieder nicht mehr.
            Dann war es mir ein paar Tage egal und nun versuche ich es seit zwei Tagen wieder eine Verbindung hinzubekommen. Der Adapter geht auch auf grün, aber im Log erscheint bei jedem Datenabruf der folgende Fehler:

            bluelink.0
            	2025-10-22 16:24:54.358	error	@EuropeController.pin: [400] Bad Request on [PUT] https://prd.eu-ccapi.kia.com:8080/api/v1/user/pin - {"errId":"76563607-152a-479a-8b8a-5cc0420be32b","errCode":"4003","errMsg":"Invalid values","errBody":{"remainCount":0,"remainTime":157}}
            bluelink.0
            	2025-10-22 16:24:54.357	error	Error on API-Request Status, ErrorCount:1
            

            Habe es jetzt einige male versucht, jedes mal ein neues Token bekommen, mal mit und ohne Pin (Fin) versucht usw., aber es will einfach nicht.

            Jemand eine Idee?

            F Offline
            F Offline
            fichte_112
            schrieb am zuletzt editiert von
            #2253

            @sansibar die Pin ist nicht die Fin sondern eine Pin, welche in der App von KIA oder Hyundai erstellt werden muss

            S 1 Antwort Letzte Antwort
            1
            • F fichte_112

              @sansibar die Pin ist nicht die Fin sondern eine Pin, welche in der App von KIA oder Hyundai erstellt werden muss

              S Offline
              S Offline
              sansibar
              schrieb am zuletzt editiert von
              #2254

              @fichte_112 said in Adapter Hyundai (Bluelink) oder KIA (UVO):

              @sansibar die Pin ist nicht die Fin sondern eine Pin, welche in der App von KIA oder Hyundai erstellt werden muss

              DANKE!
              Was für ein Facepalm-Moment! :face_with_rolling_eyes:
              Jetzt läuft's!

              1 Antwort Letzte Antwort
              0
              • meuteM meute

                @fichte_112 sagte in Adapter Hyundai (Bluelink) oder KIA (UVO):

                Anleitung zur Erstellung eines Tokens für Hyundai mit Windows

                :+1:

                Es wäre gut, wenn so eine Top-Anleitung nicht hier im Thread-Nirvana vergammelt, sondern ins Wiki kommt.
                Da gehört sowas hin.

                Ist das hier das richtige Wiki?
                https://github.com/Newan/ioBroker.bluelink/wiki

                F Offline
                F Offline
                fichte_112
                schrieb am zuletzt editiert von
                #2255

                @meute sagte in Adapter Hyundai (Bluelink) oder KIA (UVO):

                @fichte_112 sagte in Adapter Hyundai (Bluelink) oder KIA (UVO):

                Anleitung zur Erstellung eines Tokens für Hyundai mit Windows

                :+1:

                Es wäre gut, wenn so eine Top-Anleitung nicht hier im Thread-Nirvana vergammelt, sondern ins Wiki kommt.
                Da gehört sowas hin.

                Ist das hier das richtige Wiki?
                https://github.com/Newan/ioBroker.bluelink/wiki

                Es ist aber nicht meine github Seite.

                meuteM 1 Antwort Letzte Antwort
                0
                • F fichte_112

                  @meute sagte in Adapter Hyundai (Bluelink) oder KIA (UVO):

                  @fichte_112 sagte in Adapter Hyundai (Bluelink) oder KIA (UVO):

                  Anleitung zur Erstellung eines Tokens für Hyundai mit Windows

                  :+1:

                  Es wäre gut, wenn so eine Top-Anleitung nicht hier im Thread-Nirvana vergammelt, sondern ins Wiki kommt.
                  Da gehört sowas hin.

                  Ist das hier das richtige Wiki?
                  https://github.com/Newan/ioBroker.bluelink/wiki

                  Es ist aber nicht meine github Seite.

                  meuteM Online
                  meuteM Online
                  meute
                  schrieb am zuletzt editiert von
                  #2256

                  @fichte_112 sagte in Adapter Hyundai (Bluelink) oder KIA (UVO):

                  @meute sagte in Adapter Hyundai (Bluelink) oder KIA (UVO):

                  @fichte_112 sagte in Adapter Hyundai (Bluelink) oder KIA (UVO):

                  Anleitung zur Erstellung eines Tokens für Hyundai mit Windows

                  :+1:

                  Es wäre gut, wenn so eine Top-Anleitung nicht hier im Thread-Nirvana vergammelt, sondern ins Wiki kommt.
                  Da gehört sowas hin.

                  Ist das hier das richtige Wiki?
                  https://github.com/Newan/ioBroker.bluelink/wiki

                  Es ist aber nicht meine github Seite.

                  Schon klar, dass das nicht Deine Seite ist.
                  Hier wird aber der Adapter entwickelt.

                  Vll. kann das @arteck hinzufügen.
                  Oder noch besser, die Seite wird als Markdown erstellt, z.B. in Notepad++ mit MD-Viewer und muss dann nur noch von @arteck ins Wiki kopiert werden.

                  fraenk for friends Code: MATF103

                  meuteM 1 Antwort Letzte Antwort
                  0
                  • F fichte_112

                    Anleitung zur Erstellung eines Tokens für Hyundai oder KIA mit Windows

                    Python Releases for Windows installieren.
                    Google Chrome installieren

                    In der Konsole folgenden Befehl ausführen. (oder den Adapter Bluelink löschen)

                    rm -r /opt/iobroker/node_modules/bluelinky/
                    

                    Im Iobroker den Reiter Adapter anklicken. Dan den Expertenmodus aktivieren und die Katze anklicken.
                    Screenshot 2025-10-22 114413.png

                    Screenshot 2025-10-22 150641.png

                    Den Reiter Benutzerdefiniert auswählen und folgendes eintragen und installieren.

                    https://github.com/Newan/ioBroker.bluelink.git
                    

                    Jetzt Windows PowerShell mit administrativen Rechten starten.

                    Jetzt folgende Befehle nacheinander ausführen.

                    Set-ExecutionPolicy Unrestricted
                    

                    A eingeben und mit Enter bestätigen.

                    mkdir $env:TEMP\token 2>$null; cd $env:TEMP\token
                    
                    $code = @"
                    # Original authors:
                    # Kia: fuatakgun (https://gist.githubusercontent.com/fuatakgun/fa4ef1e1d48b8dca2d22133d4d028dc9#gistfile1.txt)
                    # Hyundai: Maaxion (https://gist.github.com/Maaxion/22a38ba8fb06937da18482ddf35171ac#file-gistfile1-txt)
                    #
                    import argparse
                    import re
                    from selenium import webdriver
                    from selenium.webdriver.common.by import By
                    from selenium.webdriver.support.ui import WebDriverWait
                    from selenium.webdriver.support import expected_conditions as EC
                    from selenium.common.exceptions import TimeoutException
                    import requests
                    
                    import time
                    
                    def main():
                        """
                        Determine brand to get the refresh token for
                        """
                        parser = argparse.ArgumentParser()
                        parser.add_argument("--brand", help="Brand of vehicle (Hyundai/Kia)", type=str.lower, required=True, choices=['hyundai','kia'])
                        args = parser.parse_args()
                    
                        """
                        Populate global variables
                        """
                        BASE_URL = f"https://idpconnect-eu.{args.brand}.com/auth/api/v2/user/oauth2/"
                        TOKEN_URL = f"{BASE_URL}token"
                    
                        if args.brand == 'kia':
                            # Kia specific variables here
                            CLIENT_ID = "fdc85c00-0a2f-4c64-bcb4-2cfb1500730a"
                            CLIENT_SECRET = "secret"
                            REDIRECT_URL_FINAL = "https://prd.eu-ccapi.kia.com:8080/api/v1/user/oauth2/redirect"
                            SUCCESS_ELEMENT_SELECTOR = "a[class='logout user']" 
                            LOGIN_URL = f"{BASE_URL}authorize?ui_locales=de&scope=openid%20profile%20email%20phone&response_type=code&client_id=peukiaidm-online-sales&redirect_uri=https://www.kia.com/api/bin/oneid/login&state=aHR0cHM6Ly93d3cua2lhLmNvbTo0NDMvZGUvP21zb2NraWQ9MjM1NDU0ODBmNmUyNjg5NDIwMmU0MDBjZjc2OTY5NWQmX3RtPTE3NTYzMTg3MjY1OTImX3RtPTE3NTYzMjQyMTcxMjY=_default" 
                        elif args.brand == 'hyundai':
                            # Hyundai specific variables
                            CLIENT_ID = "6d477c38-3ca4-4cf3-9557-2a1929a94654"
                            CLIENT_SECRET = "KUy49XxPzLpLuoK0xhBC77W6VXhmtQR9iQhmIFjjoY4IpxsV"
                            REDIRECT_URL_FINAL = "https://prd.eu-ccapi.hyundai.com:8080/api/v1/user/oauth2/token"
                            SUCCESS_ELEMENT_SELECTOR = "button.mail_check" 
                            LOGIN_URL = f"{BASE_URL}authorize?client_id=peuhyundaiidm-ctb&redirect_uri=https%3A%2F%2Fctbapi.hyundai-europe.com%2Fapi%2Fauth&nonce=&state=NL_&scope=openid+profile+email+phone&response_type=code&connector_client_id=peuhyundaiidm-ctb&connector_scope=&connector_session_key=&country=&captcha=1&ui_locales=en-US" 
                    
                        REDIRECT_URL = f"{BASE_URL}authorize?response_type=code&client_id={CLIENT_ID}&redirect_uri={REDIRECT_URL_FINAL}&lang=de&state=ccsp"
                    
                        """
                        Main function to run the Selenium automation.
                        """
                        # Initialize the Chrome WebDriver
                        # Make sure you have chromedriver installed and in your PATH,
                        # or specify the path to it.
                        options = webdriver.ChromeOptions()
                        options.add_argument("user-agent=Mozilla/5.0 (Linux; Android 4.1.1; Galaxy Nexus Build/JRO03C) AppleWebKit/535.19 (KHTML, like Gecko) Chrome/18.0.1025.166 Mobile Safari/535.19_CCS_APP_AOS")
                        options.add_argument("--auto-open-devtools-for-tabs")
                        driver = webdriver.Chrome(options=options)
                        driver.maximize_window()
                    
                        # 1. Open the login page
                        print(f"Opening login page: {LOGIN_URL}")
                        driver.get(LOGIN_URL)
                    
                        print("\n" + "="*50)
                        print("Please log in manually in the browser window.")
                        print("The script will wait for you to complete the login...")
                        print("="*50 + "\n")
                    
                        try:
                            wait = WebDriverWait(driver, 300) # 300-second timeout
                            if args.brand == "kia":
                                wait.until(EC.presence_of_element_located((By.CSS_SELECTOR, SUCCESS_ELEMENT_SELECTOR)))
                            else:
                                wait.until(EC.any_of(
                                    EC.presence_of_element_located((By.CSS_SELECTOR, SUCCESS_ELEMENT_SELECTOR)),
                                    EC.presence_of_element_located((By.CSS_SELECTOR, "button.ctb_button"))
                                    )
                                )
                                
                            print("✅ Login successful! Element found.")
                            print(f"Redirecting to: {REDIRECT_URL}")
                            driver.get(REDIRECT_URL)
                            wait = WebDriverWait(driver, 15) # 15-second timeout
                            
                            current_url = ""
                    
                            tries_left = 10
                            redir_found = False
                            
                            while (tries_left > 0):
                                current_url = driver.current_url
                                print(f" - [{11 - tries_left}] Waiting for redirect URLwith code")
                                if args.brand == "kia":
                                    if re.match(r'^https://.*:8080/api/v1/user/oauth2/redirect', current_url):
                                        redir_found = True
                                        break
                                elif args.brand == "hyundai":
                                    if re.match(r'^https://.*:8080/api/v1/user/oauth2/token', current_url):
                                        redir_found = True
                                        break
                                tries_left -= 1
                                time.sleep(1)
                            
                            if redir_found == False:
                                print(f"\n❌ Failed to get redirected to correct URL, got {current_url} instead")
                                
                            code = re.search(
                                    r'code=([0-9a-fA-F-]{36}\.[0-9a-fA-F-]{36}\.[0-9a-fA-F-]{36})',
                                    current_url
                                ).group(1)
                            data = {
                                "grant_type": "authorization_code",
                                "code": code,
                                "redirect_uri": REDIRECT_URL_FINAL,
                                "client_id": CLIENT_ID,
                                "client_secret": CLIENT_SECRET,
                            }
                            session = requests.Session()
                            response = session.post(TOKEN_URL, data=data)
                            if response.status_code == 200:
                                tokens = response.json()
                                if tokens is not None:
                                    refresh_token = tokens["refresh_token"]
                                    access_token = tokens["access_token"]
                                    print(f"\n✅ Your tokens are:\n\n- Refresh Token: {refresh_token}\n- Access Token: {access_token}")
                            else:
                                print(f"\n❌ Error getting tokens from der API!\n{response.text}")
                    
                        except TimeoutException:
                            print("❌ Timed out after 5 minutes. Login was not completed or the success element was not found.")
                        except Exception as e:
                            print(f"An unexpected error occurred: {e}")
                            time.sleep(3600)
                        finally:
                            print("Cleaning up and closing the browser.")
                            driver.quit()        
                    
                    if __name__ == "__main__":
                        main()
                    "@
                    $code | Out-File -FilePath "$env:TEMP\token\ApiToken.py" -Encoding UTF8
                     
                    
                    
                    py -m venv .venv
                    
                    .\.venv\Scripts\Activate.ps1
                    
                    pip install --upgrade pip
                    
                    pip install selenium requests webdriver-manager
                    
                    py -m pip install --upgrade pip selenium requests
                    

                    Achtung jetzt nur den Befehl für Hyundai oder KIA verwenden!!!

                    für Hyundai

                    cls
                    
                    py .\ApiToken.py --brand hyundai
                    

                    für KIA

                    cls
                    
                    py .\ApiToken.py --brand kia
                    

                    Hier geht es für beide weiter.

                    Jetzt sollte sich Chrome öffnen. Dort mit den Benutzerdaten einloggen.
                    Nun sollte im Fenster von PowerShell ein Refresh Token und ein Access Token erscheinen.
                    Diese mit der Maus markieren und mit Strg-C kopieren und in eine leere Textdatei mit Strg-V einfügen.
                    Der Refresh Token ist das Passwort für den Bluelink Adapter

                    Als letztes kann nun noch die Ausführungsrichtlinien (Unrestricted) für PowerShell-Scripts entfernt und der temporäre Ordner gelöscht werden. Dazu in der Powershell die folgenden Befehle eingeben.

                    Set-ExecutionPolicy Undefined
                    

                    A eingeben und mit Enter bestätigen.

                    cd..
                    
                    Remove-item $env:TEMP\token
                    

                    A eingeben und mit Enter bestätigen.

                    Viel Spass

                    C Offline
                    C Offline
                    Cumulus 0
                    schrieb am zuletzt editiert von
                    #2257

                    @fichte_112 Wow, das hat jetzt sofort geklappt. Vielen, vielen Dank!
                    Ich hatte Powershell installiert und das so abgearbeitet.
                    Alle Daten waren sofort wieder da! Ich hoffe das es so bleibt.

                    Vielen Dank auch an @pedder007 , der das System beschrieben hat, dass man es auch verstanden hat.

                    1 Antwort Letzte Antwort
                    1
                    • meuteM meute

                      @fichte_112 sagte in Adapter Hyundai (Bluelink) oder KIA (UVO):

                      @meute sagte in Adapter Hyundai (Bluelink) oder KIA (UVO):

                      @fichte_112 sagte in Adapter Hyundai (Bluelink) oder KIA (UVO):

                      Anleitung zur Erstellung eines Tokens für Hyundai mit Windows

                      :+1:

                      Es wäre gut, wenn so eine Top-Anleitung nicht hier im Thread-Nirvana vergammelt, sondern ins Wiki kommt.
                      Da gehört sowas hin.

                      Ist das hier das richtige Wiki?
                      https://github.com/Newan/ioBroker.bluelink/wiki

                      Es ist aber nicht meine github Seite.

                      Schon klar, dass das nicht Deine Seite ist.
                      Hier wird aber der Adapter entwickelt.

                      Vll. kann das @arteck hinzufügen.
                      Oder noch besser, die Seite wird als Markdown erstellt, z.B. in Notepad++ mit MD-Viewer und muss dann nur noch von @arteck ins Wiki kopiert werden.

                      meuteM Online
                      meuteM Online
                      meute
                      schrieb am zuletzt editiert von meute
                      #2258

                      @meute sagte in Adapter Hyundai (Bluelink) oder KIA (UVO):

                      Oder noch besser, die Seite wird als Markdown erstellt, z.B. in Notepad++ mit MD-Viewer und muss dann nur noch von @arteck ins Wiki kopiert werden.

                      Ich habe hier auf die Schnelle für's Wiki die Anleitung von @fichte_112 als MD erstellt.
                      Die beiden Screenshots fehlen aber noch.

                      ioBroker.bluelink_Wiki anpassen.md

                      fraenk for friends Code: MATF103

                      1 Antwort Letzte Antwort
                      0
                      • F fichte_112

                        Anleitung zur Erstellung eines Tokens für Hyundai oder KIA mit Windows

                        Python Releases for Windows installieren.
                        Google Chrome installieren

                        In der Konsole folgenden Befehl ausführen. (oder den Adapter Bluelink löschen)

                        rm -r /opt/iobroker/node_modules/bluelinky/
                        

                        Im Iobroker den Reiter Adapter anklicken. Dan den Expertenmodus aktivieren und die Katze anklicken.
                        Screenshot 2025-10-22 114413.png

                        Screenshot 2025-10-22 150641.png

                        Den Reiter Benutzerdefiniert auswählen und folgendes eintragen und installieren.

                        https://github.com/Newan/ioBroker.bluelink.git
                        

                        Jetzt Windows PowerShell mit administrativen Rechten starten.

                        Jetzt folgende Befehle nacheinander ausführen.

                        Set-ExecutionPolicy Unrestricted
                        

                        A eingeben und mit Enter bestätigen.

                        mkdir $env:TEMP\token 2>$null; cd $env:TEMP\token
                        
                        $code = @"
                        # Original authors:
                        # Kia: fuatakgun (https://gist.githubusercontent.com/fuatakgun/fa4ef1e1d48b8dca2d22133d4d028dc9#gistfile1.txt)
                        # Hyundai: Maaxion (https://gist.github.com/Maaxion/22a38ba8fb06937da18482ddf35171ac#file-gistfile1-txt)
                        #
                        import argparse
                        import re
                        from selenium import webdriver
                        from selenium.webdriver.common.by import By
                        from selenium.webdriver.support.ui import WebDriverWait
                        from selenium.webdriver.support import expected_conditions as EC
                        from selenium.common.exceptions import TimeoutException
                        import requests
                        
                        import time
                        
                        def main():
                            """
                            Determine brand to get the refresh token for
                            """
                            parser = argparse.ArgumentParser()
                            parser.add_argument("--brand", help="Brand of vehicle (Hyundai/Kia)", type=str.lower, required=True, choices=['hyundai','kia'])
                            args = parser.parse_args()
                        
                            """
                            Populate global variables
                            """
                            BASE_URL = f"https://idpconnect-eu.{args.brand}.com/auth/api/v2/user/oauth2/"
                            TOKEN_URL = f"{BASE_URL}token"
                        
                            if args.brand == 'kia':
                                # Kia specific variables here
                                CLIENT_ID = "fdc85c00-0a2f-4c64-bcb4-2cfb1500730a"
                                CLIENT_SECRET = "secret"
                                REDIRECT_URL_FINAL = "https://prd.eu-ccapi.kia.com:8080/api/v1/user/oauth2/redirect"
                                SUCCESS_ELEMENT_SELECTOR = "a[class='logout user']" 
                                LOGIN_URL = f"{BASE_URL}authorize?ui_locales=de&scope=openid%20profile%20email%20phone&response_type=code&client_id=peukiaidm-online-sales&redirect_uri=https://www.kia.com/api/bin/oneid/login&state=aHR0cHM6Ly93d3cua2lhLmNvbTo0NDMvZGUvP21zb2NraWQ9MjM1NDU0ODBmNmUyNjg5NDIwMmU0MDBjZjc2OTY5NWQmX3RtPTE3NTYzMTg3MjY1OTImX3RtPTE3NTYzMjQyMTcxMjY=_default" 
                            elif args.brand == 'hyundai':
                                # Hyundai specific variables
                                CLIENT_ID = "6d477c38-3ca4-4cf3-9557-2a1929a94654"
                                CLIENT_SECRET = "KUy49XxPzLpLuoK0xhBC77W6VXhmtQR9iQhmIFjjoY4IpxsV"
                                REDIRECT_URL_FINAL = "https://prd.eu-ccapi.hyundai.com:8080/api/v1/user/oauth2/token"
                                SUCCESS_ELEMENT_SELECTOR = "button.mail_check" 
                                LOGIN_URL = f"{BASE_URL}authorize?client_id=peuhyundaiidm-ctb&redirect_uri=https%3A%2F%2Fctbapi.hyundai-europe.com%2Fapi%2Fauth&nonce=&state=NL_&scope=openid+profile+email+phone&response_type=code&connector_client_id=peuhyundaiidm-ctb&connector_scope=&connector_session_key=&country=&captcha=1&ui_locales=en-US" 
                        
                            REDIRECT_URL = f"{BASE_URL}authorize?response_type=code&client_id={CLIENT_ID}&redirect_uri={REDIRECT_URL_FINAL}&lang=de&state=ccsp"
                        
                            """
                            Main function to run the Selenium automation.
                            """
                            # Initialize the Chrome WebDriver
                            # Make sure you have chromedriver installed and in your PATH,
                            # or specify the path to it.
                            options = webdriver.ChromeOptions()
                            options.add_argument("user-agent=Mozilla/5.0 (Linux; Android 4.1.1; Galaxy Nexus Build/JRO03C) AppleWebKit/535.19 (KHTML, like Gecko) Chrome/18.0.1025.166 Mobile Safari/535.19_CCS_APP_AOS")
                            options.add_argument("--auto-open-devtools-for-tabs")
                            driver = webdriver.Chrome(options=options)
                            driver.maximize_window()
                        
                            # 1. Open the login page
                            print(f"Opening login page: {LOGIN_URL}")
                            driver.get(LOGIN_URL)
                        
                            print("\n" + "="*50)
                            print("Please log in manually in the browser window.")
                            print("The script will wait for you to complete the login...")
                            print("="*50 + "\n")
                        
                            try:
                                wait = WebDriverWait(driver, 300) # 300-second timeout
                                if args.brand == "kia":
                                    wait.until(EC.presence_of_element_located((By.CSS_SELECTOR, SUCCESS_ELEMENT_SELECTOR)))
                                else:
                                    wait.until(EC.any_of(
                                        EC.presence_of_element_located((By.CSS_SELECTOR, SUCCESS_ELEMENT_SELECTOR)),
                                        EC.presence_of_element_located((By.CSS_SELECTOR, "button.ctb_button"))
                                        )
                                    )
                                    
                                print("✅ Login successful! Element found.")
                                print(f"Redirecting to: {REDIRECT_URL}")
                                driver.get(REDIRECT_URL)
                                wait = WebDriverWait(driver, 15) # 15-second timeout
                                
                                current_url = ""
                        
                                tries_left = 10
                                redir_found = False
                                
                                while (tries_left > 0):
                                    current_url = driver.current_url
                                    print(f" - [{11 - tries_left}] Waiting for redirect URLwith code")
                                    if args.brand == "kia":
                                        if re.match(r'^https://.*:8080/api/v1/user/oauth2/redirect', current_url):
                                            redir_found = True
                                            break
                                    elif args.brand == "hyundai":
                                        if re.match(r'^https://.*:8080/api/v1/user/oauth2/token', current_url):
                                            redir_found = True
                                            break
                                    tries_left -= 1
                                    time.sleep(1)
                                
                                if redir_found == False:
                                    print(f"\n❌ Failed to get redirected to correct URL, got {current_url} instead")
                                    
                                code = re.search(
                                        r'code=([0-9a-fA-F-]{36}\.[0-9a-fA-F-]{36}\.[0-9a-fA-F-]{36})',
                                        current_url
                                    ).group(1)
                                data = {
                                    "grant_type": "authorization_code",
                                    "code": code,
                                    "redirect_uri": REDIRECT_URL_FINAL,
                                    "client_id": CLIENT_ID,
                                    "client_secret": CLIENT_SECRET,
                                }
                                session = requests.Session()
                                response = session.post(TOKEN_URL, data=data)
                                if response.status_code == 200:
                                    tokens = response.json()
                                    if tokens is not None:
                                        refresh_token = tokens["refresh_token"]
                                        access_token = tokens["access_token"]
                                        print(f"\n✅ Your tokens are:\n\n- Refresh Token: {refresh_token}\n- Access Token: {access_token}")
                                else:
                                    print(f"\n❌ Error getting tokens from der API!\n{response.text}")
                        
                            except TimeoutException:
                                print("❌ Timed out after 5 minutes. Login was not completed or the success element was not found.")
                            except Exception as e:
                                print(f"An unexpected error occurred: {e}")
                                time.sleep(3600)
                            finally:
                                print("Cleaning up and closing the browser.")
                                driver.quit()        
                        
                        if __name__ == "__main__":
                            main()
                        "@
                        $code | Out-File -FilePath "$env:TEMP\token\ApiToken.py" -Encoding UTF8
                         
                        
                        
                        py -m venv .venv
                        
                        .\.venv\Scripts\Activate.ps1
                        
                        pip install --upgrade pip
                        
                        pip install selenium requests webdriver-manager
                        
                        py -m pip install --upgrade pip selenium requests
                        

                        Achtung jetzt nur den Befehl für Hyundai oder KIA verwenden!!!

                        für Hyundai

                        cls
                        
                        py .\ApiToken.py --brand hyundai
                        

                        für KIA

                        cls
                        
                        py .\ApiToken.py --brand kia
                        

                        Hier geht es für beide weiter.

                        Jetzt sollte sich Chrome öffnen. Dort mit den Benutzerdaten einloggen.
                        Nun sollte im Fenster von PowerShell ein Refresh Token und ein Access Token erscheinen.
                        Diese mit der Maus markieren und mit Strg-C kopieren und in eine leere Textdatei mit Strg-V einfügen.
                        Der Refresh Token ist das Passwort für den Bluelink Adapter

                        Als letztes kann nun noch die Ausführungsrichtlinien (Unrestricted) für PowerShell-Scripts entfernt und der temporäre Ordner gelöscht werden. Dazu in der Powershell die folgenden Befehle eingeben.

                        Set-ExecutionPolicy Undefined
                        

                        A eingeben und mit Enter bestätigen.

                        cd..
                        
                        Remove-item $env:TEMP\token
                        

                        A eingeben und mit Enter bestätigen.

                        Viel Spass

                        arteckA Offline
                        arteckA Offline
                        arteck
                        Developer Most Active
                        schrieb am zuletzt editiert von arteck
                        #2259

                        @fichte_112 sagte in Adapter Hyundai (Bluelink) oder KIA (UVO):

                        iwr -UseBasicParsing -OutFile ApiToken.py `https://gist.githubusercontent.com/fuatakgun/fa4ef1e1d48b8dca2d22133d4d028dc9/raw/fe95ed7c02913f6277878a100458be78b794603d/gistfile1.txt

                        ich würde ungerne auf fremde scripte verweisen.. du hast nie dei kontrolle und wenn da einer mist einträngt....
                        änderer den mal bite auf unseres internes file

                        KiaFetchApiToken_2.py

                        ich habs mal in readme verlinkt
                        fb968bdc-792c-4ee6-9cca-078ecec6201e-grafik.png

                        zigbee hab ich, zwave auch, nuc's genauso und HA auch

                        F 1 Antwort Letzte Antwort
                        0
                        • arteckA arteck

                          @fichte_112 sagte in Adapter Hyundai (Bluelink) oder KIA (UVO):

                          iwr -UseBasicParsing -OutFile ApiToken.py `https://gist.githubusercontent.com/fuatakgun/fa4ef1e1d48b8dca2d22133d4d028dc9/raw/fe95ed7c02913f6277878a100458be78b794603d/gistfile1.txt

                          ich würde ungerne auf fremde scripte verweisen.. du hast nie dei kontrolle und wenn da einer mist einträngt....
                          änderer den mal bite auf unseres internes file

                          KiaFetchApiToken_2.py

                          ich habs mal in readme verlinkt
                          fb968bdc-792c-4ee6-9cca-078ecec6201e-grafik.png

                          F Offline
                          F Offline
                          fichte_112
                          schrieb am zuletzt editiert von fichte_112
                          #2260

                          @arteck ich habe es angepasst.

                          Meister MopperM 1 Antwort Letzte Antwort
                          1
                          • F fichte_112

                            @arteck ich habe es angepasst.

                            Meister MopperM Offline
                            Meister MopperM Offline
                            Meister Mopper
                            schrieb am zuletzt editiert von
                            #2261

                            Funktioniert denn bei euch der Login aktuell noch?

                            Ich hatte ja die neue Variante bereits in Funktion gebracht. Seit zwei Tagen wird aber der Login verweigert.

                            Das könnte natürlich auch mal wieder an den Servern von Kia liegen. Deswegen bräuchte ich mal euer Feedback, ob die Server erreichbar sind und ich ggf. nochmal das neue Prozedere durchführe.

                            bluelink.0	2025-10-23 17:26:16.103	error	next auto login attempt in 1 hour or restart adapter manual
                            bluelink.0	2025-10-23 17:26:16.103	error	Server is not available or login credentials are wrong
                            bluelink.0	2025-10-23 17:26:16.102	error	ManagedBluelinkyError: @EuropeController.login: [401] Unauthorized on [POST] https://prd.eu-ccapi.kia.com:8080/api/v1/user/signin - {"errId":"b8d86602-,"errCode":"4010","errMsg":"Require authentication"}
                            

                            Proxmox und HA

                            F ilovegymI arteckA 3 Antworten Letzte Antwort
                            0
                            • Meister MopperM Meister Mopper

                              Funktioniert denn bei euch der Login aktuell noch?

                              Ich hatte ja die neue Variante bereits in Funktion gebracht. Seit zwei Tagen wird aber der Login verweigert.

                              Das könnte natürlich auch mal wieder an den Servern von Kia liegen. Deswegen bräuchte ich mal euer Feedback, ob die Server erreichbar sind und ich ggf. nochmal das neue Prozedere durchführe.

                              bluelink.0	2025-10-23 17:26:16.103	error	next auto login attempt in 1 hour or restart adapter manual
                              bluelink.0	2025-10-23 17:26:16.103	error	Server is not available or login credentials are wrong
                              bluelink.0	2025-10-23 17:26:16.102	error	ManagedBluelinkyError: @EuropeController.login: [401] Unauthorized on [POST] https://prd.eu-ccapi.kia.com:8080/api/v1/user/signin - {"errId":"b8d86602-,"errCode":"4010","errMsg":"Require authentication"}
                              
                              F Offline
                              F Offline
                              fichte_112
                              schrieb am zuletzt editiert von
                              #2262

                              @meister-mopper bei mir funktioniert es

                              1 Antwort Letzte Antwort
                              0
                              • F fichte_112

                                @branka

                                such mal in den Ordner vehicleStatusRaw

                                bei mir

                                Hochvoltbatterie
                                vehicleStatusRaw.Green.BatteryManagement.BatteryRemain.Ratio

                                12-Volt Batterie
                                vehicleStatusRaw.Electronics.Battery.Level

                                B Offline
                                B Offline
                                branka
                                schrieb am zuletzt editiert von
                                #2263

                                @fichte_112 perfekt danke. hat funktioniert

                                1 Antwort Letzte Antwort
                                0
                                • Meister MopperM Meister Mopper

                                  Funktioniert denn bei euch der Login aktuell noch?

                                  Ich hatte ja die neue Variante bereits in Funktion gebracht. Seit zwei Tagen wird aber der Login verweigert.

                                  Das könnte natürlich auch mal wieder an den Servern von Kia liegen. Deswegen bräuchte ich mal euer Feedback, ob die Server erreichbar sind und ich ggf. nochmal das neue Prozedere durchführe.

                                  bluelink.0	2025-10-23 17:26:16.103	error	next auto login attempt in 1 hour or restart adapter manual
                                  bluelink.0	2025-10-23 17:26:16.103	error	Server is not available or login credentials are wrong
                                  bluelink.0	2025-10-23 17:26:16.102	error	ManagedBluelinkyError: @EuropeController.login: [401] Unauthorized on [POST] https://prd.eu-ccapi.kia.com:8080/api/v1/user/signin - {"errId":"b8d86602-,"errCode":"4010","errMsg":"Require authentication"}
                                  
                                  ilovegymI Offline
                                  ilovegymI Offline
                                  ilovegym
                                  schrieb am zuletzt editiert von
                                  #2264

                                  @meister-mopper

                                  Kia, richtig?
                                  Der Fehlermeldung nach ist der Token abgelaufen, mach dir n neuen.. mit dem Script..

                                  ilovegym66 – ioBroker Projekte & Automationen
                                  GitHub: https://github.com/Ilovegym66 | Austausch im Discord: https://discord.gg/yC65zjr5uq

                                  1 Antwort Letzte Antwort
                                  0
                                  • Meister MopperM Offline
                                    Meister MopperM Offline
                                    Meister Mopper
                                    schrieb am zuletzt editiert von
                                    #2265

                                    @ilovegym sagte in Adapter Hyundai (Bluelink) oder KIA (UVO):

                                    @meister-mopper

                                    Kia, richtig?
                                    Der Fehlermeldung nach ist der Token abgelaufen, mach dir n neuen.. mit dem Script..

                                    Ich habe einen neuen Refresh Token erstellt (zweimal) und als Passwort eingetragen.

                                    ==================================================
                                    Please log in manually in the browser window.
                                    The script will wait for you to complete the login...
                                    ==================================================
                                    
                                    ? Login successful! Element found.
                                    
                                    ? Your tokens are:
                                    
                                    - Refresh Token: MWI2MZBHNJKTN2I3OS01ZDI3LWJMZTXXXXXXXXXXXXXXXXXXXX
                                    - Access Token: eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.XXXXXXXXXXXXXXXXXXXXXXXMTk0MzZlYzQiLCJ1aWQiOiJlMjExZGJkNC00ZmUxLTQzZWUtOTBhOS03N2RhNzc5OTExODYiLCJzaWQiOiJmZGM4NWMwMC0wYTJmLTRjNjQtYmNiNC0yY2ZiMTUwMDczMGEiLCJleHAiOjE3NjEyOTA4OTQsImlhdCI6MTc2MTI4NzI5NCwiaXNzIjoidXZvIn0.POUuDEj4jxGpKuR9HAah9ghFtRgHb-5DR6hoHu-toqdFx__F-I7M9aShX0WIrGESJdnhxzqSPmJNFlwjGCDJWGT5GKagNH6kdheI7FeSxfUtGS4GmYLiCECK1Zqz3Uakr7DXPiFiraIWJU5yObkb6-XEi_2VfRhXgffOi0pGJWCKkr6eiW3Qi4RpCkoN4ibohBkf0T5QMm1tkNaLp9wT5LHREltt7lTd1QlNQSOSWxHwiU8qLPQq8DdqjAo0yxHgQssqIp8gDY7MaiIBKmKD3gLYv6wjuM_Y1RjCXROvi9eZCVW8dWMuT6ynRohS9bl2bbRbc6vI03LlWquXLCSnFw
                                    Cleaning up and closing the browser.
                                    

                                    Leider wird der Adapter nicht mehr grün.

                                    Proxmox und HA

                                    1 Antwort Letzte Antwort
                                    0
                                    • Meister MopperM Meister Mopper

                                      Funktioniert denn bei euch der Login aktuell noch?

                                      Ich hatte ja die neue Variante bereits in Funktion gebracht. Seit zwei Tagen wird aber der Login verweigert.

                                      Das könnte natürlich auch mal wieder an den Servern von Kia liegen. Deswegen bräuchte ich mal euer Feedback, ob die Server erreichbar sind und ich ggf. nochmal das neue Prozedere durchführe.

                                      bluelink.0	2025-10-23 17:26:16.103	error	next auto login attempt in 1 hour or restart adapter manual
                                      bluelink.0	2025-10-23 17:26:16.103	error	Server is not available or login credentials are wrong
                                      bluelink.0	2025-10-23 17:26:16.102	error	ManagedBluelinkyError: @EuropeController.login: [401] Unauthorized on [POST] https://prd.eu-ccapi.kia.com:8080/api/v1/user/signin - {"errId":"b8d86602-,"errCode":"4010","errMsg":"Require authentication"}
                                      
                                      arteckA Offline
                                      arteckA Offline
                                      arteck
                                      Developer Most Active
                                      schrieb am zuletzt editiert von arteck
                                      #2266

                                      @meister-mopper ja da gabs mal wieder ein Problem..stand aber auch in der App drin.. deshalb am beten immer gegenchecken wenn der Login in Adapter nicht geht, wobei hier auch aufpassen.. wenn der Adapter auf einen anderen Server umgeroutet wird als die App dann passt es dann auch nicht..aber als grobe Richtung..

                                      zigbee hab ich, zwave auch, nuc's genauso und HA auch

                                      Meister MopperM 1 Antwort Letzte Antwort
                                      0
                                      • M Offline
                                        M Offline
                                        Michaelnorge
                                        schrieb am zuletzt editiert von
                                        #2267

                                        Gibt es hierzu auch eine Anleitung für Linux-User?

                                        –--------------------------------------------------------------------------------------

                                        • Smart mit: Rasp 4B / ioBroker / Conbee2 / Trådfri / Xiaomi / HUE / Logitech Harmony / Aqara / Easee Wallbox / Hyundai Ioniq / Alexa / Google Home / Fully Kiosk / VIS
                                        F 1 Antwort Letzte Antwort
                                        0
                                        • M Michaelnorge

                                          Gibt es hierzu auch eine Anleitung für Linux-User?

                                          F Offline
                                          F Offline
                                          fichte_112
                                          schrieb am zuletzt editiert von
                                          #2268

                                          @michaelnorge gibt es

                                          hier

                                          1 Antwort Letzte Antwort
                                          0
                                          Antworten
                                          • In einem neuen Thema antworten
                                          Anmelden zum Antworten
                                          • Älteste zuerst
                                          • Neuste zuerst
                                          • Meiste Stimmen


                                          Support us

                                          ioBroker
                                          Community Adapters
                                          Donate

                                          456

                                          Online

                                          32.6k

                                          Benutzer

                                          82.0k

                                          Themen

                                          1.3m

                                          Beiträge
                                          Community
                                          Impressum | Datenschutz-Bestimmungen | Nutzungsbedingungen | Einwilligungseinstellungen
                                          ioBroker Community 2014-2025
                                          logo
                                          • Anmelden

                                          • Du hast noch kein Konto? Registrieren

                                          • Anmelden oder registrieren, um zu suchen
                                          • Erster Beitrag
                                            Letzter Beitrag
                                          0
                                          • Home
                                          • Aktuell
                                          • Tags
                                          • Ungelesen 0
                                          • Kategorien
                                          • Unreplied
                                          • Beliebt
                                          • GitHub
                                          • Docu
                                          • Hilfe