This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

Aseko Asin Aqua Home
#1
hello, 

I have this product to manage my pool https://www.asekopool.com/fr/asin-aqua-home-fr/ 
and I have retrieved this file but I don't know where to start to create a json to be able to integrate it on my LM.

Attached Files
.pdf   RS485 communication protocol - AA Home,Salt,Oxy.pdf (Size: 39.33 KB / Downloads: 8)
Reply
#2
Json profiles are for modbus integration where this seems like some custom RS485 protocol. Here is serial library:
https://kb.logicmachine.net/libraries/serial/
------------------------------
Ctrl+F5
Reply
#3
(02.07.2025, 11:05)Daniel Wrote: Json profiles are for modbus integration where this seems like some custom RS485 protocol. Here is serial library:
https://kb.logicmachine.net/libraries/serial/

Code:
do you think it will work like this ?

-- Charger la bibliothèque série
require('serial')

-- Ouvrir le port série RS-485
if not port then
    port = serial.open('/dev/RS485', {
        baudrate = 57600,
        parity = 'none',
        databits = 8,
        stopbits = 1,
        duplex = 'half'
    })
    port:flush()
end

-- Fonction pour convertir les octets en valeur numérique
local function to_decimal(high, low, factor)
    return (high * 256 + low) / factor
end

-- Port prêt pour la lecture
if port then
    -- Lire un paquet de données
    local data, err = port:read(27, 2)  -- Lire 27 octets

    if data then
        local bytes = {string.byte(data, 1, 27)}

        -- Extraction des données
        local ph_value = to_decimal(bytes[3], bytes[4], 100)
        local ph_required = bytes[17] / 10
        local cl_rx_value = to_decimal(bytes[5], bytes[6], 100)
        local cl_rx_required = bytes[18] / 10
        local temperature = to_decimal(bytes[9], bytes[10], 10)
        local error_1 = bytes[11]
        local error_2 = bytes[24]
        local unit_type = bytes[2]

        -- Écriture des valeurs sur le bus KNX
        grp.write('1/1/1', ph_value)
        grp.write('1/1/2', ph_required)
        grp.write('1/1/3', cl_rx_value)
        grp.write('1/1/4', cl_rx_required)
        grp.write('1/1/5', temperature)
        grp.write('1/1/6', error_1)
        grp.write('1/1/7', error_2)
        grp.write('1/1/8', unit_type)

        -- Journaux pour chaque information
        print(string.format("pH: %.2f, pH requis: %.1f", ph_value, ph_required))
        print(string.format("CL/RX: %.2f, CL/RX requis: %.1f", cl_rx_value, cl_rx_required))
        print(string.format("Température: %.1f °C", temperature))
        print(string.format("Erreur 1: %d, Erreur 2: %d", error_1, error_2))
        print(string.format("Type d'unité: %d", unit_type))
    else
        print("Erreur de lecture des données: " .. tostring(err))
    end

    -- Fermeture du port pour éviter de laisser la connexion ouverte
    port:flush()
    port:close()
end
Reply
#4
Do you use LM?
------------------------------
Ctrl+F5
Reply
#5
Don't close the port after the first read operation. You should also check the starting byte value and whether calculated CRC matches the last byte. Otherwise you might get incorrect data occasionally.
Reply


Forum Jump: