Overview Shelly The Pill

The function block connects The Pill by Shelly. The small Wi-Fi module is powered with 5 V via USB-C and gets its inputs and outputs from a plugged-in add-on. Depending on the peripheral setup, the block measures temperature, humidity or voltage, reports digital inputs and switches digital outputs or the load outputs of the SSR add-on.

Which inputs and outputs the block shows depends on the parameters Peripheral setup, IO1, IO2 and IO3. Only the connections belonging to the selected assignment appear. The selection Peripheral setup corresponds to the setting of the same name in the web interface of the Pill.

Peripheral setup


Temperature (5x DS18B20) + 2x I/O Up to five DS18B20 sensors at IO1 (jack adapter or 5-Terminal Add-on). IO2 and IO3 are freely usable as digital input or output.

Temperature & Humidity (DHT22) + 2x I/O One DHT22 at IO1. IO2 and IO3 are freely usable.

Analog input + I/O Voltage measurement at IO1, set in the device to 0–2.5 V (built-in) or 0–30 V (with the Analog 0–30 V Add-on, terminal AN). IO2 and IO3 are freely usable.

3x Digital I/O IO1, IO2 and IO3 are freely usable as digital input or output. Digital inputs and outputs with 3.3 V.

SSR Add-on Two galvanically isolated solid-state outputs LOAD1 and LOAD2 for DC loads up to 30 V and 300 mA. They use IO1 and IO2 internally, only IO3 remains free.

Inputs

L1 LOAD1 Switches the load output LOAD1 of the SSR add-on.
L2 LOAD2 Switches the load output LOAD2 of the SSR add-on.
A1 Output IO1 Switches IO1 on (1) and off (0). Only with peripheral setup = 3x Digital I/O and IO1 = Output.
A2 Output IO2 Switches IO2. Only with IO2 = Output.
A3 Output IO3 Switches IO3. Only with IO3 = Output.

Outputs

T1..T5 Temperature 1..5 Temperature of the DS18B20 sensors in °C, as many as set under Number of DS18B20. With the DHT22 there is only T1.
F1 Humidity in % Relative humidity of the DHT22.
U Voltage V Voltage of the analog input in volts, 0–2.5 V or 0–30 V depending on the setting in the device. If a conversion is set in the device, the converted value is output.
E1..E3 Input IO1..IO3 State of the digital input. If the input is set as a push-button in the device, it reports 1 as long as the button is pressed.
A1..A3 Output IO1..IO3 status Feedback of the digital output.
L1, L2 LOAD1/LOAD2 status Feedback of the load outputs of the SSR add-on.

Parameters


MQTT Topic Topic of the device, exactly as in the MQTT settings of the device. Example: shellypill-aabbccddeeff

Peripheral setup Peripheral setup of the device, as set in the web interface under Peripheral setup: Temperature (5x DS18B20) + 2x I/O, Temperature & Humidity (DHT22) + 2x I/O, Analog input + I/O, 3x Digital I/O or SSR Add-on.

IO1 (only with 3x Digital I/O) Function of terminal IO1: Not used, Input or Output. Applies only with peripheral setup = 3x Digital I/O; with all others the peripheral setup occupies terminal IO1.

Number of DS18B20 Number of connected DS18B20 sensors, 1 to 5. Only with peripheral setup = Temperature (5x DS18B20) + 2x I/O.

IO2 Function of terminal IO2: Not used, Input or Output. No effect with the SSR add-on, where IO2 switches the output LOAD2.

IO3 Function of terminal IO3: Not used, Input or Output.

Setup in the device

The peripheral setup and the function of the terminals are set in the web interface of the Pill, under Peripheral setup. The setting must match the parameters of the block: a terminal set as an input in the block must also be created as a digital input in the device. The block does not change the settings of the device. It does query the peripheral setup of the device once per start and reports in the diagnostics if it differs from the parameter.

The device reports states and measured values only when they change. The block therefore fetches all current values once at start and each time the device registers again at the broker (e.g. after a restart of the Pill). Outputs and feedback then show the actual state immediately, even if nothing has changed since the start.

Changing the peripheral setup or a terminal function shifts the inputs and outputs of the block. Check connections and addresses afterwards.

For the measured values and feedback to arrive, all three MQTT options must be enabled in the device, as described under MQTT devices - general. Without Generic status update over MQTT the outputs do not change.

The Pill can also act as a Bluetooth gateway for Shelly BLU devices. These are connected with their own BLU blocks.

In addition to the outputs listed, the command generate addresses creates an address named timeout. It is set to 1 when the device has not sent a message for a longer period of time.

See also MQTT devices - general.
See also general parameters of all function blocks.