Treatlife SS01S Lighswitch & long press issues

179 views
Skip to first unread message

Jan

unread,
Feb 3, 2021, 2:40:05 PM2/3/21
to TasmotaUsers
Hello fellow enthusiasts, this is my first post here.

I recently flashed a bunch of Tuya devices to Tasmota, including a few Treatlife SS01S single-gang light switches. I am trying to configure them for long-press, but am not seeing the results I am expecting.

In the Tasmota console, I did the following:

Backlog SwitchMode 5; SetOption32 20

I then continued monitoring the console while I long-pressed the switch, but nothing shows up. Regular On/Off shows up just fine, but not long press. All I therefore see is as follows:

20:37:35 MQT: stat/TreatlifeLightswitchBathroomVanity/RESULT = {"SwitchMode1":5}
20:37:36 MQT: stat/TreatlifeLightswitchBathroomVanity/RESULT = {"SetOption32":20}
20:37:49 MQT: stat/TreatlifeLightswitchBathroomVanity/RESULT = {"POWER":"ON"}
20:37:49 MQT: stat/TreatlifeLightswitchBathroomVanity/POWER = ON
20:37:52 MQT: stat/TreatlifeLightswitchBathroomVanity/RESULT = {"POWER":"OFF"}
20:37:52 MQT: stat/TreatlifeLightswitchBathroomVanity/POWER = OFF

I tried resetting the switch and setting it up from scratch, but same issue. 

I can tell, however, that the switch behaves differently, as a long press keeps it off, whereas before switchmode 5, a long press would still turn it on.

Any advice would be appreciated.

lexxai

unread,
Feb 3, 2021, 4:23:03 PM2/3/21
to sonof...@googlegroups.com
Tasmota sends HOLD (use Switch<x>#state=3 in rules).
Try add it:

on Switch1#state=3 DO delay ENDON

--
You received this message because you are subscribed to the Google Groups "TasmotaUsers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sonoffusers...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/sonoffusers/affe4610-11dc-435d-ab5b-05fb9a393a9dn%40googlegroups.com.

Jan

unread,
Feb 3, 2021, 4:43:00 PM2/3/21
to TasmotaUsers
Thank you for the response. I tried different variations of your suggestion to no avail, I still don't see "HOLD" related entries in my log when I long-press. Here's what I entered into the console and the responses I got:

22:27:10 CMD: on Switch1#state=3 DO delay ENDON
22:27:10 MQT: stat/TreatlifeLightswitchBathroomVanity/RESULT = {"Command":"Unknown"}
22:29:17 CMD: ON Switch1#State=3 DO Delay ENDON 
22:29:17 MQT: stat/TreatlifeLightswitchBathroomVanity/RESULT = {"Command":"Unknown"}
22:31:29 CMD: Rule1 ON Switch1#State=3 DO Delay ENDON 
22:31:29 RUL: Stored uncompressed, would compress from 34 to 30 (-12%)
22:31:29 MQT: stat/TreatlifeLightswitchBathroomVanity/RESULT = {"Rule1":"OFF","Once":"OFF","StopOnError":"OFF","Length":34,"Free":477,"Rules":"ON Switch1#State=3 DO Delay ENDON "}
22:40:17 CMD: Rule1 1
22:40:17 MQT: stat/TreatlifeLightswitchBathroomVanity/RESULT = {"Rule1":"ON","Once":"OFF","StopOnError":"OFF","Length":34,"Free":477,"Rules":"ON Switch1#State=3 DO Delay ENDON "}
22:41:08 MQT: stat/TreatlifeLightswitchBathroomVanity/RESULT = {"POWER":"ON"}
22:41:08 MQT: stat/TreatlifeLightswitchBathroomVanity/POWER = ON
22:41:15 MQT: stat/TreatlifeLightswitchBathroomVanity/RESULT = {"POWER":"OFF"}
22:41:15 MQT: stat/TreatlifeLightswitchBathroomVanity/POWER = OFF

Jan

unread,
Feb 3, 2021, 4:59:45 PM2/3/21
to TasmotaUsers
I think I figured it out -- it was "SetOption73 1" that was needed:

22:55:58 CMD: SetOption73 1 
22:55:58 MQT: stat/TreatlifeLightswitchBathroomVanity/RESULT = {"SetOption73":"ON"} 
22:56:12 MQT: stat/TreatlifeLightswitchBathroomVanity/RESULT = {"Button1":{"Action":"HOLD"}}

lexxai

unread,
Feb 3, 2021, 6:06:25 PM2/3/21
to sonof...@googlegroups.com

May be you not say on command that rule it is ?

RULE 1 ON Switch1#state=3 DO delay ENDON

RULE1 1


Jan

unread,
Feb 3, 2021, 7:23:18 PM2/3/21
to TasmotaUsers
So I think I made multiple mistakes -- I should have coded it as "Button1", not "Switch1". But either way, I figured out how to capture long-press actions by means of buttontopic and switchmode only.

I first had to set "buttontopic 1" and then either "switchmode 5" or "switchmode 6". The latter is better in my case, as the long-press action fires without having to lift the finger off the switch. Now, I was able to code an action with the following elements:

TRIGGER:
platform: mqtt
topic: cmnd/TreatlifeLightswitchBathroomVanity/POWER

CONDITION:
value_template: '{{ trigger.payload == "HOLD" }}'

Also, "SetOption32 10" in the Tasmota console reduces the long-press duration to 1 second.

Perhaps this helps someone else.
Reply all
Reply to author
Forward
0 new messages