diff --git a/MCP23008-MCP23017.md b/MCP23008-MCP23017.md index f951137b..5461f254 100644 --- a/MCP23008-MCP23017.md +++ b/MCP23008-MCP23017.md @@ -187,13 +187,15 @@ Interrupts will report for individual pins as and when the conditions which were Interrupt message on HIGH for input pin 0 ``` -19:28:57 MQT: stat/sonoff/RESULT = {"Time":"2018-07-29T19:28:57","MCP230XX_INT":{"D0":1}} +MQT: stat/sonoff/RESULT = {"Time":"2018-08-19T16:04:50","MCP230XX_INT":{"D0":1,"MS":301}} ``` Interrupt message on LOW for input pin 1 ``` -19:28:57 MQT: stat/sonoff/RESULT = {"Time":"2018-07-29T19:28:57","MCP230XX_INT":{"D1":0}} +MQT: stat/sonoff/RESULT = {"Time":"2018-08-19T16:04:50","MCP230XX_INT":{"D1":0,"MS":519}} ``` +The state of the pin captured during the interrupt is reported as Dx=y where x is the pin number and y is the state of the pin. In addition the number of milliseconds since the last interrupt occured for the particular pin is also reported as MS=xx where xx is the number of milliseconds recorded. + In addition to the MQTT message the driver will also execute an event command in the following format: `event MCPINTDxx=y` @@ -203,9 +205,15 @@ Where xx = the pin number from 0 through 7 (MCP23008) or 0 through 15 (MCP23017) The complete output for an interrupt enabled pin would look like this: ``` -MQT: stat/sonoff/RESULT = {"Time":"2018-08-01T17:53:34","MCP230XX_INT":{"D0":0}} +MQT: stat/sonoff/RESULT = {"Time":"2018-08-19T16:08:28","MCP230XX_INT":{"D0":0,"MS":217353}} SRC: Rule -RSL: Group 0, Index 1, Command EVENT, Data MCPINTD0=0 +RSL: Group 0, Index 1, Command EVENT, Data MCPINT_D0=0 +MQT: stat/sonoff/RESULT = {"Event":"Done"} +``` +``` +MQT: stat/sonoff/RESULT = {"Time":"2018-08-19T16:08:46","MCP230XX_INT":{"D0":1,"MS":18101}} +SRC: Rule +RSL: Group 0, Index 1, Command EVENT, Data MCPINT_D0=1 MQT: stat/sonoff/RESULT = {"Event":"Done"} ```