React on MCP23017 Buttons in Berry #22416
Replies: 4 comments 21 replies
-
Using Interrupt mode is about how input is processed, not to change how you use mode 2. With Berry, it is no problem creating a wildcard rule, and do your own filtering by the features available in the language, including regular expressions. Just make sure to be specific about selecting what to process. |
Beta Was this translation helpful? Give feedback.
-
PCF8574 also has a mode 2 which allows to use it as buttons/switches/relays |
Beta Was this translation helpful? Give feedback.
-
hi, i have to ask again, sorry. I would go with wildcar "?" but i dislike to grab the number of input out of msg string for example "Button9". It would be more easier for me to have the number in its own datafield. Where is this output text defined? I took a look to |
Beta Was this translation helpful? Give feedback.
-
fu**. I did not noticed that i was working on the wrong tab(with other old remote device for same purpose). damn. i was just going crazy why the pininput didn't recogniezed anymore. so stupid |
Beta Was this translation helpful? Give feedback.
-
Hi.
When i used the PCF8574 for buttons, i do parse the message to check which button is/was pressed.
for example, i add one rule per PCF8574 to react on changes:
tasmota.add_rule("PCF8574-2_INP", parse_trigger_msg)
and parse the Button with
def parse_trigger_msg(value, trigger, msg) .... end
.Now, playing with MCP23017, actually without interrupt pin connected. So I got the button informations dedicated for each button.
Like:
12:52:05.200 RSL: RESULT = {"Button9":{"Action":"SINGLE"}}
I could add a rule for each button number to reacton to the specific button, with "button" as EventTrigger.
Since i plan to use 2 MCP23017 modules at least, i could result in 32 rules just for the buttons. What sounds to much rules, or less smart.
Is there an option to use the same trigger for each button, Something like "button?" instead of spexcifics "button1",button2",etc as triggers.
I saw with just a "?" as trigger, i could do a universal parse function, but this sounds not like the right way.
Will using the Interrupt of MCP23017 change the name of pinchange event from "Button1/2/3.." to "McpInterruptA"?
So i could use one Trigger/Rule for 8 Inputs?
Beta Was this translation helpful? Give feedback.
All reactions