Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Seeed multi channel relay control documentation #2840

Closed
wants to merge 27 commits into from
Closed
Show file tree
Hide file tree
Changes from 29 commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
ac3d74f
created initial version of documentation
KoenBreeman Apr 12, 2023
c48b0bc
added image
KoenBreeman Apr 12, 2023
347cc7f
reduced the image size to 300x300
KoenBreeman Apr 12, 2023
d4a23c9
updated information
KoenBreeman Apr 12, 2023
955eafd
Title underline was too short :-S
KoenBreeman Apr 12, 2023
1c72109
Updated reference to GPIO switch
KoenBreeman Apr 12, 2023
6e31203
Merge branch 'next' into current
KoenBreeman Apr 13, 2023
c0f22c8
Updated Seeed description
KoenBreeman Apr 14, 2023
61e7d11
...
KoenBreeman Apr 14, 2023
cbd5cab
updated seeed documentation
KoenBreeman Apr 14, 2023
a80cbe0
....
KoenBreeman Apr 14, 2023
7aaf4c2
Merge branch 'esphome:current' into Seeed_documentation
KoenBreeman Apr 14, 2023
f192f06
....
KoenBreeman Apr 14, 2023
591e7c6
Merge branch 'Seeed_documentation' of https://github.com/KoenBreeman/…
KoenBreeman Apr 14, 2023
5a16bf7
updated seeed control text
KoenBreeman Apr 16, 2023
81ae4dd
changed to utf8 text
KoenBreeman Apr 16, 2023
27f3b47
fix build errors
KoenBreeman Apr 16, 2023
9bdfccb
...
KoenBreeman Apr 16, 2023
0bb5aa9
Update seeedmultichannelrelay.rst
KoenBreeman Apr 16, 2023
b2cb09e
updated to fix build errors
KoenBreeman Apr 16, 2023
4457036
Merge branch 'Seeed_documentation' of https://github.com/KoenBreeman/…
KoenBreeman Apr 16, 2023
1e0ddd3
updated documentation to reflect changes in channel from string to in…
KoenBreeman Jun 23, 2023
47551d5
Changed control address to change_address_to
KoenBreeman Jul 2, 2024
bf82913
Added default addresses
KoenBreeman Jul 2, 2024
c7c66fe
merged from other updates
KoenBreeman Jul 2, 2024
c688300
Revert "Added default addresses"
KoenBreeman Aug 9, 2024
9cb1001
changed branch
KoenBreeman Aug 9, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
steps:
-
name: Checkout source code
uses: actions/checkout@v3.5.0
uses: actions/checkout@v3.5.2
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
Expand All @@ -39,7 +39,7 @@ jobs:
-
name: Build and push
id: docker_build
uses: docker/build-push-action@v3
uses: docker/build-push-action@v4
with:
context: .
push: true
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3.5.0
- uses: actions/checkout@v3.5.2
- name: Set up Python 3.8
uses: actions/setup-python@v4
with:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/stale.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
stale:
runs-on: ubuntu-latest
steps:
- uses: actions/stale@v7
- uses: actions/stale@v8
with:
days-before-pr-stale: 60
days-before-pr-close: 7
Expand All @@ -35,7 +35,7 @@ jobs:
close-issues:
runs-on: ubuntu-latest
steps:
- uses: actions/stale@v7
- uses: actions/stale@v8
with:
days-before-pr-stale: -1
days-before-pr-close: -1
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,5 @@ venv
.vscode
*.DS_Store
/.idea/
/.vs/m5stackrelaydoc/v16
/.vs
27 changes: 27 additions & 0 deletions _redirects
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,30 @@

/changelog/2022.12.4.html /changelog/2022.12.0.html 301
/components/display/ili9341.html /components/display/ili9xxx.html 301

/cookbook/brilliant-mirabella-genio-smart-plugs.html https://devices.esphome.io/devices/Mirabella-Genio-Wi-Fi-1-USB 301
/cookbook/zemismart-rgbw-downlights.html https://devices.esphome.io/devices/Zemismart-LED-RGBWW-Downlight 301
/cookbook/relay.html https://devices.esphome.io/devices/Generic-Relay 301
/cookbook/pir.html https://devices.esphome.io/devices/Generic-PIR 301
/cookbook/mirabella-genio-bulb.html https://devices.esphome.io/devices/Mirabella-Genio-Monochromatic-Bulbs 301
/cookbook/air_gradient_diy_air_quality_sensor.html https://devices.esphome.io/devices/AirGradient-DIY 301
/cookbook/ble_itag.html https://devices.esphome.io/devices/ble_itag 301
/cookbook/bruh.html https://devices.esphome.io/devices/bruh 301
/cookbook/esw01-eu.html https://devices.esphome.io/devices/Etekcity-Voltson-ESW01-EU 301
/cookbook/geiger-counter.html https://devices.esphome.io/devices/geiger-counter 301
/cookbook/h801.html https://devices.esphome.io/devices/H801-RGBW-LED-Controller 301
/cookbook/iaq_board.html https://devices.esphome.io/devices/iaq_board 301
/cookbook/ifan02.html https://devices.esphome.io/devices/Sonoff-iFan02 301
/cookbook/ilonda-wifi-smart-fish-feeder.html https://devices.esphome.io/devices/ilonda-wifi-smart-fish-feeder 301
/cookbook/iwoole_rgbw_table_lamp.html https://devices.esphome.io/devices/iwoole_rgbw_table_lamp 301
/cookbook/teckin_sb50.html https://devices.esphome.io/devices/Teckin-SB50_rgbww 301
/cookbook/temt6000.html https://devices.esphome.io/devices/temt6000 301
/cookbook/tracer-an.html https://devices.esphome.io/devices/epever_mptt_tracer_an 301
/cookbook/tuya_rgbw.html https://devices.esphome.io/devices/tuya_rgbw 301
/cookbook/uart_text_sensor.html /cookbook/lambda_magic.html#custom-uart-text-sensor 301
/cookbook/endstop-cover.html /components/cover/endstop.html 301
/cookbook/sonoff-light-switch.html https://devices.esphome.io/devices/Sonoff-Dual-DIY-light 301
/cookbook/sonoff-basic-light-switch.html https://devices.esphome.io/devices/Sonoff-Basic-DIY-light 301
/cookbook/sonoff-dual-light-switch.html https://devices.esphome.io/devices/Sonoff-Dual-DIY-light 301
/cookbook/sonoff-t1-3.html https://devices.esphome.io/devices/Sonoff-T1-T2-T3 301
/cookbook/dual-r2-cover.html /cookbook/lambda_magic.html#one-button-cover-control 301
2 changes: 1 addition & 1 deletion components/output/template.rst
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ It is possible to access the state value inside Lambdas:
- output.turn_off: button_off


Complete example from the cookbook: :doc:`Sonoff Dual Light Switch</cookbook/sonoff-dual-light-switch>`.
Complete example: `Sonoff Dual Light Switch <https://devices.esphome.io/devices/Sonoff-Dual-DIY-light>`__.

See Also
--------
Expand Down
4 changes: 2 additions & 2 deletions components/sensor/homeassistant.rst
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Entity state attributes can also be imported:
This component is only for numeral states. If you want to import arbitrary text states
from Home Assistant, use the :doc:`Home Assistant Text Sensor </components/text_sensor/homeassistant>`.

Albeit you might not plan to *export* states from the node and you do not need an entity of the node
Although you might not plan to *export* states from the node and you do not need an entity of the node
in Home Assistant, this component still requires you to register the node under Home Assistant. See:
:doc:`Getting started with Home Assistant </guides/getting_started_hassio>`

Expand All @@ -50,7 +50,7 @@ Configuration variables:

.. note::

The sensors implemented by this component are by default ``internal``, to avoid exporting back them to
The sensors implemented by this component are by default ``internal``, to avoid exporting them back to
Home Assistant. Should you still want to do that (eg. because you use ESPHome's very efficient filters
on them) you need to specifically configure ``internal: false``. Also, ``state_class``, ``unit_of_measurement``
are not inherited from the imported sensor so you need to set them manually.
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added components/switch/images/m5stack4relay.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
52 changes: 52 additions & 0 deletions components/switch/m5stack4relay.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
.. _m5stack4relay_switch:

M5Stack 4 Relay Switch Component
================================

.. seo::
:description: Instructions for setting up m5stack4relay Switch.
:image: m5stack4relay.jpg

The ``m5stack4relay`` switch platform supports the 4 channels of the relay unit.
The relays can be used to switch up to AC-230V or DC-28V. For more information: https://docs.m5stack.com/en/unit/4relay

.. figure:: images/m5stack4relay.png
:align: center
:width: 80.0%

.. code-block:: yaml

# Example configuration entry
m5stack4relay:
id: M5stackrelay_ID1
# ...

switch:
- platform: m5stack4relay
id: relay_1
name: relay1
channel: 1
m5stack4relay_id: M5stackrelay_ID1

Configuration variables:
------------------------

- **channel** (*Required*, string): The channel number to switch, options are 1, 2, 3 or 4.
- **m5stack4relay_id** (*Optional*, :ref:`config-id`): The ID of the M5Stack 4 relay.
- **interlock** (*Optional*, list): A list of other switches in an interlock group. See
:ref:`switch-gpio-interlocking`.
- **interlock_wait_time** (*Optional*, :ref:`config-time`): For interlocking mode, set how long
to wait after other items in an interlock group have been disabled before re-activating.
Useful for motors where immediately turning on in the other direction could cause problems.

- All other options from :ref:`Switch <config-switch>`.

This switch supports the same interlocking as the GPIO switch.

See Also
--------

- :doc:`index`
- :apiref:`m5stack4relay/switch/m5stack4relay_switch.h`
- :apiref:`gpio/switch/gpio_switch.h`
- :ghedit:`Edit`
69 changes: 69 additions & 0 deletions components/switch/seeedmultichannelrelay.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
.. _seeedmultichannelrelay_switch:

Seeed Multi Channel Relay Switch Component
==========================================

.. seo::
:description: Instructions for setting up seeedmultichannelrelay Switch.
:image: seeedmultichannelrelay.jpg

The ``seeedmultichannelrelay`` switch platform supports the 8 channels of the relay unit. There are multi relays which are supported.
The relays can be used to switch up to AC-250V or DC-110V. For more information:

Below are several links to supported relays
https://wiki.seeedstudio.com/Grove-4-Channel_SPDT_Relay/
https://wiki.seeedstudio.com/Grove-8-Channel_Solid_State_Relay/

.. figure:: images/Seeed-4-Channel-SPDT-Relay.png
:align: center
:width: 80.0%

.. figure:: images/Seeed-8-Channel-Solid-State-Relay.png
:align: center
:width: 80.0%

.. code-block:: yaml

# Example configuration entry
seeedmultichannelrelay:
id: SeeedMultiChannelRelay_ID
address: 0x11 # changes the address of the seeedmultichannelrelay only runs this once
# ...

switch:
- platform: seeedmultichannelrelay
id: relay_1
name: relay1
channel: 1
seeedmultichannelrelay_id: SeeedMultiChannelRelay_ID

Configuration variables:
------------------------
**Control**

- **addres** (*Optional*, hex-address): This should only be added to change the i2c address
Copy link
Contributor

@iBobik iBobik Mar 15, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is not intuitive.

How about to rename it to change_address_to and run it always? So it will change address only when intended.

Or better create action for changing address? User can run it on startup or on button click.

Or be more verbose in docs what it exactly does and when it changes address.

I also miss info about the default address. This is from product page:
Default I2C Address: 0x11 or 0x12
Available I2C Address: 0x00 ~ 0x7F

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added the default addresses and changed the name to change_address_to

on the EPROM of the relay. Afterwards the address will be permanently changed.

- All other options from I2C devices.

**Switch**

- **channel** (*Required*, string): The channel number to switch, options are 1 to 8 (depending on the relay switch design).
- **seeedmultichannelrelay_id** (*Optional*, :ref:`config-id`): The ID of the Seed relay.
- **interlock** (*Optional*, list): A list of other switches in an interlock group. See
:ref:`switch-gpio-interlocking`.
- **interlock_wait_time** (*Optional*, :ref:`config-time`): For interlocking mode, set how long
to wait after other items in an interlock group have been disabled before re-activating.
Useful for motors where immediately turning on in the other direction could cause problems.

- All other options from :ref:`Switch <config-switch>`.

This switch supports the same interlocking as the GPIO switch.

See Also
--------

- :doc:`index`
- :apiref:`seeedmultichannelrelay/switch/seeedmultichannelrelay_switch.h`
- :apiref:`gpio/switch/gpio_switch.h`
- :ghedit:`Edit`
101 changes: 0 additions & 101 deletions cookbook/dual-r2-cover.rst

This file was deleted.

Loading