Replies: 11 comments
|
If mcp23017 is not reset by your hardware or by a power cycle, switch states shouldn't change given your configuration.
I guess that when HA starts up, your mcp23017 hardware is also reset somehow and therefore outputs reset to their default values, i.e. 0 (ON with Could you describe your hardware and what do you mean exactly with "home assistant start up" ? |
|
here the pdf is diagram of MCP23017 circuit. |
|
Thanks for the schematic, is the 3V3 used by the mcp23017 supplied from CM4's If it is the case, then 3V3 goes down during a power cycle if I read correctly. I guess that if you just restart HA (but not CM4) then output levels are preserved ? |
|
|
If mcp23017 loose its power then related states are also lost, i.e. when everything restart you get power on reset default states (OFF with invert_logic=False ON otherwise). Note that if you use config flow rather than yaml to configure a mcp23017 then you can set invert_logic per entity rather than per device (with yaml you can change it using the UI but it is not persistent). |
|
if i set "invert_logic=False" , when power on of PCB, all relay also will all ON, just home assitant UI switch state exchanged. do you think it's hardware circuit problem? |
|
It is not a hardware issue but the expected behavior; mcp23017 sets its output registers to 0 after reset/power up, invert_logic only affects HA state/how you see it. |
|
i sloved, just need add "hw_sync: false" will be ok. thank you very much for your help. we will make new pcb with 4pcs of MCP23017, 32 channel binary sensor + 32 channel switch. your component support that , OK? |
|
hw_sync=False will force output to OFF at power up from a UI/HA perspective (for mcp23017 this is 0 with invert_logic=False, 1 otherwise). No issues with support for multiples mcp23017 devices as long as they are on the same i2c bus. |
|
OK, thanks again. |
|
Thanks, I'll close the discussion, feel free to create new ones whenever required. |
Uh oh!
There was an error while loading. Please reload this page.
Hello, thanks for your add-on. now i use these config code, every time when home assistant start up, all switch will ALL ON. can you tell me , how to let all switch output ALL OFF or don't change state when home assistant reboot.
switch:
i2c_address: 0x22
invert_logic: true
pins:
0 : Output_1
1 : Output_2
2 : Output_3
3 : Output_4
4 : Output_5
5 : Output_6
6 : Output_7
7 : Output_8
8 : Output_9
9 : Output_10
10 : Output_11
11 : Output_12
12 : Output_13
13 : Output_14
14 : Output_15
15 : Output_16
All reactions