From 5a346a5b7b17c02c2f6c036636a31b6ffde58326 Mon Sep 17 00:00:00 2001 From: Kamil_B <37997460+kamil2466@users.noreply.github.com> Date: Fri, 21 Oct 2022 17:01:28 +0200 Subject: [PATCH] update addition of new configurations - PCF input board - MCP input board - relay board 32x10 PCF - relay board 32x10 MCP --- ...32_inputs.yaml => relay32_inputs_MCP.yaml} | 0 boards/relay32_inputs_PCF.yaml | 449 ++++++++++++++++++ ..._outputs.yaml => relay32_outputs_MCP.yaml} | 0 boneIOsample.yaml | 17 +- ...oneio_board.yaml => boneio_board_MCP.yaml} | 0 devices/boneio_board_PCF.yaml | 37 ++ 6 files changed, 496 insertions(+), 7 deletions(-) rename boards/{relay32_inputs.yaml => relay32_inputs_MCP.yaml} (100%) create mode 100644 boards/relay32_inputs_PCF.yaml rename boards/{relay32_outputs.yaml => relay32_outputs_MCP.yaml} (100%) rename devices/{boneio_board.yaml => boneio_board_MCP.yaml} (100%) create mode 100644 devices/boneio_board_PCF.yaml diff --git a/boards/relay32_inputs.yaml b/boards/relay32_inputs_MCP.yaml similarity index 100% rename from boards/relay32_inputs.yaml rename to boards/relay32_inputs_MCP.yaml diff --git a/boards/relay32_inputs_PCF.yaml b/boards/relay32_inputs_PCF.yaml new file mode 100644 index 0000000..fc64572 --- /dev/null +++ b/boards/relay32_inputs_PCF.yaml @@ -0,0 +1,449 @@ +#i2c addresses +# address: 0x26 input pcf io +# address: 0x27 input pcf io +# address: 0x3C input oled +# address: 0x40 input ina219 power +# address: 0x68 input rtc ds1307 + +binary_sensor: + - platform: gpio + name: "${node_name} IN_01" + id: in_01 + pin: + pcf8574: mcp_inputs_1to16 + number: 0 + mode: + input: true + inverted: true + on_press: + then: + - switch.toggle: relay_1 + + - platform: gpio + name: "${node_name} IN_02" + id: in_02 + pin: + pcf8574: mcp_inputs_1to16 + number: 1 + mode: + input: true + inverted: true + on_press: + then: + - switch.toggle: relay_2 + + - platform: gpio + name: "${node_name} IN_03" + id: in_03 + pin: + pcf8574: mcp_inputs_1to16 + number: 2 + mode: + input: true + inverted: true + on_press: + then: + - switch.toggle: relay_3 + + - platform: gpio + name: "${node_name} IN_04" + id: in_04 + pin: + pcf8574: mcp_inputs_1to16 + number: 3 + mode: + input: true + inverted: true + on_press: + then: + - switch.toggle: relay_4 + + - platform: gpio + name: "${node_name} IN_05" + id: in_05 + pin: + pcf8574: mcp_inputs_1to16 + number: 4 + mode: + input: true + inverted: true + on_press: + then: + - switch.toggle: relay_5 + + - platform: gpio + name: "${node_name} IN_06" + id: in_06 + pin: + pcf8574: mcp_inputs_1to16 + number: 5 + mode: + input: true + inverted: true + on_press: + then: + - switch.toggle: relay_6 + + - platform: gpio + name: "${node_name} IN_07" + id: in_07 + pin: + pcf8574: mcp_inputs_1to16 + number: 6 + mode: + input: true + inverted: true + on_press: + then: + - switch.toggle: relay_7 + + - platform: gpio + name: "${node_name} IN_08" + id: in_08 + pin: + pcf8574: mcp_inputs_1to16 + number: 7 + mode: + input: true + inverted: true + on_press: + then: + - switch.toggle: relay_8 + + - platform: gpio + name: "${node_name} IN_09" + id: in_09 + pin: + pcf8574: mcp_inputs_1to16 + number: 8 + mode: + input: true + inverted: true + on_press: + then: + - switch.toggle: relay_9 + + - platform: gpio + name: "${node_name} IN_10" + id: in_10 + pin: + pcf8574: mcp_inputs_1to16 + number: 9 + mode: + input: true + inverted: true + on_press: + then: + - switch.toggle: relay_10 + + - platform: gpio + name: "${node_name} IN_11" + id: in_11 + pin: + pcf8574: mcp_inputs_1to16 + number: 10 + mode: + input: true + inverted: true + on_press: + then: + - switch.toggle: relay_11 + + - platform: gpio + name: "${node_name} IN_12" + id: in_12 + pin: + pcf8574: mcp_inputs_1to16 + number: 11 + mode: + input: true + inverted: true + on_press: + then: + - switch.toggle: relay_12 + + - platform: gpio + name: "${node_name} IN_13" + id: in_13 + pin: + pcf8574: mcp_inputs_1to16 + number: 12 + mode: + input: true + inverted: true + on_press: + then: + - switch.toggle: relay_13 + + - platform: gpio + name: "${node_name} IN_14" + id: in_14 + pin: + pcf8574: mcp_inputs_1to16 + number: 13 + mode: + input: true + inverted: true + on_press: + then: + - switch.toggle: relay_14 + + - platform: gpio + name: "${node_name} IN_15" + id: in_15 + pin: + pcf8574: mcp_inputs_1to16 + number: 14 + mode: + input: true + inverted: true + on_press: + then: + - switch.toggle: relay_15 + + - platform: gpio + name: "${node_name} IN_16" + id: in_16 + pin: + pcf8574: mcp_inputs_1to16 + number: 15 + mode: + input: true + inverted: true + on_press: + then: + - switch.toggle: relay_16 + + - platform: gpio + name: "${node_name} IN_17" + id: in_17 + pin: + pcf8574: mcp_inputs_17to32 + number: 7 + mode: + input: true + inverted: true + on_press: + then: + - switch.toggle: relay_17 + + - platform: gpio + name: "${node_name} IN_18" + id: in_18 + pin: + pcf8574: mcp_inputs_17to32 + number: 6 + mode: + input: true + inverted: true + on_press: + then: + - switch.toggle: relay_18 + + - platform: gpio + name: "${node_name} IN_19" + id: in_19 + pin: + pcf8574: mcp_inputs_17to32 + number: 5 + mode: + input: true + inverted: true + on_press: + then: + - switch.toggle: relay_19 + + - platform: gpio + name: "${node_name} IN_20" + id: in_20 + pin: + pcf8574: mcp_inputs_17to32 + number: 4 + mode: + input: true + inverted: true + on_press: + then: + - switch.toggle: relay_20 + + - platform: gpio + name: "${node_name} IN_21" + id: in_21 + pin: + pcf8574: mcp_inputs_17to32 + number: 3 + mode: + input: true + inverted: true + on_press: + then: + - switch.toggle: relay_21 + + - platform: gpio + name: "${node_name} IN_22" + id: in_22 + pin: + pcf8574: mcp_inputs_17to32 + number: 2 + mode: + input: true + inverted: true + on_press: + then: + - switch.toggle: relay_22 + + - platform: gpio + name: "${node_name} IN_23" + id: in_23 + pin: + pcf8574: mcp_inputs_17to32 + number: 1 + mode: + input: true + inverted: true + on_press: + then: + - switch.toggle: relay_23 + + - platform: gpio + name: "${node_name} IN_24" + id: in_24 + pin: + pcf8574: mcp_inputs_17to32 + number: 0 + mode: + input: true + inverted: true + on_press: + then: + - switch.toggle: relay_24 + + - platform: gpio + name: "${node_name} IN_25" + id: in_25 + pin: + pcf8574: mcp_inputs_17to32 + number: 8 + mode: + input: true + inverted: true + on_press: + then: + - switch.toggle: relay_25 + + - platform: gpio + name: "${node_name} IN_26" + id: in_26 + pin: + pcf8574: mcp_inputs_17to32 + number: 9 + mode: + input: true + inverted: true + on_press: + then: + - switch.toggle: relay_26 + + - platform: gpio + name: "${node_name} IN_27" + id: in_27 + pin: + pcf8574: mcp_inputs_17to32 + number: 10 + mode: + input: true + inverted: true + on_press: + then: + - switch.toggle: relay_27 + + - platform: gpio + name: "${node_name} IN_28" + id: in_28 + pin: + pcf8574: mcp_inputs_17to32 + number: 11 + mode: + input: true + inverted: true + on_press: + then: + - switch.toggle: relay_28 + + - platform: gpio + name: "${node_name} IN_29" + id: in_29 + pin: + pcf8574: mcp_inputs_17to32 + number: 12 + mode: + input: true + inverted: true + on_press: + then: + - switch.toggle: relay_29 + + - platform: gpio + name: "${node_name} IN_30" + id: in_30 + pin: + pcf8574: mcp_inputs_17to32 + number: 13 + mode: + input: true + inverted: true + on_press: + then: + - switch.toggle: relay_30 + + - platform: gpio + name: "${node_name} IN_31" + id: in_31 + pin: + pcf8574: mcp_inputs_17to32 + number: 14 + mode: + input: true + inverted: true + on_press: + then: + - switch.toggle: relay_31 + + - platform: gpio + name: "${node_name} IN_32" + id: in_32 + pin: + pcf8574: mcp_inputs_17to32 + number: 15 + mode: + input: true + inverted: true + on_press: + then: + - switch.toggle: relay_32 + + - platform: gpio + name: "${node_name} IN_33" + pin: + number: GPIO33 + mode: + input: true + inverted: true + + - platform: gpio + name: "${node_name} IN_34" + pin: + number: GPIO17 + mode: + input: true + inverted: true + + - platform: gpio + name: "${node_name} IN_35" + pin: + number: GPIO12 + mode: + input: true + pullup: true + inverted: false + diff --git a/boards/relay32_outputs.yaml b/boards/relay32_outputs_MCP.yaml similarity index 100% rename from boards/relay32_outputs.yaml rename to boards/relay32_outputs_MCP.yaml diff --git a/boneIOsample.yaml b/boneIOsample.yaml index c7ff2c1..5f2aa15 100644 --- a/boneIOsample.yaml +++ b/boneIOsample.yaml @@ -4,20 +4,23 @@ substitutions: packages: # devices core: !include devices/wt32_eth01.yaml - internals: !include devices/boneio_board.yaml + internals: !include devices/boneio_board_PCF.yaml + #internals: !include devices/boneio_board_MCP.yaml temp: !include devices/lm75b.yaml display: !include devices/display.yaml # uart: !include devices/uart.yaml # one_wire: !include devices/one_wire.yaml # relay32 - output: !include boards/relay32_outputs.yaml - input: !include boards/relay32_inputs.yaml + #output: !include boards/relay32_outputs_MCP.yaml + output: !include boards/relay32_outputs_PCF.yaml + #input: !include boards/relay32_inputs_MCP.yaml + input: !include boards/relay32_inputs_PCF.yaml # dimmer led - # output: !include boards/dimmer_led8x4_outputs.yaml - # input: !include boards/dimmer_led8x4_inputs.yaml - # light: !include boards/monochromatic_lights.yaml + #output: !include boards/dimmer_led8x4_outputs.yaml + #input: !include boards/dimmer_led8x4_inputs.yaml + #light: !include boards/monochromatic_lights.yaml # cover -# output: !include boards/cover16_outputs.yaml + #output: !include boards/cover16_outputs.yaml # input: !include boards/cover16_inputs.yaml # cover: !include boards/cover.yaml diff --git a/devices/boneio_board.yaml b/devices/boneio_board_MCP.yaml similarity index 100% rename from devices/boneio_board.yaml rename to devices/boneio_board_MCP.yaml diff --git a/devices/boneio_board_PCF.yaml b/devices/boneio_board_PCF.yaml new file mode 100644 index 0000000..82d1697 --- /dev/null +++ b/devices/boneio_board_PCF.yaml @@ -0,0 +1,37 @@ +#i2c address: 0x26 input pcf io +#i2c address: 0x27 input pcf io +#i2c address: 0x40 input ina219 power +#i2c address: 0x68 input rtc ds1307 +time: + - platform: ds1307 + id: ds1307_time + +sensor: +# Module power consmption + - platform: ina219 + address: 0x40 + shunt_resistance: 0.1 ohm + current: + id: ina_current + name: "${node_name} INA219 Current" + power: + id: ina_power + name: "${node_name} INA219 Power" + bus_voltage: + id: ina_bus_voltage + name: "${node_name} INA219 Bus Voltage" + shunt_voltage: + id: ina_shunt_voltage + name: "${node_name} INA219 Shunt Voltage" + max_voltage: 32.0V + max_current: 3.2A + update_interval: 30s + +pcf8574: + - id: 'mcp_inputs_1to16' + address: 0x26 + pcf8575: true + - id: 'mcp_inputs_17to32' + address: 0x27 + pcf8575: true +