mathieu-mp / aio-intex-spa

Python client for Intex Spa wifi interface
https://pypi.org/project/aio-intex-spa/
MIT License
17 stars 2 forks source link

Triggering switches enables feature with a unwanted timer #16

Closed Rolrik closed 2 years ago

Rolrik commented 2 years ago

Triggering async_set_filter enables filter with a 2 hours timer, instead of enabling filter for good.

Elkropac commented 2 years ago

Hi, i don't think, you can choose duration 2/4/6h using remote control. It just uses last value when you start filter. I will test tomorrow on my spa

mathieu-mp commented 2 years ago

Hi @Rolrik, Your bug report is correct but we didn't find another way to trigger the command. Do you know another way to go ?

@Elkropac, I am interested in your answer. I might not be able to change the behavior, but I should at least document this limitation.

Elkropac commented 2 years ago

So, after testing by starting filtering from panel with 2h/4h/6h and reading status

2h
DEBUG:intex_spa.intex_spa_network_layer:Receiving bytes from the spa: b'{"sid":"16577015108853","data":"FFFF110F010300110000000082808015000032","result":"ok","type":2}\n'
4h
DEBUG:intex_spa.intex_spa_network_layer:Receiving bytes from the spa: b'{"sid":"16577016431762","data":"FFFF110F01030011000000008680801500002E","result":"ok","type":2}\n'
6h
DEBUG:intex_spa.intex_spa_network_layer:Receiving bytes from the spa: b'{"sid":"16577017630523","data":"FFFF110F01030011000000008A80801500002A","result":"ok","type":2}\n'

I have set 6h on panel and then started filter via integration and status is:

DEBUG:intex_spa.intex_spa_network_layer:Receiving bytes from the spa: b'{"sid":"16577020671767","data":"FFFF110F010300110000000082808015000032","result":"ok","type":2}\n'

Panel says 2h and returned status is also same as 2h.

My original intex app has no input for setting this timer.

mathieu-mp commented 2 years ago

Thank you @Elkropac. When you set the filtering on from the original app, does it trigger an indefinite on status or a filter with timer ?

Elkropac commented 2 years ago

I wanted to test how it works with original app, but i found out, that my spa is not paired in this app anymore. I will test later, i have to disable 5GHz wifi on my AP to make it pair again ... it's annoying

Elkropac commented 2 years ago

I think, that original app always set the timer, but i don't know, if it was always 2H or if it respected settings on panel. Checking the status, you can see, it's changing, so you can read time setting from panel.

I will try to pair original app and then try to catch the commands to start filter with different timers set on panel.

mathieu-mp commented 2 years ago

Don't worry, I've just tested it !

Before triggering the filter button: "data":"FFFF110F0101001E000000008080802100001D" After: "data":"FFFF110F0103001F0000000082808021000018"

Based on your findings about the duration, it looks like a timer is set for 2h when triggered by the original app.

The logic might be that the spa prevents itself from running indefinitely.

mathieu-mp commented 2 years ago

Below is the evolution of the status over time.

T+0min (triggering the filter from the original app) :

11:55:46 network Receiving bytes from the spa: b'{"sid":"16577061460017","data":"FFFF110F0101001E000000008080802100001D","result":"ok","type":2}\n'
11:55:46 status] Spa status: '{'power': True, 'filter': False, 'heater': False, 'jets': False, 'bubbles': False, 'sanitizer': False, 'unit': '°C', 'current_temp': 30, 'preset_temp': 33, 'error_code': False}'

11:56:16 network Receiving bytes from the spa: b'{"sid":"16577061760014","data":"FFFF110F0103001F0000000082808021000018","result":"ok","type":2}\n'
11:56:16 status] Spa status: '{'power': True, 'filter': True, 'heater': False, 'jets': False, 'bubbles': False, 'sanitizer': False, 'unit': '°C', 'current_temp': 31, 'preset_temp': 33, 'error_code': False}'

T+30min:

12:25:52 network Receiving bytes from the spa: b'{"sid":"16577079520029","data":"FFFF110F0103001F0000000082808021000018","result":"ok","type":2}\n'
12:25:52 status] Spa status: '{'power': True, 'filter': True, 'heater': False, 'jets': False, 'bubbles': False, 'sanitizer': False, 'unit': '°C', 'current_temp': 31, 'preset_temp': 33, 'error_code': False}'

12:26:22 network Receiving bytes from the spa: b'{"sid":"16577079820013","data":"FFFF110F0103001F0000000081808021000019","result":"ok","type":2}\n'
12:26:22 status] Spa status: '{'power': True, 'filter': True, 'heater': False, 'jets': False, 'bubbles': False, 'sanitizer': False, 'unit': '°C', 'current_temp': 31, 'preset_temp': 33, 'error_code': False}'

T+60min:

12:55:58 network Receiving bytes from the spa: b'{"sid":"16577097580011","data":"FFFF110F010300200000000081808021000018","result":"ok","type":2}\n'
12:55:58 status] Spa status: '{'power': True, 'filter': True, 'heater': False, 'jets': False, 'bubbles': False, 'sanitizer': False, 'unit': '°C', 'current_temp': 32, 'preset_temp': 33, 'error_code': False}'

12:56:28 network Receiving bytes from the spa: b'{"sid":"16577097880023","data":"FFFF110F010300200000000080808021000019","result":"ok","type":2}\n'
12:56:28 status] Spa status: '{'power': True, 'filter': True, 'heater': False, 'jets': False, 'bubbles': False, 'sanitizer': False, 'unit': '°C', 'current_temp': 32, 'preset_temp': 33, 'error_code': False}'

T+120min:

13:55:58 network Receiving bytes from the spa: b'{"sid":"16577133580014","data":"FFFF110F010300200000000080808021000019","result":"ok","type":2}\n'
13:55:58 status] Spa status: '{'power': True, 'filter': True, 'heater': False, 'jets': False, 'bubbles': False, 'sanitizer': False, 'unit': '°C', 'current_temp': 32, 'preset_temp': 33, 'error_code': False}'

13:56:28 network Receiving bytes from the spa: b'{"sid":"16577133880013","data":"FFFF110F01010020000000008080802100001B","result":"ok","type":2}\n'
13:56:28 status] Spa status: '{'power': True, 'filter': False, 'heater': False, 'jets': False, 'bubbles': False, 'sanitizer': False, 'unit': '°C', 'current_temp': 32, 'preset_temp': 33, 'error_code': False}'

I had a short look at it when working on the python package, but I couldn't find the logic in the timers fields. It felt like retrieving the timers for power/filter/... was not an essential feature, so I dropped it.

Whatever, it is not the subject of this issue.

Elkropac commented 2 years ago

What time did you have set on panel, when you tried to start filtering from original app? Something different then 2H? If not, can you retry? 1) Set 6H on panel 2) Then start filter from original app 3) Check panel, if it switches to 2H? If it stays on 6H, it probably means, that filter command can send timer settings and i will try to capture it on my AP

I checked status over network, when panel said 1H, and it's still FFFF110F010300110000000082808015000032, like when i started filter, so it does not even show current time remaining on panel.

I guess, if the original app has no way to set this timer, you cannot do it in integration either

Rolrik commented 2 years ago

How do you capture packet, i can test witch my original app and post it here .

mathieu-mp commented 2 years ago

How do you capture packet, i can test witch my original app and post it here .

You can set the log level to debug. You will read the exchanges between your client and the spa in the logs.

mathieu-mp commented 2 years ago

I am moving this issue to the python package as the behavior does not depend on home assistant integration

mathieu-mp commented 2 years ago

Hi @Rolrik ,

I read the intex mobile app java code again, and there seem to be no way to actuate the switch without triggering the associated timer. Thus, I am sorry but I just cannot change the way the python package works.

If anyone has a suggestion about a way to solve this issue, don't hesitate to comment and reopen.

Mira43 commented 3 weeks ago

Hello @mathieu-mp i don't know if you are on the project at this date, but i discovered something that i never know on github or other websites that talk to the intex spa protocol. But i used the schedule part of the mobile app. When turning on/off or modifiy the schedule rule, i intercepted the message, tried to resend over telnet chanel after disabled the rule. The Spa started at the good time to heat with the good parameters i set in the rule.

This to share with you an example, and maybe understand how it works better, and perhaps, suggest to add schedule features in your library ?

So, basically, this is my heater rule i set in the mobile app : image So i set every day at 4:10 PM, heat until 38°C for 8 hours.

I intercepted this command message, and replay it later, it worked : {"data":"8888280F0A55000808FF2600000000000000000000000000000000000000000000000000000000000022","sid":"1724248867138","type":1}

Hope it can help you or another person to understand what is the logic with the schedules ...

EDIT : In the example, i think i found the signification of each part, the header (88 88 28 0F 0A 55) is maybe the one for heater command, i didn't tried other schedules (sanitizer or filter) yet. 88 88 28 0F 0A 55 00 08 08 FF 26 00000000000000000000000000000000000000000000000000000000000022

In bold : 00 : hours remaining for last schedule (=next day) (between 0 and 23) first 08 : minutes remaining before next schedule of next day second 08 : duration of the schedule FF : days of weeks (all for me, but i noticed it's EF for all days except Sunday, as example) 26 : target temp hex 26 => 38 dec

I assume last 22 is related to checksum as other commands ? PS : i noticed the same data command each time i disable the schedule (maybe this is a reset message for heater) : 8888280F0A000000000000000000000000000000000000000000000000000000000000000000000000AD