Add documentation for binary sensor map sum type(#2123)

Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
This commit is contained in:
Fabian Berthold 2022-08-31 06:52:35 +02:00 committed by GitHub
parent 012d9d4602
commit b7e3a5d60c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -13,7 +13,7 @@ This sensor is **mostly used for touch** devices but could be used for any ``bin
Add your binary sensors as ``channels`` to the binary sensor map. The binary sensor map then publishes a value depending
on the type of the binary sensor map and the values specified with each channel.
This platform currently supports only one measurement type: ``GROUP``, but others might get added later.
This platform currently supports two measurement types: ``GROUP`` and ``SUM``, and others might get added later.
You need to specify which type of mapping you want with the ``type:`` configuration value:
- ``GROUP`` Each channel has its own value. The sensor publishes the average value of all active
@ -47,6 +47,45 @@ You need to specify which type of mapping you want with the ``type:`` configurat
channel: 0
id: touchkey0
# ...
- ``SUM`` Each channel has its own value. The sensor publishes the sum of all active
binary sensors values.
.. code-block:: yaml
# Example configuration entry
sensor:
- platform: binary_sensor_map
id: group_0
name: 'Group Map 0'
type: sum
channels:
- binary_sensor: bit0
value: 1
- binary_sensor: bit1
value: 2
- binary_sensor: bit2
value: 4
- binary_sensor: bit3
value: 8
binary_sensor:
- platform: gpio
pin: 4
id: bit0
- platform: gpio
pin: 5
id: bit1
- platform: gpio
pin: 6
id: bit2
- platform: gpio
pin: 7
id: bit3
# ...
Configuration variables:
------------------------