I managed to create working telnet switches with working states based on your discovery with the telnet commands @elkropac many thanks!!
I also installed an older Android Intex APK version 1.0.9 with which I could sniff the heating & On/Off commands.
Here below the 4 switches:
#Intex SPA switches
- platform: telnet
switches:
alimentation_spa:
resource: 192.168.1.29
port: 8990
command_on: '{"data":"8888060F01400098","sid":"1631357332538","type":1}'
command_off: '{"data":"8888060F01400098","sid":"1631357332538","type":1}'
command_state: '{"data":"8888060FEE0F01DA","sid":"1630705186378","type":1}'
value_template: '{{ value|regex_search("FFFF110F0101",ignorecase=True) or value|regex_search("FFFF110F0101",ignorecase=True) or value|regex_search("FFFF110F0103",ignorecase=True) or value|regex_search("FFFF110F0107",ignorecase=True) or value|regex_search("FFFF110F0111",ignorecase=True) or value|regex_search("FFFF110F0113",ignorecase=True) or value|regex_search("FFFF110F0117",ignorecase=True) }}'
timeout: 0.9
name: "Alimentation spa"
pompe_spa:
resource: 192.168.1.29
port: 8990
command_on: '{"data":"8888060F010004D4","sid":"1626776247245","type":1}'
command_off: '{"data":"8888060F010004D4","sid":"1626776247245","type":1}'
command_state: '{"data":"8888060FEE0F01DA","sid":"1630705186378","type":1}'
value_template: '{{ value|regex_search("FFFF110F0103",ignorecase=True) or value|regex_search("FFFF110F0113",ignorecase=True) or value|regex_search("FFFF110F0107",ignorecase=True) or value|regex_search("FFFF110F0117",ignorecase=True) }}'
timeout: 0.9
name: "Pompe spa"
bulles_spa:
resource: 192.168.1.29
port: 8990
command_on: '{"data":"8888060F010400D4","sid":"1630705223740","type":1}'
command_off: '{"data":"8888060F010400D4","sid":"1630705223740","type":1}'
command_state: '{"data":"8888060FEE0F01DA","sid":"1630705186378","type":1}'
value_template: '{{ value|regex_search("FFFF110F0111",ignorecase=True) or value|regex_search("FFFF110F0113",ignorecase=True) }}'
timeout: 0.9
name: "Bulles spa"
chauffage_spa:
resource: 192.168.1.29
port: 8990
command_on: '{"data":"8888060F010010C8","sid":"1631356889267","type":1}'
command_off: '{"data":"8888060F010010C8","sid":"1631356889267","type":1}'
command_state: '{"data":"8888060FEE0F01DA","sid":"1630705186378","type":1}'
value_template: '{{ value|regex_search("FFFF110F0107",ignorecase=True) or value|regex_search("FFFF110F0117",ignorecase=True) }}'
timeout: 0.9
name: "Chauffage spa"
I also created 2 current & target temperature sensors with a little bit of Python scripting (forgive me if my scripts are bad I’m not a coder but it works great! )
#Spa sensors
- platform: command_line
command: "python3 /config/python_scripts/spa_current_temp.py {{ states('sensor.temperature_spa') }}"
unit_of_measurement: "°c"
name: Température spa
scan_interval: 300
- platform: command_line
command: "python3 /config/python_scripts/spa_target_temp.py {{ states('sensor.temperature_cible_spa') }}"
unit_of_measurement: "°c"
name: Température cible spa
scan_interval: 300
Here below the python scripts linked to the sensors:
spa_current_temp.py
from telnetlib import Telnet
with Telnet('192.168.1.29', 8990) as tn:
tn.write(('{"data":"8888060FEE0F01DA","sid":"1630705186378","type":1}').encode('ascii'))
OUTPUT = tn.read_until(b"ok")
tn.close()
print(int(str(OUTPUT[45:47], 'utf-8'), 16))
exit
spa_target_temp.py
from telnetlib import Telnet
with Telnet('192.168.1.29', 8990) as tn:
tn.write(('{"data":"8888060FEE0F01DA","sid":"1630705186378","type":1}').encode('ascii'))
OUTPUT = tn.read_until(b"ok")
tn.close()
print(int(str(OUTPUT[61:63], 'utf-8'), 16))
exit
What those scripts do every 5min (can be changed at the sensor level) is:
-Telnet to the spa
-Launch the status command you found
-Cut the hexadecimal current & target temperature data
-Convert the hexadecimal to decimal which is in °C, fine for me as I live in Europe
So in the front end I have this:
Works very great even if you use the Intex app the status will also be updated in HA !!
Now last thing I’m investigating is the temperature setting but this one is not easy because each temp setting has a proper command
Kind regards