TapHome

Shelly Plug S

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

Shelly Plug S è una presa intelligente Wi-Fi compatta con misuratore di potenza integrato. Si inserisce direttamente in una presa a muro e può commutare carichi fino a 10 A (2300 W a 230 V). TapHome comunica con il dispositivo via HTTP sulla rete locale — non è richiesta nessuna connessione cloud.

Il template fornisce il controllo on/off del relè, un misuratore di energia che legge la potenza in tempo reale e il consumo cumulativo, e il monitoraggio della temperatura interna.

Funzionalità del dispositivo

Controllo relè

Il template espone il relè della presa come un interruttore. Lo stato del relè viene letto da /settings/relay/0 (campo ison) e controllato tramite l’endpoint /relay/0 con turn=on o turn=off. L’intervallo di polling per l’interruttore è 1 secondo.

Il template legge lo stato dell’interruttore da /settings/relay/0 (configurazione persistente) anziché da /status (stato in tempo reale). In condizioni normali entrambi restituiscono lo stesso valore, ma /settings può avere dati leggermente in ritardo dopo commutazioni rapide.

Misurazione della potenza

Il misuratore di energia integrato legge due valori dall’endpoint /meter/0:

  • Potenza in tempo reale — campo power in watt, convertito in kW dal template
  • Consumo totale — campo total in watt-minuti, convertito in kWh dal template

Il misuratore è in sola lettura e si aggiorna ogni 15 secondi (intervallo di polling configurabile).

Monitoraggio della temperatura

Il dispositivo interruttore include un attributo di servizio che legge la temperatura interna della presa dall’endpoint /status. Questo permette di monitorare la temperatura del dispositivo direttamente in TapHome senza configurazione aggiuntiva.

Funzioni non implementate

L’API di Shelly Plug S espone funzionalità aggiuntive non incluse nel template attuale:

  • Flag surriscaldamento — spegnimento automatico del relè a ~95 °C (overtemperature in /status)
  • Controllo LED — abilitazione/disabilitazione del LED di stato tramite /settings
  • Soglia di protezione da sovraccarico — limite di potenza massima configurabile (predefinito 2300 W)
  • Timer di spegnimento automatico — spegnimento automatico del relè dopo un tempo impostato
  • Intensità segnale Wi-Fi — valore RSSI in dBm da /status
  • Riavvio — riavvio del dispositivo tramite l’endpoint /reboot

Queste funzioni possono essere aggiunte in un futuro aggiornamento del template come attributi o azioni di servizio.

Risoluzione dei problemi

Il dispositivo non risponde
  1. Verificare che lo Shelly sia connesso al Wi-Fi e abbia un indirizzo IP valido
  2. Aprire http://{device-ip}/shelly nel browser — se risponde, il dispositivo è raggiungibile
  3. Verificare che TapHome CCU e Shelly siano sulla stessa rete / VLAN
La misurazione della potenza mostra zero
  1. Confermare che il dispositivo collegato allo Shelly Plug S sia acceso
  2. Verificare che il relè sia attivato — il misuratore legge solo quando scorre corrente
  3. Interrogare manualmente /meter/0 e verificare che il campo power restituisca un valore diverso da zero
Spegnimento per surriscaldamento

Lo Shelly Plug S dispone di protezione termica interna. Se la temperatura del dispositivo supera ~95 °C, il relè si spegne automaticamente. Assicurare una ventilazione adeguata intorno alla presa, specialmente quando si commutano dispositivi ad alto assorbimento.

I dispositivi Shelly Gen1 supportano solo 2 connessioni HTTP contemporanee. Se TapHome e un altro sistema (es. Home Assistant) interrogano lo stesso dispositivo simultaneamente, la comunicazione potrebbe diventare inaffidabile. Utilizzare un intervallo di polling di 10–30 secondi per ridurre la contesa delle connessioni.

Come installare in TapHome

Prerequisiti

  • Dispositivo Shelly installato e acceso
  • Rete Wi-Fi locale (2,4 GHz)
  • TapHome CCU sulla stessa rete

Passaggio 1 — Collegare Shelly al Wi-Fi

Opzione A — App Shelly (consigliata):

  1. Scarica l’app Shelly (iOS / Android)
  2. Tocca +Add Device e segui la procedura guidata di associazione Bluetooth
  3. Inserisci le credenziali Wi-Fi quando richiesto

Opzione B — Modalità AP (senza app):

  1. Al primo avvio il dispositivo crea un hotspot: ShellyXXX-AABBCCDDEE
  2. Collega il tuo telefono/PC a questo hotspot
  3. Apri http://192.168.33.1Internet & SecurityWi-Fi Mode - Client
  4. Inserisci SSID e password → Save

Shelly supporta solo reti a 2,4 GHz. Le reti a 5 GHz non appariranno nella scansione.

Passaggio 2 — Trovare l’indirizzo IP

Dopo la connessione al Wi-Fi, trova l’indirizzo IP assegnato tramite uno di questi metodi:

  • App Shelly: Dettaglio dispositivo → Device info → Indirizzo IP
  • Interfaccia web Shelly: Connettiti all’AP del dispositivo prima della configurazione Wi-Fi — l’IP viene mostrato dopo il salvataggio
  • Tabella DHCP del router: Cerca un hostname come shelly1pm-AABBCCDDEE
  • mDNS: Esegui il ping di shelly<model>-<mac>.local (es. shelly1pm-AABBCCDDEE.local) dalla stessa rete

Assegna un IP statico (prenotazione DHCP) nel tuo router per il dispositivo Shelly per evitare che l’indirizzo cambi dopo un riavvio del router.

Passaggio 3 — Configurazione in TapHome

  1. In TapHome, aggiungi un nuovo modulo Packet Parser (HTTP)
  2. IP Address: inserisci l’IP dal passaggio 2 (es. 192.168.1.50)
  3. Port: 80 (predefinito, nessuna modifica necessaria)
  4. Importa il template — TapHome interrogherà periodicamente /status per leggere lo stato del dispositivo

L’autenticazione HTTP è disabilitata per impostazione predefinita sui dispositivi Shelly. Se hai abilitato la protezione con accesso, TapHome attualmente non supporta HTTP Basic Auth — mantieni l’autenticazione disabilitata per l’integrazione con TapHome.

Dispositivi disponibili

Shelly Plug S Modulo
Contatore elettrico Contatore elettrico Solo lettura

Misurazione consumo energetico — potenza istantanea (kW) ed energia cumulativa (kWh)

numeric Unità: kW / kWh

Contatore elettrico

Lettura consumo totale
# Simple HTTP Request:
VAR response := SENDHTTPREQUEST("/meter/0");
IF response.IsSuccess
 VAR content := response.Content;
 VAR responseHeaders := response.Headers;
 return(PARSEJSON(content,"total")/60000);
ELSE
 ADDERROR(response.StatusCode + " (" + response.ReasonPhrase + ")");
 RETURN(NaN);
END
#
# Set Http request method, body and headers
# VAR response := SENDHTTPREQUEST("/example/getValue", "GET", "some data", "header1:value1", "header2:value2", ...);
# OR
# VAR request := HTTPREQUEST("/example/getValue", "POST", "some data");
# request.headers := { "header1:value1", "header2:value2", ...};
# request.method := "GET";
# request.data := null;
# VAR response := SENDHTTPREQUEST(request);
#
#
# Send TCP, UDP data:
# VAR data1 := BYTECOLLECTION("0a bb ea df 01");
# SENDDATA(data1);
# VAR data2 := "{\"name\":\"John\", \"age\":32}";
# SENDDATA(data2);
# VAR data3 := TOBYTES("{\"name\":\"John\", \"age\":32}", "iso-8859-1");
# SENDDATA(data3);
# Process received TCP or UDP data and set device values in the Listener script
#
#
# Download data from FTP:
# FTPDOWNLOAD("filePath");
Lettura domanda
VAR response := SENDHTTPREQUEST("/meter/0");
IF response.IsSuccess
 VAR content := response.Content;
 VAR responseHeaders := response.Headers;
 RETURN(PARSEJSON(content, "power")/1000);
END;


# Simple HTTP Request:
# VAR response := SENDHTTPREQUEST("/example/getValue");
# IF response.IsSuccess
#  VAR content := response.Content;
#  VAR responseHeaders := response.Headers;
#  RETURN(PARSEXML(content, "//element1/value1"));
# ELSE
#  ADDERROR(response.StatusCode + " (" + response.ReasonPhrase + ")");
#  RETURN(NaN);
# END
#
# Set Http request method, body and headers
# VAR response := SENDHTTPREQUEST("/example/getValue", "GET", "some data", "header1:value1", "header2:value2", ...);
# OR
# VAR request := HTTPREQUEST("/example/getValue", "POST", "some data");
# request.headers := { "header1:value1", "header2:value2", ...};
# request.method := "GET";
# request.data := null;
# VAR response := SENDHTTPREQUEST(request);
#
#
# Send TCP, UDP data:
# VAR data1 := BYTECOLLECTION("0a bb ea df 01");
# SENDDATA(data1);
# VAR data2 := "{\"name\":\"John\", \"age\":32}";
# SENDDATA(data2);
# VAR data3 := TOBYTES("{\"name\":\"John\", \"age\":32}", "iso-8859-1");
# SENDDATA(data3);
# Process received TCP or UDP data and set device values in the Listener script
#
#
# Download data from FTP:
# FTPDOWNLOAD("filePath");
Interruttore Interruttore
boolean
Attributi di servizio
Temperatura

Interruttore

Lettura stato interruttore
VAR response := SENDHTTPREQUEST("/settings/relay/0");
IF response.IsSuccess
 VAR content := response.Content;
 VAR responseHeaders := response.Headers;
 return(PARSEJSON(content,"ison"));
ELSE
 ADDERROR(response.StatusCode + " (" + response.ReasonPhrase + ")");
 RETURN(NaN);
END
#
# Set Http request method, body and headers
# VAR response := SENDHTTPREQUEST("/example/getValue", "GET", "some data", "header1:value1", "header2:value2", ...);
# OR
# VAR request := HTTPREQUEST("/example/getValue", "POST", "some data");
# request.headers := { "header1:value1", "header2:value2", ...};
# request.method := "GET";
# request.data := null;
# VAR response := SENDHTTPREQUEST(request);
#
#
# Send TCP, UDP data:
# VAR data1 := BYTECOLLECTION("0a bb ea df 01");
# SENDDATA(data1);
# VAR data2 := "{\"name\":\"John\", \"age\":32}";
# SENDDATA(data2);
# VAR data3 := TOBYTES("{\"name\":\"John\", \"age\":32}", "iso-8859-1");
# SENDDATA(data3);
# Process received TCP or UDP data and set device values in the Listener script
#
#
# Download data from FTP:
# FTPDOWNLOAD("filePath");
Scrittura stato interruttore
# Simple HTTP Request:
#VAR response := SENDHTTPREQUEST("/relay/0?turn=toggle");
VAR response := SENDHTTPREQUEST("/relay/0?turn="+ if(St = 1, "on","off"));
IF response.IsSuccess = false
 ADDERROR(response.StatusCode);
END
# Set Http request method, body and headers
# VAR response := SENDHTTPREQUEST("/example/setValue", "GET", "value=" + St, "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\":" + St + "}";
# SENDDATA(data1);
# VAR data2 := TOBYTES("{\"name\":\"John\", \"age\":" + St + "}", "iso-8859-1");
# SENDDATA(data2);
# You can process received TCP or UDP data in the Listener script
#
#
# Upload data to FTP:
# FTPUPLOAD("filePath", "somedata=" + St, "write"); # use "append" mode to append data to existing file
Attributi di servizio
Temperature
VAR response := SENDHTTPREQUEST("/status");
IF response.IsSuccess
 VAR content := response.Content;
 VAR responseHeaders := response.Headers;
 RETURN(PARSEJSON(content, "temperature"));
END;
Connessione: Packet Parser → HTTP
Possibili miglioramenti (7)
  • Live relay state — Template reads from /settings/relay/0 instead of /status — /status has real-time state
  • Overtemperature flag — Boolean flag in /status, triggers automatic relay shutdown at ~95°C
  • LED control — Enable/disable status LED via settings endpoint
  • Overpower protection threshold — Configurable maximum power limit (default 2300W), could be a service action
  • Auto-off timer — Auto-off timer in seconds, could be added as switch parameter
  • WiFi signal strength — WiFi RSSI in dBm, available in /status response
  • Reboot — Device reboot endpoint, could be added as service action

Fonti