Navigation

    Logo
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unread
    • Categories
    • Unreplied
    • Popular
    • GitHub
    • Docu
    • Hilfe
    1. Home
    2. Deutsch
    3. Entwicklung
    4. [Adapteranfrage] - Helialux Smart Control

    NEWS

    • ioBroker@Smart Living Forum Solingen, 14.06. - Agenda added

    • ioBroker goes Matter ... Matter Adapter in Stable

    • Monatsrückblick - April 2025

    [Adapteranfrage] - Helialux Smart Control

    This topic has been deleted. Only users with topic management privileges can see it.
    • M
      moeff last edited by

      Hi,

      ich suche Hilfe bei der Entwicklung eines Adapters für das Helialux Smart Control.

      Es gibt bereits im Python eine geschriebene Libary welche die Möglichkeit bietet, per HTTP POST/GET das Gerät zu steuern. Aufgrund fehlender Erfahrung und Zeitmangel starte ich hier eine Anfrage.

      Links zum Thema:

      die Hardware: https://www.juwel-aquarium.de/Produkte/Beleuchtung/LED-Beleuchtung/HeliaLux/HeliaLux-SmartControl/

      pyHelialux- Funktionsumfang wie der Wunsch in einem Adapter mit den passenden Datenpunkten: https://github.com/moretea/pyHelialux

      ein erster Ansatz im Bereich homebridge leider ohne weitere Funktionen, nur Licht an aus gibt es bereits auch:
      https://github.com/denisw160/homebridge-hlsmartcontrol

      Suche Unterstützung und wäre über jede Hilfe dankbar.

      M 1 Reply Last reply Reply Quote 0
      • M
        moeff @moeff last edited by moeff

        so ich sammle hier mal selber alles zusammen, mal sehen ob ich daraus ein Adapter bauen kann irgendwann:

        Allgemeine Werte auslesen:

        GET - aktuelle Werte auslesen:

        kompletten Status auslesen:

        http://[IP]/statusvars.js
        
        lang=0;lamp='4Ch';profNum=0;profile='std_13-21_mond';tsimtime=678;tsimact=0;csimact=0;brightness=[0,0,0,0];times=[0,60,120,180,720,735,780,840,960,1020,1080,1200,1260,1305,1320,1439];CH1=[0,0,0,0,0,25,50,75,100,100,100,75,50,25,0,0];CH2=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5];CH3=[0,0,5,0,0,0,75,100,75,50,75,100,75,0,0,0];CH4=[0,0,0,0,0,50,100,100,75,100,75,100,100,50,0,0];
        

        Profilstatus auslesen, zuvor muss das abgefragte Profil per http://[IP]/profedit.html?profNum=[0-7] aufgerufen werden

        http://[IP]/profeditvars.js
        
        lang=0;lamp='4Ch';live=0;profNum=2;profile='Profile 3';times=[0,420,480,510,720,735,885,900,1170,1200,1290,1439];cM=[0,0,0,0,0,0,0,0,0,0,0,0];cI=[0,0,0,0,0,0,0,0,0,0,0,0];CH1=[0,0,30,100,100,30,30,100,100,30,0,0];CH2=[5,5,15,50,50,30,30,50,50,20,5,5];CH3=[0,0,60,100,100,30,30,100,100,50,0,0];CH4=[0,0,80,100,100,30,30,100,100,100,0,0];
        
        
        http://[IP]/wpvars.js
        
        lang=0;profiles=["std_13-21_mond","Profile 2","Profile 3","Profile 4","Profile 5","Profile 6","Profile 7","Profile 8"];profsel=[0,0,0,0,0,0,0];
        

        POST - Werte schreiben / senden

        Manuelle Steuerung aktivieren (5min):

        http://[IP]/stat?action=14&cswi=true&ctime=00:05
        

        Manuelle Steuerung beenden

        http://[IP]/stat?action=14&cswi=false
        

        nur bei laufender manuelle Steuerung möglich (Farben setzen | CH1 | CH2 | CH3 | CH4 - Beispiel alle 50%):

        http://[IP]/stat?action=10&ch1=50&ch2=50&ch3=50&ch4=50
        

        Profil Update (Beispiel Profil 8 mit folgenden Daten)

        action: 30
        PNAME: Profile 8
        TIMES: [0,420,480,510,720,735,885,900,1170,1200,1290,1290,1439]
        CH1: [0,0,30,100,100,30,30,100,100,30,0,0,0]
        CH2: [10,10,15,50,50,30,30,50,50,20,10,10,10]
        CH3: [0,0,60,100,100,30,30,100,100,50,0,0,0]
        CH4: [0,0,80,100,100,30,30,100,100,100,0,0,0]
        CINT: [0,0,0,0,0,0,0,0,0,0,0,0,0]
        CMOT: [0,0,0,0,0,0,0,0,0,0,0,0,0]

        http://[IP]/pedit?action=30&PNAME=Profile%208&TIMES=%5B0,420,480,510,720,735,885,900,1170,1200,1290,1290,1439%5D&CH1=%5B0,0,30,100,100,30,30,100,100,30,0,0,0%5D&CH2=%5B10,10,15,50,50,30,30,50,50,20,10,10,10%5D&CH3=%5B0,0,60,100,100,30,30,100,100,50,0,0,0%5D&CH4=%5B0,0,80,100,100,30,30,100,100,100,0,0,0%5D&CINT=%5B0,0,0,0,0,0,0,0,0,0,0,0,0%5D&CMOT=%5B0,0,0,0,0,0,0,0,0,0,0,0,0%5D
        
        S 1 Reply Last reply Reply Quote 0
        • S
          Sneaker75 @moeff last edited by

          @moeff

          Hallo, bist Du mit dem Adapter eigentlich weitergekommen bzw. hast damit angefangen? Ich würde mich dafür nämlich auch interessieren, kann aber zur Programmierung leider nicht viel beitragen.

          M 1 Reply Last reply Reply Quote 0
          • M
            moeff @Sneaker75 last edited by

            @sneaker75

            Hi, ich nutze derzeit das pyHelialux - welches ich per Alexa und Javascript starte. Nicht schön aber es ließe sich daraus sicher mehr bauen. Mir fehlen aber leider auch die Kenntnisse das Python sauber in einen iobroker Adapter zu gießen.

            Am Ende ist hier alles enthalten für die HTTP Kommunikation:

            """Pyton library to control (and get information from) Juwel's Helialux Smart Controller."""
            import requests
            import logging
            import re
            
            _LOGGER = logging.getLogger(__name__)
            
            STATUS_VARS_REGEX = re.compile(r"(?P<name>[a-zA-Z0-9]+)=((?P<number>\d+)|'(?P<string>[^']+)'|[(?P<digit_list>(\d+,?)+)]|[(?P<string_list>(\"([^\"]+)\",?)+)]);")
            
            def parse_status_vars(status_vars):
                """Extract the variables and their values from a minimal javascript file."""
                output = {}
                for match in STATUS_VARS_REGEX.finditer(status_vars):
                    if match['number'] is not None:
                        value = int(match['number'])
                    elif match['string'] is not None:
                        value = match['string']
                    elif match['digit_list'] is not None:
                        value = [int(x) for x in match['digit_list'].split(",")]
                    elif match['string_list'] is not None:
                        value = [x[1:-1] for x in match['string_list'].split(",")] # strip the quotes
                    else:
                        assert(False)
            
                    output[match['name']] = value
                return output
            
            def normalize_brightness(val):
                if val < 0:
                    return 0
                elif val > 100:
                    return 100
                else:
                    return val
            
            def nr_mins_to_formatted(duration):
                """Take a duration in minutes, and return an HH:MM formatted string."""
                hours = int(duration / 60)
                minutes = duration % 60
                return "%02d:%02d" % (hours, minutes)
            
            class Controller:
                """Base Representation of a HeliaLux SmartController"""
            
                def __init__(self, url):
                    self._url = url
            
                def _statusvars(self):
                    _LOGGER.debug("Fetching state from controller")
                    response = requests.get(self._url + "/statusvars.js")
                    return parse_status_vars(response.content.decode("utf-8"))
            
                def get_status(self):
                    """Fetch the current status from the controller."""
                    statusvars = self._statusvars()
                    return {
                        "currentProfile": statusvars["profile"],
                        "currentWhite": statusvars["brightness"][0],
                        "currentBlue": statusvars["brightness"][1],
                        "currentGreen": statusvars["brightness"][2],
                        "currentRed": statusvars["brightness"][3],
                        "manualColorSimulationEnabled": statusvars["csimact"] == 1,
                        "manualDaytimeSimulationEnabled": statusvars["tsimact"] == 1,
                        "deviceTime": nr_mins_to_formatted(statusvars["tsimtime"]),
                    }
            
                def start_manual_color_simulation(self, duration=60):
                    requests.post(self._url + "/stat",{"action": 14, "cswi": "true", "ctime": nr_mins_to_formatted(duration)})
            
                def set_manual_color(self, white,blue,green,red):
                    params = {"action": 10}
                    if white is not None:
                        params["ch1"] = normalize_brightness(white)
                    if blue is not None:
                        params["ch2"] = normalize_brightness(blue)
                    if green is not None:
                        params["ch3"] = normalize_brightness(green)
                    if red is not None:
                        params["ch4"] = normalize_brightness(red)
                    requests.post(self._url + "/stat", params)
            
                def stop_manual_color_simulation(self):
                    requests.post(self._url + "/stat", {"action": 14, "cswi": "false"})
                    requests.post(self._url + "/stat", {"action": 10})
            
            
            1 Reply Last reply Reply Quote 0
            • First post
              Last post

            Support us

            ioBroker
            Community Adapters
            Donate

            651
            Online

            31.7k
            Users

            79.8k
            Topics

            1.3m
            Posts

            2
            4
            914
            Loading More Posts
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes
            Reply
            • Reply as topic
            Log in to reply
            Community
            Impressum | Datenschutz-Bestimmungen | Nutzungsbedingungen
            The ioBroker Community 2014-2023
            logo