How can I get the status or value of a MCP23017 input in script? #23099
Replies: 5 comments 12 replies
-
The general way of picking up values from the JSON is to do it the same way as sensors. Not sure what you did to get those error messages. More broadly, I'd recommend using MCP23017 in the enhanced mode 2, making it act like local relay/switch/button pins, for simplified operation. |
Beta Was this translation helpful? Give feedback.
-
I created a script as following:
With 'sensor29 reset2' option it works fine for getting the value high and low of D1. There is no difference in output between enabling or disabling the '>Y' and template entry. The template will be ignored. |
Beta Was this translation helpful? Give feedback.
-
OK, I will compile without USE_MCP230xx at first and then I will look for the results. |
Beta Was this translation helpful? Give feedback.
-
Without USE_MCP230xx option the MCP23017 will not be recognized. |
Beta Was this translation helpful? Give feedback.
-
I found a ESP8266 with 4 MB flash and created a build with file system. {"NAME":"MCP23017 A=B1-8, B=B9-16", "BASE":1, "GPIO":[32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47]} and put this in the filesystem. After booting, this was the log: 00:00:00.010 UFS: FlashFS mounted with 1984 kB free The file was read and the button configuration was recognized. How can I show the buttons on the GUI? I don't understand how to visualize. |
Beta Was this translation helpful? Give feedback.
-
I have configured a MCP23017 with all lines as input with pullup. I can see the changes in the terminal window:

How can I get the value of one line or status of all lines in a script?
Beta Was this translation helpful? Give feedback.
All reactions