From 398f1af6a8d11ecd2bac67d1831bb2a350d5ba21 Mon Sep 17 00:00:00 2001 From: J de Neef <6884662+jdeneef@users.noreply.github.com> Date: Sat, 7 Dec 2024 11:40:55 +0100 Subject: [PATCH] removed html --- README.html | 1279 --------------------------------------------------- 1 file changed, 1279 deletions(-) delete mode 100644 README.html diff --git a/README.html b/README.html deleted file mode 100644 index 3f62b86..0000000 --- a/README.html +++ /dev/null @@ -1,1279 +0,0 @@ - - - - - - - README - - - - -

HomeAssistant -HACS custom RPI GPIOD integration

-

This HACS integration is used to address GPIO (especially and only -tested for RaspberryPi) using libgpiod and python gpiod >=v2.02 since -RPI.gpio is no longer supported. I created this for my own use, and to -learn how to build a custom integration, but since it is working on -Raspberry Pi feel free to use.

-
-

💡 The code of this -custom component upto v1.4.5 is copied over to the original HACS RPI_GPIO gpio -integration. You should most likely check and use that integration -instead of this one. I'm keeping this repository for my own fun and -use.

-
-
-

⚠ī¸ This is working in -my homeassistant environment. Shared for testing. Use at your own risk. -👍

-
-

ha_gpiod is based on ha-rpi_gpio, which was -already adapted for gpiod in ha-gpio and rewritten -from scratch for gpiod by me. Just recently this code is -copied back to ha-rpi_gpio

-

Installation

-

Via HACS: add as custom repository from github using this github https://github.com/jdeneef/ha_gpiod/ -(HACS => integrations => 3-dots menu => custom repositories, -enter repository URL, select "Integrations" in Category drop-down, go -back to hacs, install gpiod component, reboot, add config, -reboot).
-If you run into errors, ensure HACS is up-to-date.

-

Usage

-

The gpiod platform will be initialized using the path to -the gpio chip. When path is not in the config -/dev/gpiochip[0-5] are tested for a gpiodevice having -pinctrl, in sequence [0,4,1,2,3,5]. So with a -raspberry pi you should be OK to leave the path empty.

- - - - - - - - - - - - - - - - - -
Raspberry PiGPIO Device
RPi3, RPi4/dev/gpiochip0
RPi5/dev/gpiochip4
-

Sample config -for the raspberry pi berryclip hat

-

See also configuraton-example.yaml; note that below config shows most -options, and can't be used as is, since cover reuses -switch and sensor ports.

-
# setup gpiod chip; mostly not required
-gpiod:
-  path: '/dev/gpiochip0'
-
-# Example of switches (eg switched leds or buzzer) with some sample parameters
-switch:
-  - platform: gpiod
-    switches:
-      - name: "Led 1 red"
-        port: 4
-      - name: "Led 2 red"
-        port: 17
-        unique_id: "gpio_led_red_2"
-      - name: "Led 3 yellow"
-        port: 22
-        active_low: true
-      - name: "Led 6 green"
-        port: 11
-        bias: "AS_IS"
-        drive: "PUSH_PULL"
-      - name: "Fan"
-        port: 8
-        persistent: true
-
-# Example of binary_sensor (eg push button) setup
-binary_sensor:
-  - platform: gpiod
-    sensors:
-    - name: "Button"
-      port: 7
-
-# Example of cover setup
-cover:
-  - platform: gpiod
-    covers:
-      - relay_port: 4
-        name: Cover blue
-        state_port: 7
-        relay_time: 1200
-

Platform

- - - - - - - - - - - - - - - - - - - - - - - - - - -
KeyRequiredDefaultTypeDescription
gpiodonly for path--gpiod platform config and initialization, only required -when you need to specify a specific gpiodevice path (see path)
pathnodiscoveredstringpath to gpio device, if not set auto discovered
-

Binary Sensor

-

The gpiod binary sensor platform allows you to read -sensor values of the GPIOs of your device. To ensure consistence over -reboots the sensor status is read at startup and set accordingly.

-

Configuration options

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
KeyRequiredDefaultTypeDescription
sensorsyeslistList of sensor IO ports (Raspberry Pi -BCM mode pin numbers)
nameyesstringThe name for the binary sensor entity
portyesintegerthe GPIO port to be used
unique_idnogeneratedstringAn ID that uniquely identifies the sensor. Set this to a unique -value to allow customization through the UI, auto generated when not set -manually in config
debounceno50integerThe time in milliseconds for port debouncing
active_low or invert_logic1nofalsebooleanIf true, input of gpio is inverted, -active_low results in on; -invert_logic kept for backwards compatibility
bias or pull_modenoPULL_UPstringcontrol bias setting of GPIO, used to define the electrical state of -a GPIO line when not actively driven; PULL_UP set weak -pull-up resistor on the line, ensuring that the line is pulled to a high -level (3.3V or 5V) when not actively driven; PULL_DOWN sets -weak pull-down resistor to pull to low level (0V), DISABLED -remains floating, AS_IS not changed; pull_mode -kept for backwards compatibility
-

Switch

-

The gpiod switch platform allows you to control the -GPIOs of your device. To ensure consistence over restarts the -persistent flag should be set.

-

Options

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
KeyRequiredDefaultTypeDescription
switchesyeslistList of switch IO ports (Raspberry Pi -BCM mode pin numbers)
nameyesstringThe name for the switch entity
portyesintegerthe GPIO port to be used
unique_idnogeneratedstringAn ID that uniquely identifies the switch. Set this to a unique -value to allow customization through the UI, auto generated when not set -manually in config
active_low or invert_logicnofalsebooleanIf true, output of gpio is inverted, -active_low switches on; -invert_logic kept for backwards compatibility
bias or pull_modenoAS_ISstringType of internal pull resistor to use: PULL_UP - -pull-up resistor, PULL_DOWN - pull-down resistor, -AS-IS no change; pull_mode kept for backwards -compatibility
drivenoPUSH_PULLstringcontrol drive configuration of the GPIO, determines how the line -behaves when it is set to output mode; PUSH_PULL, GPIO line -can both source and sink current, can actively drive the line to both -high and low states. OPEN-DRAIN, GPPIO can only sink -current (drive the line to low) and is otherwise left floating, and -OPEN-SOURCE the reverse.
persistentnofalsebooleanIf true, the switch state will be persistent in HA and will be -restored if HA restart / crash.
-

Cover

-

The gpiod cover platform allows you to control GPIOs to -open/close covers; note that I have only verified cover functionality -simulating with switches and buttons, so logic could be off on some -points .. Covers consist of a switch for triggering cover motor, and a -state sensor for determining the state of the cover. This state is as -for all sensors read at startup time, so should be consistent over -reboots.

-

Options

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
KeyRequiredDefaultTypeDescription
nameyesstringThe name for the cover entity
relay_port or relay_pinyesintegerRelay switch gpio switching cover motor; relay_pin kept -for backwards compatibility
relay_timeno200integerTime in milliseconds relay switch will be switched to open/close -cover
relay_active_low or invert_relaynofalsebooleaninvert input for relay_port; invert_relay -kept for backwards compatibility
relay_biasnoAS_ISstringType of internal pull resistor to use: PULL_UP - -pull-up resistor, PULL_DOWN - pull-down resistor
relay_drivenoPUSH_PULLstringset relay_pin drive_mode, options: -OPEN_DRAIN, OPEN_SOURCE, -PUSH_PULL
state_port or state_pinyesintegerState port for opened/closed status of cover; state_pin -kept for backwards compatibility
state_bias or state_pull_modenoPULL_UPstringType of internal pull resistor to use: PULL_UP - -pull-up resistor, PULL_DOWN - pull-down resistor; -state_pull_mode kept for backwards compatibility
state_active_low or invert_statenofalsebooleaninvert output for state pin; invert_state kept for -backwards compatibility
state_debounceno50integerdebounce parameter for the cover state sensor
unique_idnogeneratedstringAn ID that uniquely identifies the switch. Set this to a unique -value to allow customization through the UI, auto generated when not set -manually in config
-

Add Debug info and issue -reporting

-

Before reporting issues please add this to your -configuration.yaml logger section, check logs -and report issue adding logging.

-
logger:
-  default: info
-  logs:
-    custom_components.gpiod: debug
-
-
-
    -
  1. In ha_gpiod the gpiod -terminology is used as default, but the original -ha-rpi_gpio config parameters are maintained for backwards -compatibility. Using the gpiod terminology helps in -understanding what the libgpiod is really doing.↩ī¸Ž

  2. -
-
- -