Home Elements Boards Recipes

Elements Overview

Elements are implementations of a specific input, output or compute functionality that corresponds to a specific functionality like Sensors, Displays, Light, I/O control and internal control logic. Elements are implemented in the HomeDing library as Components that can be controlled using setup configuration and runtime actions.

There is a Element Sheet availabe as table data.

The following element implementations are available in the current version of the HomeDing library.

Input Elements

Input Elements are used to create an action based on a specific input signal like digital HIGH/LOW or analog signals or values from sensors like movement detectors.

Digital Input Element (digitalin)

The DigitalInElement is used to capture digital input signal and create actions based on level changes. This can e.g. be used to capture actively from buttons and switches but also some sensors offer a digital output as a 0 / 1 value.

Digital Signal Element (digitalsignal)

The DigitalSignalElement is used to handle digital input with short time level changes that might be missed when using the [DigitalInput Element](/elements/digitalin.md). On a changing input a pulse value is created with a defined duration.

Analog Element (analog)

The AnalogElement is used to capture the voltage level from the Analog Input pin with the integrated ADC and to emit corresponding events. It also handles some of the often occurring problems around capturing analog values.

Rotary Element (rotary)

The RotaryElement is used to capture increments and decrements for values using a rotary encoder.

Display Touch Element (touch)

The Display Touch Elements enables detecting touch events by touching a specific area on a display.

Sensor Elements

The sensor elements implement the adoption to a very specific sensor or sensor family. They share some common implementation to allow gathering values on a regular basis and updating other elements or even other boards by sending actions with the current value.

DHT Element (dht)

The DHT Element allows retrieving temperature and humidity values from the DHT11, DHT22 and AM2302 sensors and creates actions when new values are available.

AM2320 Element (am2320)

The AM2320Element allows retrieving temperature and humidity values and creates actions when new values are available.

AHT20 Element (aht20)

The AHT20Element allows retrieving temperature and humidity values from the AHT20 sensors from aosong.

Dallas Element (dallas)

The DallasElement allows retrieving temperature values from DS18B20 aka. Dallas Temperature sensors and creates actions when new values are available.

BME680 Element (bme680)

The BME680Element implements reading the 4 sensor values from a BME680 environment air sensor chip. This sensor can capture temperature, humidity, air pressure and air resistance.

PMS Element (pms)

The PMSElement allows using the laser based air particle and pollution sensor PMS5003 from plantower to report the number of micro particles in the air.

BMP280 Element (bmp280)

The BMP280 Element supports the BMP280 sensor chips for air temperature and air absolute barometric pressure.

BL0937 Element (bl0937)

The BL0937Element has been implemented to support single phase energy monitoring using BL0937, HLW8012 or HJL-01 chips that are used in some retail plugs and switches.

More detailed information on sensor implementation can be found in sensor Elements implementation.

Output and Actor Elements

pwmout

The PWMOut Element is used to output an pwm signals based on actions. e.g. LEDs.

Digital Output Element (digitalout)

The DigitalOutElement is used with the GPIO pins of the board to create a digital output level based on actions sent to the element. This can e.g. be used to switch a LED or relay on/off.

rfcodes

The RFCodes Element is used for sending and receiving RF codes on the 433 MHz band e.g. to control remote sockets.

Light Elements

To control a simple light or bulb the Switch Element and Value Element can be used to control on/off and the brightness of LEDs using PWM Out Element or DigitalOut Element.

To control lights, bulbs and LED stripes with colors the following special light elements can be used.

There are special elements to control specific chips or using the PWM capabilities:

Light Element (light)

The LightElement is used as a base class to control a light by WRGB Value and Brightness. It can control up to 4 PWM GPIO output pins directly for WRGB lights. It is used as a base class for other light elements using a specific chip or protocol.

MY9291 Element (my9291)

The MY9291Element implements the protocol to control the Taiwan Mingyang MY9291 LED driver chip that can be found in some bulbs. It can control 3 or 4 channels of PWM output with a high PWM frequency typically used for RGB and WRGB bulbs.

The Color Element can be used to create a light color value of your choice.

Color Element (color)

The Color Element allows controlling a color value for a light emitting element using color notations in the xRRGGBB or xWWRRGGBB format and brightness 0..100. A special Web UI is available.

For LED stripes the Stripe Element provides the base functionality to control a series of LEDs with individual color values and a overall brightness.

The stripes can be controlled from the following elements implementing the specific protocols:

Neopixel board for ESP-01 (neo)

The neo board is a very specific adapter to drive a Neopixel based stripe, wheel or array using a ESP-01 board. The ESP-01 boards are available with ESP8266 and ESP32-C3 chips.

APA102 Element (apa102)

The APA102 Element implements using LED Stripes and LED panels based on the apa102 chip and protocol and provides some color animations and transitions.

P9813 Element (p9813)

The P9813Element implements the protocol to control the P9813 LED driver chip also known as Groove chainable LED.

Light Sensors

bh1750

This is a light sensor probong for the intensity of light in lumen. BH1750 Element

Logic and Calculation Elements

Logic elements implement using on/off values expressed as 1/0 values. See Calc Abstract Element

button

The Button Element can differentiate clicks, double clicks and long press gestures to send out actions.

switch

The Switch Element controls a boolean output value with 0 and 1 values. It can use input from a DigitalIn Element with a momentary button and the Web UI.

and

The AND Element combines multiple logic input values to a single output value. The outgoing value is HIGH(1) when all of the given input values are not LOW(0).

or

The OR Element combines multiple logic input values to a single output value. The outgoing value is HIGH(1) when one of the given input values is not LOW(0).

add

The ADD Element sums up multiple input values to create a single output value.

Map Element (map)

The MapElement creates actions based on an in-bound value and range definitions.

reference

The Reference Element creates actions by comparing an incoming value with a reference value.

Scene Element (scene)

The Scene Element sends a series of actions triggered by a single incoming action. They can be send out step by step using a defined delay or by actions.

Select Element (select)

The SelectElement is used to choose one of many options with keys and a values. When selecting one of the options a key action and a value action is dispatched.

Display Elements

The HomeDing library supports local attached displays but also works fine without a local display.

Display SSD1306 Element (ssd1306)

The DisplaySSD1306 Element allows connecting a pixel based OLED display based on a SSD1306 chip.

Display SH1106 Element (sh1106)

The DisplaySH1106 Element allows connecting a pixel based OLED display based on a SH1106 chip.

Display LCD Element (lcd)

The DisplayLCD Element implements the display using Monochrome LCDs based on HD44780 chips. The display is connected by using the PCF8574 I2C chip to control the direct input lines of the display.

DisplayMAX7219 Element (max7219)

The DisplayMAX7219 Element implements a larger display by using LED 8x8 led displays matrixes based on MAX7219 controller chips.

On the displays several Elements can be used to display data, text and visuals:

DisplayText Element (text)

The DisplayTextElement allows sending a value to the display and show it at a specified position as text including a prefix and postfix. The value can be changed by using an action.

DisplayDot Element (dot)

The DisplayDot Element allows showing a circle with a border and background color. This can be used to visualize a boolean value on the display and show it at a specified position as a shallow or filled dot/circle. The value can be changed by using an action.

DisplayLine Element (line)

The DisplayLineElement allows drawing a simple fixed line on the display when the display supports pixel drawing.

DisplayRect Element (rect)

The DisplayRect Element allows showing a rectangular with a border and background color. This can be used to visualize a boolean value on the display and show it at a specified position as a shallow or filled rectangle. The value can be changed by using an action.

More detailed information on displays and related elements can be found in displays.

One Value Display Elements

These Elements can be used to display a single value.

DisplayMAX7219 Element (max7219)

The DisplayMAX7219 Element implements a larger display by using LED 8x8 led displays matrixes based on MAX7219 controller chips.

TM1637 Element (tm1637)

The TM1637 is a chip that allows using 7-segment displays up to 6 digits.

Time related Elements

time

The Time Element sends actions with the actual local time.

dstime

The DSTime Element can retrieve the local time using the RTC DS3231 chip.

ntptime

The NTPTime Element can retrieve the local time using the NTP protocol from a NTP server.

schedule

The Schedule Element creates on and off actions based on the actual local time.

alarm

The Alarm Element creates actions when reaching a defined time of day.

timer

The Timer Element creates timer (duration) based actions.

More detailed information on time element and time related implementation can be found in time elements implementation.

System Elements

device

The Device Element is used to configure the device level properties.

ota

The OTA Element is used to enable and configure Over The Air Updates.

ssdp

The SSDP Element is used to discovering devices on the network using SSDP protocol.

value

The Value Element is used to receive and send actions to use and control an internal value.

menu

The Menu Element is used for displaying and changing multiple values.

log

The Log Element is used for storing timestamp based sensor values.

Network Elements

Things based on the HomeDing library are network connected by default as they integrate a web server and web services.

The Network Elements extend the base functionality to connect to other devices and services over the network using different protocols.

Remote Element (remote)

The Remote Element allows sending actions over the network to other elements in HomeDing devices using http GET requests.

mqtt

The MQTTElement enables publishing values to a MQTT Sever using the mqtt protocol.

Service elements interact with services to get or publish data using actions.

weatherfeed

The Weatherfeed Elementcan retrieve weather forecast information from an internet service.

Storage related Elements

sd

The SDElement uses the SPI bus to connect a SD card and makes the files available for reading and writing in the /sd folder.

sdmmc

The SDMMCElement implements access to the file system on a SDMMC card on ESP32 processors and boards.

Audio related Elements

The Audio Elements can be used to create / control audio related devices and chips.

audio/tone

The Tone Element allows creating sound using the Arduino tone function.

audio/radio

The Radio Element allows to control FM radio chips that are connected to the board via i2c bus.

This element is using the external Radio Library to configure and use various FM radio chips and boards.

This element is part of the Radio Example.

audio/audio

The Audio Element enables audio streaming and audio processing in a background task. The Audio Element is part of the WebRadio Example.

Other Elements

You can find some more elements in the examples folder.

These implementations are for special purpose or are still experimental cases but are published already maybe with some restricted functionality.

diag

The DiagElement is part of the DevDing Example and offers some additional diagnose information.

This element is part of the DevDing example

ina219

The INA219 is a current and voltage sensor that uses the I2C bus for communication that can measure voltages up to 26V and current in various ranges.

This sensor is part of the Probe example

ina226

The INA226 is a current and voltage sensor that uses the I2C bus for communication that can measure voltages up to 26V on high-side or low-side and current in various ranges .

This sensor is part of the Probe example

Web UI Elements

These elements starting with web in their name are only known to the Web UI implementation but are not part of the firmware- The intention is to enrich and customize the Web UI dashboard with elements like presets and macros.

webbutton

This element adds a button the Web UI of the board. The button can be used to trigger actions by clicking.

See also

Tags

Element