Can MCP23017 inputs be defined as GPIOs / buttons, to use longpress options

16 views
Skip to first unread message

Dalius K

unread,
Jul 26, 2021, 9:33:14 AM7/26/21
to TasmotaUsers
I'm trying to add a couple of buttons to a  MCP23017 GPIO expander connected to H801 LED controller, to control the different channels of LEDs. I'd like to use longpress actions to change the brightness, but as far as I'm aware, I can only intercept the interrupt events such as "event#MCPINT_D4=1" and use them in rules,   and not define them as buttons and use "state=3" for easier programming? 
If there's a way to program this behavior with just event and rules, I can't think of it... I do have IF statements and conditionals enabled if that helps :)

Dalius K

unread,
Jul 26, 2021, 9:41:40 AM7/26/21
to TasmotaUsers
Also, on an unrelated note, can anyone tell me what's wrong with the statement below, as it only works to turn on, but not to turn off the power? I'd assume it's the way I read the power state, but I can't tell what is expected... Also I know I can achieve this with a power toggle, but I planned on expanding this after confirming it works...  

on event#MCPINT_D4=1 do IF (power3#state==0) channel3 50; RuleTimer2 5 ELSE power3 0 endif endon

Reply all
Reply to author
Forward
0 new messages