GithubHelp home page GithubHelp logo

dtr0xx_io's Introduction

Since a version of ESPHome 2023.12 additional line of allow_other_uses: true will be requaried with each component gpio

Problem has been raied with ESPhome team github before esphome/issues#5286

Example configuration:

substitutions:
  devicename: dt-r008
  upper_devicename: DT-R008
  friendly_name: DT-R008
  key: !secret key_dt-r008
  ota: !secret ota_dt-r008
  IP: !secret IP_dt-r008
  fallback_pass: !secret fallback_pass_dt-r008 

esphome:
  name: dt-r008
  friendly_name: DT-R008

esp32:
  board: esp32dev
  framework:
    type: arduino

external_components:
  - source: github://kecajtop/dtr0xx_io@master
    refresh: 60s
    components:
      - dtr0xx_io

# Enable logging
logger:
  #level: VERY_VERBOSE
  baud_rate: 0

# Enable Home Assistant API
api:
  encryption:
    key: $key
  reboot_timeout: 172800s

ota:
  password: $ota

wifi:
#ethernet:
#  type: JL1101
#  mdc_pin: 23
#  mdio_pin: 18
#  clk_mode: GPIO17_OUT
#  power_pin: 0
#  phy_addr: 1

  ssid: !secret wifi_ssid
  password: !secret wifi_password
  reboot_timeout: 172800s
  use_address: $IP
#  use_address: 192.168.0.8
#  manual_ip:
#    static_ip: 192.168.0.8
#    gateway: 192.168.0.1
#    subnet: 255.255.255.0

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: ${friendly_name} Fallback Hotspot
    password: $fallback_pass

captive_portal:

web_server:
  port: 80

time:
- platform: sntp
  id: my_time

i2c:
  sda: 4
  scl: 5
  scan: true
  id: bus_a
  frequency: 400kHz

uart:
  id: mod_bus
  tx_pin: 1
  rx_pin: 3
  baud_rate: 9600
  stop_bits: 1

dtr0xx_io:
  - id: dtr0xx_io_hub
    dingtian_clk_pin: 14
    dingtian_q7_pin: 16
    dingtian_sdi_pin: 13
    dingtian_pl_pin: 32
    dingtian_rck_pin: 15

binary_sensor:
  - platform: gpio
    id: input_1
    name: ${friendly_name} Input 1
    pin:
      dtr0xx_io: dtr0xx_io_hub
      number: 7
      inverted: true
      allow_other_uses: true
    filters:
      - delayed_on: 10ms
      - delayed_off: 10ms
    on_press:
      then:
        switch.toggle: relay_1

  - platform: gpio
    name: ${friendly_name} Input 2
    id: input_2
    pin:
      dtr0xx_io: dtr0xx_io_hub
      number: 6
      inverted: true
      allow_other_uses: true
    filters:
      - delayed_on: 10ms
      - delayed_off: 10ms
    on_press:
      then:
        switch.toggle: relay_2

  - platform: gpio
    name: ${friendly_name} Input 3
    id: input_3
    pin:
      dtr0xx_io: dtr0xx_io_hub
      number: 5
      inverted: true
      allow_other_uses: true
    filters:
      - delayed_on: 10ms
      - delayed_off: 10ms
    on_press:
      then:
        switch.toggle: relay_3

  - platform: gpio
    name: ${friendly_name} Input 4
    id: input_4
    pin:
      dtr0xx_io: dtr0xx_io_hub
      number: 4
      inverted: true
      allow_other_uses: true
    filters:
      - delayed_on: 10ms
      - delayed_off: 10ms
    on_press:
      then:
        switch.toggle: relay_4

  - platform: gpio
    name: ${friendly_name} Input 5
    id: input_5
    pin:
      dtr0xx_io: dtr0xx_io_hub
      number: 3
      inverted: true
      allow_other_uses: true
    filters:
      - delayed_on: 10ms
      - delayed_off: 10ms
    on_press:
      then:
        switch.toggle: relay_5

  - platform: gpio
    name: ${friendly_name} Input 6
    id: input_6
    pin:
      dtr0xx_io: dtr0xx_io_hub
      number: 2
      inverted: true
      allow_other_uses: true
    filters:
      - delayed_on: 10ms
      - delayed_off: 10ms
    on_press:
      then:
        switch.toggle: relay_6

  - platform: gpio
    name: ${friendly_name} Input 7
    id: input_7
    pin:
      dtr0xx_io: dtr0xx_io_hub
      number: 1
      inverted: true
      allow_other_uses: true
    filters:
      - delayed_on: 10ms
      - delayed_off: 10ms
    on_press:
      then:
        switch.toggle: relay_7

  - platform: gpio
    name: ${friendly_name} Input 8
    id: input_8
    pin:
      dtr0xx_io: dtr0xx_io_hub
      number: 0
      inverted: true
      allow_other_uses: true
    filters:
      - delayed_on: 10ms
      - delayed_off: 10ms
    on_press:
      then:
        switch.toggle: relay_8

switch:
  - platform: gpio
    name: ${friendly_name} Relay 1
    id: relay_1
    restore_mode: ALWAYS_OFF
    pin:
      dtr0xx_io: dtr0xx_io_hub
      number: 7
      inverted: false
      allow_other_uses: true
  - platform: gpio
    name: ${friendly_name} Relay 2
    id: relay_2
    restore_mode: ALWAYS_OFF
    pin:
      dtr0xx_io: dtr0xx_io_hub
      number: 6
      inverted: false
      allow_other_uses: true
  - platform: gpio
    name: ${friendly_name} Relay 3
    id: relay_3
    restore_mode: ALWAYS_OFF
    pin:
      dtr0xx_io: dtr0xx_io_hub
      number: 5
      inverted: false
      allow_other_uses: true
  - platform: gpio
    name: ${friendly_name} Relay 4
    id: relay_4
    restore_mode: ALWAYS_OFF
    pin:
      dtr0xx_io: dtr0xx_io_hub
      number: 4
      inverted: false
      allow_other_uses: true
  - platform: gpio
    name: ${friendly_name} Relay 5
    id: relay_5
    restore_mode: ALWAYS_OFF
    pin:
      dtr0xx_io: dtr0xx_io_hub
      number: 3
      inverted: false
      allow_other_uses: true
  - platform: gpio
    name: ${friendly_name} Relay 6
    id: relay_6
    restore_mode: ALWAYS_OFF
    pin:
      dtr0xx_io: dtr0xx_io_hub
      number: 2
      inverted: false
      allow_other_uses: true
  - platform: gpio
    name: ${friendly_name} Relay 7
    id: relay_7
    restore_mode: ALWAYS_OFF
    interlock: [relay_8]
    interlock_wait_time: 250ms
    pin:
      dtr0xx_io: dtr0xx_io_hub
      number: 1
      inverted: false
      allow_other_uses: true
  - platform: gpio
    name: ${friendly_name} Relay 8
    id: relay_8
    restore_mode: ALWAYS_OFF
    interlock: [relay_7]
    interlock_wait_time: 250ms
    pin:
      dtr0xx_io: dtr0xx_io_hub
      number: 0
      inverted: false
      allow_other_uses: true

dtr0xx_io's People

Contributors

kecajtop avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.