TapHome

Shelly Gas

Packet Parser → HTTP
Submitted by
Last updated: 03. 2026
Shelly Gas

The Shelly Gas (model SHGS-1) is a mains-powered Wi-Fi gas detector available in two variants — CNG (natural gas / methane) and LPG (propane / butane). Both variants use the same API and the same TapHome template. The device plugs directly into a power socket and monitors gas concentration continuously, triggering a sound and light alarm when thresholds are exceeded.

TapHome communicates with the device over HTTP on the local network — no cloud connection is required. The template polls the /status endpoint for alarm state and gas concentration, and provides controls for muting the alarm and running a sensor self-test.

An MQTT variant of this template is also available (Shelly GAS MQTT). Use the MQTT template if the device is configured to communicate via an MQTT broker instead of HTTP.

Configuration

The Shelly Gas connects over Wi-Fi. During TapHome template import, enter the device’s IP address (default placeholder 192.168.0.1).

Both CNG and LPG variants are configured identically — the physical sensor differs, but the API and template are the same.

Device capabilities

Gas alarm monitoring

The template exposes a multi-value switch that reads the current alarm state from the /status response (gas_sensor.alarm_state). The device reports one of the following states:

StateMeaning
No alarmNormal operation — no gas detected
Mild gas leakGas concentration >= 1800 ppm
Heavy gas leakGas concentration >= 3000 ppm
Self TestSensor self-diagnostic in progress
Alarm state is unknownUnrecognized state (fallback)

The alarm thresholds are fixed at the device level and cannot be changed via TapHome or the API.

Gas concentration

A sensor device reads the current gas concentration in parts per million (ppm) from the /status response (concentration.ppm). The value updates every 15 seconds. During sensor warm-up after power-on, the reading may be invalid.

Mute active alarm

A push button device sends a GET /mute request to silence the alarm buzzer without clearing the alarm state. The alarm state remains active until the gas concentration drops below the threshold.

Service diagnostics

The template exposes 9 service attributes for device monitoring:

  • Device info — hostname, MAC address, device time, uptime, RAM usage
  • Connectivity — cloud enabled/connected, MQTT connected, firmware update available
Service actions

Two service actions are available:

  • Set Volume — adjusts the alarm buzzer volume (1 = quietest, 11 = loudest) via /settings?set_volume={value}
  • Self test — initiates a sensor self-diagnostic (~30 seconds) via /self_test
Additional capabilities

The Shelly Gas also exposes sensor operational state (normal / warmup / fault), self-test progress, concentration validity flag, WiFi signal strength, and external valve manipulator control (11–13V, 500mA jack output) in its /status response. An unmute endpoint (/unmute) is available to re-enable the alarm buzzer after muting. These capabilities can be added in a future template update.

Troubleshooting

Device not responding
  1. Verify the Shelly is connected to Wi-Fi and has a valid IP address
  2. Try using the mDNS hostname (shellygas-AABBCCDDEE.local) instead of the IP address — the IP may have changed after a DHCP renewal
  3. Open http://{device-ip}/shelly in a browser — if it responds with device type SHGS-1, the device is reachable
  4. Check that TapHome CCU and Shelly are on the same network / VLAN
Gas concentration always reads zero
  1. Confirm the sensor is not in warm-up mode — after power-on, the sensor needs time to stabilize before reporting valid readings
  2. Check concentration.is_valid in the /status response — if false, the sensor is still warming up
  3. Ensure the device is positioned correctly (CNG variant near the ceiling, LPG variant near the floor — gas rises or sinks depending on density)
Alarm not triggering
  1. The alarm thresholds are fixed: mild >= 1800 ppm, heavy >= 3000 ppm — low concentrations below these levels will not trigger an alarm
  2. Run a self-test from TapHome (service action) to verify sensor and buzzer functionality
  3. Check the gas_sensor.sensor_state field in /status — if it reads fault, the sensor may need replacement

Gen1 Shelly devices support only 2 concurrent HTTP connections. If TapHome and another system (e.g., Home Assistant) poll the same device simultaneously, communication may become unreliable. Use a poll interval of 10–30 seconds.

How to install in TapHome

Prerequisites

  • Shelly device installed and powered on
  • Local Wi-Fi network (2.4 GHz)
  • TapHome CCU on the same network

Step 1 — Connect Shelly to Wi-Fi

Option A — Shelly app (recommended):

  1. Download the Shelly app (iOS / Android)
  2. Tap +Add Device and follow the Bluetooth pairing wizard
  3. Enter your Wi-Fi credentials when prompted

Option B — AP mode (no app):

  1. On first power-up the device creates a hotspot: ShellyXXX-AABBCCDDEE
  2. Connect your phone/PC to that hotspot
  3. Open http://192.168.33.1Internet & SecurityWi-Fi Mode - Client
  4. Enter SSID and password → Save

Shelly only supports 2.4 GHz networks. 5 GHz networks will not appear in the scan.

Step 2 — Find the device address

Shelly Gen1 devices support mDNS (Zeroconf). You can reach the device using a hostname instead of an IP address:

1
shelly<model>-<MAC>.local

For example: shelly1pm-AABBCCDDEE.local (MAC address in uppercase hex, no colons).

Recommended: use the TapHome IP Scanner. Open the TapHome app and use the IP Scanner (Settings → Network → Scan). The scanner will discover devices on your network and show both the IP address and the mDNS hostname. Use the hostname instead of the IP address for a more reliable connection — it stays the same even if the device’s IP changes after a router reboot.

Alternative methods to find the IP address:

  • Shelly app: Device detail → Device info → IP address
  • Shelly web UI: Connect to the device AP before Wi-Fi setup — the IP is shown after saving
  • Router DHCP table: Look for a hostname like shelly1pm-AABBCCDDEE

Step 3 — Configure in TapHome

  1. In TapHome, add a new Packet Parser (HTTP) module
  2. Address: enter the mDNS hostname (e.g., shelly1pm-AABBCCDDEE.local) or IP address from Step 2
  3. Port: 80 (default, no change needed)
  4. Import the template — TapHome will poll /status to read device state

HTTP authentication is disabled by default on Shelly devices. If you have enabled login protection, TapHome does not support HTTP Basic Auth at this time — keep auth disabled for TapHome integration.

Available devices

Shelly Gas Module
Service Actions
Set Volume
Self test
Custom Variables
deviceID (string) = 10521CF2BA9BIP address of the Shelly Gas device on the local network

Shelly GAS

Read (module)
VAR response := SENDHTTPREQUEST("/status");
IF response.IsSuccess
 status := response.Content;
END
Service Actions
Set Volume [1 to 11]
Parameters: Volume [1 to 11] (1–11 Volume)
sendhttprequest("/settings?set_volume="+Volume);
Self test
sendhttprequest("/self_test");
Gas Alarm Multi-value Switch Read-only

Gas alarm state — No alarm, Mild gas leak (>= 1800 ppm), Heavy gas leak (>= 3000 ppm), Self Test, Unknown

enum multi-value switch
Values / States: No alarm · Mild gas leak · Heavy gas leak · Alarm state is unknown · Self Test

Gas Alarm

Read switch state
var state := parsejson(parsejson(status,"gas_sensor"),"alarm_state");
switch(state, "none", return(0),
"mild", return(1),
"heavy", return(2),
"test", return(4),
return(3));
Write switch state
#return(2);

# Simple HTTP Request:
# VAR response := SENDHTTPREQUEST("/example/set/value=" + Mu);
# IF response.IsSuccess = false
#  ADDERROR(response.StatusCode);
# END
#
# Set Http request method, body and headers
# VAR response := SENDHTTPREQUEST("/example/setValue", "GET", "value=" + Mu, "header1:value1", "header2:value2", ...);\r
# Or VAR request := HTTPREQUEST("/example/setValue");
# request.Method := "PUT";
# VAR response := SENDHTTPREQUEST(request);
#r
#
# Send TCP, UDP data:
# VAR data1 := "{\"name\":\"John\", \"age\":" + Mu + "}";
# SENDDATA(data1);
# VAR data2 := TOBYTES("{\"name\":\"John\", \"age\":" + Mu + "}", "iso-8859-1");
# SENDDATA(data2);
# You can process received TCP or UDP data in the Listener script
#
#
# Upload data to FTP:
# FTPUPLOAD("filePath", "somedata=" + Mu, "write"); # use "append" mode to append data to existing file
Gas Concentration Variable Read-only

Current gas concentration reading in parts per million (ppm)

numeric Unit: ppm

Gas Concentration

Read
var v := sendhttprequest("/status");
var content := v.Content;
return(todouble(parsejson(content,"concentration.ppm")));
Write
# Simple HTTP Request:
# VAR response := SENDHTTPREQUEST("/example/set/value=" + Va);
# IF response.IsSuccess = false
#  ADDERROR(response.StatusCode);
# END
#
# Set Http request method, body and headers
# VAR response := SENDHTTPREQUEST("/example/setValue", "GET", "value=" + Va, "header1:value1", "header2:value2", ...);\r
# Or VAR request := HTTPREQUEST("/example/setValue");
# request.Method := "PUT";
# VAR response := SENDHTTPREQUEST(request);
#r
#
# Send TCP, UDP data:
# VAR data1 := "{\"name\":\"John\", \"age\":" + Va + "}";
# SENDDATA(data1);
# VAR data2 := TOBYTES("{\"name\":\"John\", \"age\":" + Va + "}", "iso-8859-1");
# SENDDATA(data2);
# You can process received TCP or UDP data in the Listener script
#
#
# Upload data to FTP:
# FTPUPLOAD("filePath", "somedata=" + Va, "write"); # use "append" mode to append data to existing file
Read (module)
parsejson(status, "concentration")
Mute Active Alarm Push Button

Silences the alarm buzzer without clearing the alarm state

action push button

Mute Active Alarm

Write button state
sendhttprequest("/mute");
Connection: Packet Parser → HTTP
Possible improvements (7)
  • Self-test state — Self-test progress: not_completed | completed | running | pending — available in /status
  • Sensor state — Sensor operational state: normal | warmup | fault — available in /status
  • Concentration validity — Whether gas reading is valid (false during warmup) — available in /status
  • Valve state — External valve state: opened | closed | not_connected | failure | closing | opening | checking
  • Valve control — Open/close external valve manipulator (11–13V, 500mA jack output)
  • Unmute alarm — Re-enables alarm buzzer after muting
  • WiFi Signal Strength — WiFi RSSI in dBm, available in /status response

Sources