TapHome

TapHome API

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

The TapHome API template is a PacketParser HTTP template that integrates TapHome Core’s own REST API back into TapHome. This enables Core-to-Core communication — devices exposed on one TapHome Core can be mirrored as native devices on another Core. The template communicates over HTTPS (cloud via api.taphome.com:443) or HTTP (local network via http://{core-ip}/api/...), using bearer token authentication.

The template provides 15 unique device types with 15 instances each (225 devices total), covering switches, dimmers, sensors, meters, blinds, lighting, thermostats, and more. Each device reads and writes values using the getDeviceValue and setDeviceValue endpoints with specific valueTypeId parameters.

Configuration

The TapHome API template requires two configuration parameters:

  1. API token — generated in the source Core under Settings > Expose Devices > TapHome API. The token uses a custom bearer format (Authorization: TapHome {token}). Only one token is active at a time — generating a new token invalidates the previous one.

  2. Device ID — each template device instance maps to a specific device ID on the source Core. Use the discovery endpoint (/api/TapHomeApi/v1/discovery) to list all exposed devices with their IDs and supported value types.

The template supports two access modes with identical API structure:

  • Cloudhttps://api.taphome.com/api/TapHomeApi/v1/ (internet access, works from anywhere)
  • Local networkhttp://{core-ip}/api/TapHomeApi/v1/ (LAN/VPN access, lower latency, requires Core 2021.3+)

Local network access eliminates internet dependency and reduces latency. Assign a static IP or DHCP reservation to the source Core since TapHome Core does not support mDNS discovery.

Device capabilities

The template covers 15 device types. Each type uses specific ValueType IDs to read and write device state via the API’s JSON response ($.values[?(@.valueTypeId == N)].value).

Switching and output control
  • Switch — binary on/off control via ValueType 48 (SwitchState). Reads and writes 1 (ON) or 0 (OFF).
  • Analog Output — continuous 0–100 % level via ValueType 42 (AnalogOutputValue). Used for dimmers, valve actuators, or any analog output device.
  • Multi-Value Switch — numeric mode selector with values 0–9 via ValueType 49. Maps to user-defined states for multi-mode device control.
Sensors and metering
  • Analog Input — generic numeric input via ValueType 55 (AnalogInputValue). Read-only.
  • Temperature Sensor — temperature (°C) via ValueType 5 (RealTemperature) and humidity (%) via ValueType 3. Read-only, 15-second poll interval.
  • Brightness Sensor — ambient light level (lux) via ValueType 2. Read-only, 15-second poll interval.
  • Wind Speed Sensor — wind speed (m/s) via ValueType 14. Read-only, 15-second poll interval.
  • Electricity Meter — cumulative energy (kWh) via ValueType 59 and instantaneous demand (kW) via ValueType 60. Read-only, 15-second poll interval.
  • Reed Contact — binary open/closed state via ValueType 44. Returns 1 (Open) or 0 (Closed). Read-only.
Lighting
  • Dual White Light — brightness (%) via ValueType 65 (HueBrightness) and correlated color temperature via ValueType 89 (CCT).
  • RGB Light — full HSB color control: hue (0–360°) via ValueType 40, saturation (0–100 %) via ValueType 41, brightness via ValueType 65, and CCT via ValueType 89.
Climate and covers
  • Thermostat — reads current temperature (ValueType 5), humidity (ValueType 3), and controls the temperature setpoint (ValueType 6).
  • Blind — position level (%) via ValueType 46 (BlindsLevel) and tilt angle via ValueType 10 (BlindsSlope).
  • Slide — position level (%) via ValueType 46 (BlindsLevel). Shares the same ValueType as Blind but without slope control.
General purpose
  • Variable — general-purpose numeric variable via ValueType 62 (VariableState). Can represent any custom value in TapHome.
Service diagnostics

The module exposes one service attribute — Devices — which lists all exposed devices with their IDs and types by calling the /api/TapHomeApi/v1/discovery endpoint.

Sensor-type devices (Brightness, Variable, Wind Speed) include an additional per-device service attribute — Value Types — which lists all ValueType IDs and names available on that specific device.

Additional capabilities

The TapHome API also exposes several system-level ValueTypes not currently polled by the template: Device Status (ID 7) for device health, Operation Mode (ID 22) and Manual Timeout (ID 23) for manual/automatic mode control. Desired-value variants exist for Analog Output (ID 67), Hue Brightness (ID 68), and Multi-Value Switch (ID 71), as well as a Blinds Is Moving indicator (ID 66). The discovery and location endpoints provide diagnostic information about the Core. Webhook push notifications (300 ms throttle) offer a real-time alternative to polling. These capabilities can be added in a future template update.

Troubleshooting

API returns 401 Unauthorized
  1. Verify the token is correct and has not been regenerated — generating a new token invalidates all previous tokens
  2. Check the authorization header format: Authorization: TapHome {token} (note the TapHome prefix instead of Bearer)
  3. Ensure the token belongs to the correct Core location
API returns 403 Forbidden

The requested device is not exposed via TapHome API. In the source Core, navigate to Settings > Expose Devices > TapHome API and verify the device is listed.

Cached or stale values

The API rate-limits getDeviceValue requests to 500 ms intervals. Requests faster than this may return cached values. Compare the timestamp field in the response — identical timestamps indicate cached data. Increase the poll interval to at least 1 second.

Write requests return HTTP 503

The setDeviceValue endpoint returns 503 (Service Unavailable) if called more frequently than every 500 ms. Space out write requests or queue them with sufficient delay.

Only one API token is active per Core at any time. If another system regenerates the token (e.g., during Home Assistant setup), the TapHome template will lose access. Coordinate token usage across all integrations.

Available devices

TapHome API Module
Service Attributes
Devices
Custom Variables
API_token (string)TapHome API bearer token for authentication (generate in TapHome app under Settings → API)

TapHome API

Service Attributes
Devices
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/discovery", "GET", "", "Authorization: TapHome " + API_token);
IF response.IsSuccess
    var max := PARSEJSON(response.content, "$.devices[-1:].deviceId");
    var ret := "";
    var i := 0;
    do
        ret := ret + "(" + PARSEJSON(response.content, "$.devices[" + tostring(i) + "].deviceId", true) + ") ";
        ret := ret + PARSEJSON(response.content, "$.devices[" + tostring(i) + "].name", true);
        ret := ret + " - " + PARSEJSON(response.content, "$.devices[" + tostring(i) + "].type", true);
        ret := ret + "\n";
        i := i + 1;
    loop while i < max
    
    RETURN(ret);
END
Analog Input (1) Analog Input Read-only
numeric json_path
Variable: IdTapHome device ID — set to the ID of the device you want to control (find in TapHome app or via /discovery endpoint)

Analog Input (1)

Read input level
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 55)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Analog Output (1) Dimmer

Continuous output level (0-100 %) for dimmers, valve actuators, or analog output devices

numeric Unit: % json_path
Variable: IdTapHome device ID — set to the ID of the device you want to control (find in TapHome app or via /discovery endpoint)

Analog Output (1)

Read level
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 42)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Write level
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/setDeviceValue/" + Id + "?valueTypeId=42&value=" + Le, "GET", "", "Authorization: TapHome " + API_token);
IF(!response.IsSuccess)
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Switch (1) Switch
numeric json_path
Values / States: ON · OFF
Variable: IdTapHome device ID — set to the ID of the device you want to control (find in TapHome app or via /discovery endpoint)

Switch (1)

Read switch state
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 48)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Write switch state
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/setDeviceValue/" + Id + "?valueTypeId=48&value=" + St, "GET", "", "Authorization: TapHome " + API_token);
IF(!response.IsSuccess)
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Dual White Light (1) White Light

Brightness and correlated color temperature (CCT) control for tunable white lighting

numeric json_path
Variable: IdTapHome device ID — set to the ID of the device you want to control (find in TapHome app or via /discovery endpoint)

Dual White Light (1)

Read brightness
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 65)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Write brightness
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/setDeviceValue/" + Id + "?valueTypeId=65&value=" + Hb, "GET", "", "Authorization: TapHome " + API_token);
IF(!response.IsSuccess)
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Read color temperature
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 89)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Write color temperature
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/setDeviceValue/" + Id + "?valueTypeId=89&value=" + Ct, "GET", "", "Authorization: TapHome " + API_token);
IF(!response.IsSuccess)
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Electricity Meter (1) Electricity Meter Read-only

Cumulative energy consumption (kWh) and instantaneous power demand (kW)

numeric Unit: kWh / kW json_path
Variable: IdTapHome device ID — set to the ID of the device you want to control (find in TapHome app or via /discovery endpoint)

Electricity Meter (1)

Read total consumption
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 59)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Read demand
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 60)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Brightness Sensor (1) Variable Read-only
numeric Unit: lux json_path
Service Attributes
Value Types
Variable: IdTapHome device ID — set to the ID of the device you want to control (find in TapHome app or via /discovery endpoint)

Brightness Sensor (1)

Read
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 2)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Service Attributes
Value Types
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
    var ret := "";
    var i := 0;
    do
        if ! isnull(PARSEJSON(response.content, "$.values[" + i + "].valueTypeId", true))
            ret := ret + PARSEJSON(response.content, "$.values[" + i + "].valueTypeId", true);
            ret := ret + " - " + PARSEJSON(response.content, "$.values[" + i + "].valueTypeName", true);
            ret := ret + "\n";
        end
        i := i + 1;
    loop while i < 10
    RETURN(ret);
END

Variable (1) Variable
numeric json_path
Service Attributes
Value Types
Variable: IdTapHome device ID — set to the ID of the device you want to control (find in TapHome app or via /discovery endpoint)

Variable (1)

Read
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 62)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Write
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/setDeviceValue/" + Id + "?valueTypeId=62&value=" + Va, "GET", "", "Authorization: TapHome " + API_token);
IF(!response.IsSuccess)
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Service Attributes
Value Types
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
    var ret := "";
    var i := 0;
    do
        if ! isnull(PARSEJSON(response.content, "$.values[" + i + "].valueTypeId", true))
            ret := ret + PARSEJSON(response.content, "$.values[" + i + "].valueTypeId", true);
            ret := ret + " - " + PARSEJSON(response.content, "$.values[" + i + "].valueTypeName", true);
            ret := ret + "\n";
        end
        i := i + 1;
    loop while i < 10
    RETURN(ret);
END

RGB Light (1) HSB Light

Full HSB color control — hue, saturation, brightness, and correlated color temperature

numeric json_path
Variable: IdTapHome device ID — set to the ID of the device you want to control (find in TapHome app or via /discovery endpoint)

RGB Light (1)

Read brightness
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 65)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Write brightness
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/setDeviceValue/" + Id + "?valueTypeId=65&value=" + Hb, "GET", "", "Authorization: TapHome " + API_token);
IF(!response.IsSuccess)
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Read hue
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 40)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Write hue
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/setDeviceValue/" + Id + "?valueTypeId=40&value=" + Hd, "GET", "", "Authorization: TapHome " + API_token);
IF(!response.IsSuccess)
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Read saturation
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 41)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Write saturation
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/setDeviceValue/" + Id + "?valueTypeId=41&value=" + Sa, "GET", "", "Authorization: TapHome " + API_token);
IF(!response.IsSuccess)
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Read color temperature
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 89)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Write color temperature
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/setDeviceValue/" + Id + "?valueTypeId=89&value=" + Ct, "GET", "", "Authorization: TapHome " + API_token);
IF(!response.IsSuccess)
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Slide (1) Slide
numeric Unit: % json_path
Variable: IdTapHome device ID — set to the ID of the device you want to control (find in TapHome app or via /discovery endpoint)

Slide (1)

Read blind level
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 46)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Write blind level
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/setDeviceValue/" + Id + "?valueTypeId=46&value=" + Bl, "GET", "", "Authorization: TapHome " + API_token);
IF(!response.IsSuccess)
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Wind Speed Sensor (1) Variable Read-only
numeric Unit: m/s json_path
Service Attributes
Value Types
Variable: IdTapHome device ID — set to the ID of the device you want to control (find in TapHome app or via /discovery endpoint)

Wind Speed Sensor (1)

Read
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 14)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Service Attributes
Value Types
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
    var ret := "";
    var i := 0;
    do
        if ! isnull(PARSEJSON(response.content, "$.values[" + i + "].valueTypeId", true))
            ret := ret + PARSEJSON(response.content, "$.values[" + i + "].valueTypeId", true);
            ret := ret + " - " + PARSEJSON(response.content, "$.values[" + i + "].valueTypeName", true);
            ret := ret + "\n";
        end
        i := i + 1;
    loop while i < 10
    RETURN(ret);
END

Reed Contact (1) Reed Contact Read-only
numeric json_path
Variable: IdTapHome device ID — set to the ID of the device you want to control (find in TapHome app or via /discovery endpoint)

Reed Contact (1)

Read
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 44)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Temperature Sensor (1) Temperature Sensor Read-only

Temperature (°C) and humidity (%) readings

numeric Unit: °C / % json_path
Variable: IdTapHome device ID — set to the ID of the device you want to control (find in TapHome app or via /discovery endpoint)

Temperature Sensor (1)

Read humidity
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 3)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Read temperature
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 5)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Thermostat (1) Thermostat

Current temperature, humidity, and adjustable temperature setpoint

numeric Unit: °C json_path
Variable: IdTapHome device ID — set to the ID of the device you want to control (find in TapHome app or via /discovery endpoint)

Thermostat (1)

Read temperature
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 5)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Read humidity
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 3)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Read desired temperature
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 6)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Write desired temperature
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/setDeviceValue/" + Id + "?valueTypeId=6&value=" + Se, "GET", "", "Authorization: TapHome " + API_token);
IF(!response.IsSuccess)
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Multi-Value Switch (1) Multi-value Switch

Numeric mode selector with values 0-9 for multi-mode device control

numeric json_path
Variable: IdTapHome device ID — set to the ID of the device you want to control (find in TapHome app or via /discovery endpoint)

Multi-Value Switch (1)

Read switch state
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 49)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Write switch state
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/setDeviceValue/" + Id + "?valueTypeId=49&value=" + Mu, "GET", "", "Authorization: TapHome " + API_token);
IF(!response.IsSuccess)
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Blind (1) Blind

Position level (%) and tilt angle control for blinds and shutters

numeric Unit: % json_path
Variable: IdTapHome device ID — set to the ID of the device you want to control (find in TapHome app or via /discovery endpoint)

Blind (1)

Read blind level
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 46)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Write blind level
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/setDeviceValue/" + Id + "?valueTypeId=46&value=" + Bl, "GET", "", "Authorization: TapHome " + API_token);
IF(!response.IsSuccess)
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Read blind slope
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 10)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Write blind slope
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/setDeviceValue/" + Id + "?valueTypeId=10&value=" + Bs, "GET", "", "Authorization: TapHome " + API_token);
IF(!response.IsSuccess)
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Analog Input (2) Analog Input Read-only
numeric json_path
Variable: IdTapHome device ID — set to the ID of the device you want to control (find in TapHome app or via /discovery endpoint)

Analog Input (2)

Read input level
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 55)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Analog Output (2) Dimmer

Continuous output level (0-100 %) for dimmers, valve actuators, or analog output devices

numeric Unit: % json_path
Variable: IdTapHome device ID — set to the ID of the device you want to control (find in TapHome app or via /discovery endpoint)

Analog Output (2)

Read level
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 42)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Write level
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/setDeviceValue/" + Id + "?valueTypeId=42&value=" + Le, "GET", "", "Authorization: TapHome " + API_token);
IF(!response.IsSuccess)
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Switch (2) Switch
numeric json_path
Values / States: ON · OFF
Variable: IdTapHome device ID — set to the ID of the device you want to control (find in TapHome app or via /discovery endpoint)

Switch (2)

Read switch state
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 48)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Write switch state
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/setDeviceValue/" + Id + "?valueTypeId=48&value=" + St, "GET", "", "Authorization: TapHome " + API_token);
IF(!response.IsSuccess)
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Dual White Light (2) White Light

Brightness and correlated color temperature (CCT) control for tunable white lighting

numeric json_path
Variable: IdTapHome device ID — set to the ID of the device you want to control (find in TapHome app or via /discovery endpoint)

Dual White Light (2)

Read brightness
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 65)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Write brightness
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/setDeviceValue/" + Id + "?valueTypeId=65&value=" + Hb, "GET", "", "Authorization: TapHome " + API_token);
IF(!response.IsSuccess)
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Read color temperature
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 89)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Write color temperature
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/setDeviceValue/" + Id + "?valueTypeId=89&value=" + Ct, "GET", "", "Authorization: TapHome " + API_token);
IF(!response.IsSuccess)
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Electricity Meter (2) Electricity Meter Read-only

Cumulative energy consumption (kWh) and instantaneous power demand (kW)

numeric Unit: kWh / kW json_path
Variable: IdTapHome device ID — set to the ID of the device you want to control (find in TapHome app or via /discovery endpoint)

Electricity Meter (2)

Read total consumption
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 59)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Read demand
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 60)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Brightness Sensor (2) Variable Read-only
numeric Unit: lux json_path
Service Attributes
Value Types
Variable: IdTapHome device ID — set to the ID of the device you want to control (find in TapHome app or via /discovery endpoint)

Brightness Sensor (2)

Read
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 2)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Service Attributes
Value Types
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
    var ret := "";
    var i := 0;
    do
        if ! isnull(PARSEJSON(response.content, "$.values[" + i + "].valueTypeId", true))
            ret := ret + PARSEJSON(response.content, "$.values[" + i + "].valueTypeId", true);
            ret := ret + " - " + PARSEJSON(response.content, "$.values[" + i + "].valueTypeName", true);
            ret := ret + "\n";
        end
        i := i + 1;
    loop while i < 10
    RETURN(ret);
END

Variable (2) Variable
numeric json_path
Service Attributes
Value Types
Variable: IdTapHome device ID — set to the ID of the device you want to control (find in TapHome app or via /discovery endpoint)

Variable (2)

Read
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 62)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Write
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/setDeviceValue/" + Id + "?valueTypeId=62&value=" + Va, "GET", "", "Authorization: TapHome " + API_token);
IF(!response.IsSuccess)
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Service Attributes
Value Types
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
    var ret := "";
    var i := 0;
    do
        if ! isnull(PARSEJSON(response.content, "$.values[" + i + "].valueTypeId", true))
            ret := ret + PARSEJSON(response.content, "$.values[" + i + "].valueTypeId", true);
            ret := ret + " - " + PARSEJSON(response.content, "$.values[" + i + "].valueTypeName", true);
            ret := ret + "\n";
        end
        i := i + 1;
    loop while i < 10
    RETURN(ret);
END

RGB Light (2) HSB Light

Full HSB color control — hue, saturation, brightness, and correlated color temperature

numeric json_path
Variable: IdTapHome device ID — set to the ID of the device you want to control (find in TapHome app or via /discovery endpoint)

RGB Light (2)

Read brightness
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 65)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Write brightness
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/setDeviceValue/" + Id + "?valueTypeId=65&value=" + Hb, "GET", "", "Authorization: TapHome " + API_token);
IF(!response.IsSuccess)
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Read hue
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 40)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Write hue
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/setDeviceValue/" + Id + "?valueTypeId=40&value=" + Hd, "GET", "", "Authorization: TapHome " + API_token);
IF(!response.IsSuccess)
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Read saturation
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 41)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Write saturation
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/setDeviceValue/" + Id + "?valueTypeId=41&value=" + Sa, "GET", "", "Authorization: TapHome " + API_token);
IF(!response.IsSuccess)
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Read color temperature
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 89)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Write color temperature
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/setDeviceValue/" + Id + "?valueTypeId=89&value=" + Ct, "GET", "", "Authorization: TapHome " + API_token);
IF(!response.IsSuccess)
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Slide (2) Slide
numeric Unit: % json_path
Variable: IdTapHome device ID — set to the ID of the device you want to control (find in TapHome app or via /discovery endpoint)

Slide (2)

Read blind level
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 46)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Write blind level
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/setDeviceValue/" + Id + "?valueTypeId=46&value=" + Bl, "GET", "", "Authorization: TapHome " + API_token);
IF(!response.IsSuccess)
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Wind Speed Sensor (2) Variable Read-only
numeric Unit: m/s json_path
Service Attributes
Value Types
Variable: IdTapHome device ID — set to the ID of the device you want to control (find in TapHome app or via /discovery endpoint)

Wind Speed Sensor (2)

Read
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 14)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Service Attributes
Value Types
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
    var ret := "";
    var i := 0;
    do
        if ! isnull(PARSEJSON(response.content, "$.values[" + i + "].valueTypeId", true))
            ret := ret + PARSEJSON(response.content, "$.values[" + i + "].valueTypeId", true);
            ret := ret + " - " + PARSEJSON(response.content, "$.values[" + i + "].valueTypeName", true);
            ret := ret + "\n";
        end
        i := i + 1;
    loop while i < 10
    RETURN(ret);
END

Reed Contact (2) Reed Contact Read-only
numeric json_path
Variable: IdTapHome device ID — set to the ID of the device you want to control (find in TapHome app or via /discovery endpoint)

Reed Contact (2)

Read
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 44)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Temperature Sensor (2) Temperature Sensor Read-only

Temperature (°C) and humidity (%) readings

numeric Unit: °C / % json_path
Variable: IdTapHome device ID — set to the ID of the device you want to control (find in TapHome app or via /discovery endpoint)

Temperature Sensor (2)

Read humidity
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 3)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Read temperature
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 5)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Thermostat (2) Thermostat

Current temperature, humidity, and adjustable temperature setpoint

numeric Unit: °C json_path
Variable: IdTapHome device ID — set to the ID of the device you want to control (find in TapHome app or via /discovery endpoint)

Thermostat (2)

Read temperature
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 5)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Read humidity
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 3)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Read desired temperature
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 6)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Write desired temperature
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/setDeviceValue/" + Id + "?valueTypeId=6&value=" + Se, "GET", "", "Authorization: TapHome " + API_token);
IF(!response.IsSuccess)
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Multi-Value Switch (2) Multi-value Switch

Numeric mode selector with values 0-9 for multi-mode device control

numeric json_path
Variable: IdTapHome device ID — set to the ID of the device you want to control (find in TapHome app or via /discovery endpoint)

Multi-Value Switch (2)

Read switch state
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 49)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Write switch state
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/setDeviceValue/" + Id + "?valueTypeId=49&value=" + Mu, "GET", "", "Authorization: TapHome " + API_token);
IF(!response.IsSuccess)
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Blind (2) Blind

Position level (%) and tilt angle control for blinds and shutters

numeric Unit: % json_path
Variable: IdTapHome device ID — set to the ID of the device you want to control (find in TapHome app or via /discovery endpoint)

Blind (2)

Read blind level
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 46)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Write blind level
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/setDeviceValue/" + Id + "?valueTypeId=46&value=" + Bl, "GET", "", "Authorization: TapHome " + API_token);
IF(!response.IsSuccess)
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Read blind slope
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 10)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Write blind slope
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/setDeviceValue/" + Id + "?valueTypeId=10&value=" + Bs, "GET", "", "Authorization: TapHome " + API_token);
IF(!response.IsSuccess)
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Analog Input (3) Analog Input Read-only
numeric json_path
Variable: IdTapHome device ID — set to the ID of the device you want to control (find in TapHome app or via /discovery endpoint)

Analog Input (3)

Read input level
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 55)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Analog Output (3) Dimmer

Continuous output level (0-100 %) for dimmers, valve actuators, or analog output devices

numeric Unit: % json_path
Variable: IdTapHome device ID — set to the ID of the device you want to control (find in TapHome app or via /discovery endpoint)

Analog Output (3)

Read level
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 42)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Write level
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/setDeviceValue/" + Id + "?valueTypeId=42&value=" + Le, "GET", "", "Authorization: TapHome " + API_token);
IF(!response.IsSuccess)
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Switch (3) Switch
numeric json_path
Values / States: ON · OFF
Variable: IdTapHome device ID — set to the ID of the device you want to control (find in TapHome app or via /discovery endpoint)

Switch (3)

Read switch state
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 48)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Write switch state
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/setDeviceValue/" + Id + "?valueTypeId=48&value=" + St, "GET", "", "Authorization: TapHome " + API_token);
IF(!response.IsSuccess)
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Dual White Light (3) White Light

Brightness and correlated color temperature (CCT) control for tunable white lighting

numeric json_path
Variable: IdTapHome device ID — set to the ID of the device you want to control (find in TapHome app or via /discovery endpoint)

Dual White Light (3)

Read brightness
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 65)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Write brightness
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/setDeviceValue/" + Id + "?valueTypeId=65&value=" + Hb, "GET", "", "Authorization: TapHome " + API_token);
IF(!response.IsSuccess)
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Read color temperature
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 89)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Write color temperature
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/setDeviceValue/" + Id + "?valueTypeId=89&value=" + Ct, "GET", "", "Authorization: TapHome " + API_token);
IF(!response.IsSuccess)
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Electricity Meter (3) Electricity Meter Read-only

Cumulative energy consumption (kWh) and instantaneous power demand (kW)

numeric Unit: kWh / kW json_path
Variable: IdTapHome device ID — set to the ID of the device you want to control (find in TapHome app or via /discovery endpoint)

Electricity Meter (3)

Read total consumption
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 59)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Read demand
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 60)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Brightness Sensor (3) Variable Read-only
numeric Unit: lux json_path
Service Attributes
Value Types
Variable: IdTapHome device ID — set to the ID of the device you want to control (find in TapHome app or via /discovery endpoint)

Brightness Sensor (3)

Read
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 2)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Service Attributes
Value Types
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
    var ret := "";
    var i := 0;
    do
        if ! isnull(PARSEJSON(response.content, "$.values[" + i + "].valueTypeId", true))
            ret := ret + PARSEJSON(response.content, "$.values[" + i + "].valueTypeId", true);
            ret := ret + " - " + PARSEJSON(response.content, "$.values[" + i + "].valueTypeName", true);
            ret := ret + "\n";
        end
        i := i + 1;
    loop while i < 10
    RETURN(ret);
END

Variable (3) Variable
numeric json_path
Service Attributes
Value Types
Variable: IdTapHome device ID — set to the ID of the device you want to control (find in TapHome app or via /discovery endpoint)

Variable (3)

Read
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 62)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Write
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/setDeviceValue/" + Id + "?valueTypeId=62&value=" + Va, "GET", "", "Authorization: TapHome " + API_token);
IF(!response.IsSuccess)
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Service Attributes
Value Types
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
    var ret := "";
    var i := 0;
    do
        if ! isnull(PARSEJSON(response.content, "$.values[" + i + "].valueTypeId", true))
            ret := ret + PARSEJSON(response.content, "$.values[" + i + "].valueTypeId", true);
            ret := ret + " - " + PARSEJSON(response.content, "$.values[" + i + "].valueTypeName", true);
            ret := ret + "\n";
        end
        i := i + 1;
    loop while i < 10
    RETURN(ret);
END

RGB Light (3) HSB Light

Full HSB color control — hue, saturation, brightness, and correlated color temperature

numeric json_path
Variable: IdTapHome device ID — set to the ID of the device you want to control (find in TapHome app or via /discovery endpoint)

RGB Light (3)

Read brightness
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 65)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Write brightness
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/setDeviceValue/" + Id + "?valueTypeId=65&value=" + Hb, "GET", "", "Authorization: TapHome " + API_token);
IF(!response.IsSuccess)
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Read hue
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 40)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Write hue
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/setDeviceValue/" + Id + "?valueTypeId=40&value=" + Hd, "GET", "", "Authorization: TapHome " + API_token);
IF(!response.IsSuccess)
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Read saturation
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 41)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Write saturation
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/setDeviceValue/" + Id + "?valueTypeId=41&value=" + Sa, "GET", "", "Authorization: TapHome " + API_token);
IF(!response.IsSuccess)
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Read color temperature
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 89)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Write color temperature
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/setDeviceValue/" + Id + "?valueTypeId=89&value=" + Ct, "GET", "", "Authorization: TapHome " + API_token);
IF(!response.IsSuccess)
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Slide (3) Slide
numeric Unit: % json_path
Variable: IdTapHome device ID — set to the ID of the device you want to control (find in TapHome app or via /discovery endpoint)

Slide (3)

Read blind level
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 46)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Write blind level
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/setDeviceValue/" + Id + "?valueTypeId=46&value=" + Bl, "GET", "", "Authorization: TapHome " + API_token);
IF(!response.IsSuccess)
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Wind Speed Sensor (3) Variable Read-only
numeric Unit: m/s json_path
Service Attributes
Value Types
Variable: IdTapHome device ID — set to the ID of the device you want to control (find in TapHome app or via /discovery endpoint)

Wind Speed Sensor (3)

Read
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 14)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Service Attributes
Value Types
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
    var ret := "";
    var i := 0;
    do
        if ! isnull(PARSEJSON(response.content, "$.values[" + i + "].valueTypeId", true))
            ret := ret + PARSEJSON(response.content, "$.values[" + i + "].valueTypeId", true);
            ret := ret + " - " + PARSEJSON(response.content, "$.values[" + i + "].valueTypeName", true);
            ret := ret + "\n";
        end
        i := i + 1;
    loop while i < 10
    RETURN(ret);
END

Reed Contact (3) Reed Contact Read-only
numeric json_path
Variable: IdTapHome device ID — set to the ID of the device you want to control (find in TapHome app or via /discovery endpoint)

Reed Contact (3)

Read
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 44)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Temperature Sensor (3) Temperature Sensor Read-only

Temperature (°C) and humidity (%) readings

numeric Unit: °C / % json_path
Variable: IdTapHome device ID — set to the ID of the device you want to control (find in TapHome app or via /discovery endpoint)

Temperature Sensor (3)

Read humidity
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 3)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Read temperature
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 5)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Thermostat (3) Thermostat

Current temperature, humidity, and adjustable temperature setpoint

numeric Unit: °C json_path
Variable: IdTapHome device ID — set to the ID of the device you want to control (find in TapHome app or via /discovery endpoint)

Thermostat (3)

Read temperature
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 5)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Read humidity
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 3)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Read desired temperature
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 6)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Write desired temperature
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/setDeviceValue/" + Id + "?valueTypeId=6&value=" + Se, "GET", "", "Authorization: TapHome " + API_token);
IF(!response.IsSuccess)
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Multi-Value Switch (3) Multi-value Switch

Numeric mode selector with values 0-9 for multi-mode device control

numeric json_path
Variable: IdTapHome device ID — set to the ID of the device you want to control (find in TapHome app or via /discovery endpoint)

Multi-Value Switch (3)

Read switch state
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 49)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Write switch state
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/setDeviceValue/" + Id + "?valueTypeId=49&value=" + Mu, "GET", "", "Authorization: TapHome " + API_token);
IF(!response.IsSuccess)
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Blind (3) Blind

Position level (%) and tilt angle control for blinds and shutters

numeric Unit: % json_path
Variable: IdTapHome device ID — set to the ID of the device you want to control (find in TapHome app or via /discovery endpoint)

Blind (3)

Read blind level
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 46)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Write blind level
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/setDeviceValue/" + Id + "?valueTypeId=46&value=" + Bl, "GET", "", "Authorization: TapHome " + API_token);
IF(!response.IsSuccess)
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Read blind slope
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 10)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Write blind slope
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/setDeviceValue/" + Id + "?valueTypeId=10&value=" + Bs, "GET", "", "Authorization: TapHome " + API_token);
IF(!response.IsSuccess)
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Analog Input (4) Analog Input Read-only
numeric json_path
Variable: IdTapHome device ID — set to the ID of the device you want to control (find in TapHome app or via /discovery endpoint)

Analog Input (4)

Read input level
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 55)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Analog Output (4) Dimmer

Continuous output level (0-100 %) for dimmers, valve actuators, or analog output devices

numeric Unit: % json_path
Variable: IdTapHome device ID — set to the ID of the device you want to control (find in TapHome app or via /discovery endpoint)

Analog Output (4)

Read level
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 42)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Write level
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/setDeviceValue/" + Id + "?valueTypeId=42&value=" + Le, "GET", "", "Authorization: TapHome " + API_token);
IF(!response.IsSuccess)
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Switch (4) Switch
numeric json_path
Values / States: ON · OFF
Variable: IdTapHome device ID — set to the ID of the device you want to control (find in TapHome app or via /discovery endpoint)

Switch (4)

Read switch state
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 48)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Write switch state
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/setDeviceValue/" + Id + "?valueTypeId=48&value=" + St, "GET", "", "Authorization: TapHome " + API_token);
IF(!response.IsSuccess)
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Dual White Light (4) White Light

Brightness and correlated color temperature (CCT) control for tunable white lighting

numeric json_path
Variable: IdTapHome device ID — set to the ID of the device you want to control (find in TapHome app or via /discovery endpoint)

Dual White Light (4)

Read brightness
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 65)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Write brightness
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/setDeviceValue/" + Id + "?valueTypeId=65&value=" + Hb, "GET", "", "Authorization: TapHome " + API_token);
IF(!response.IsSuccess)
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Read color temperature
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 89)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Write color temperature
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/setDeviceValue/" + Id + "?valueTypeId=89&value=" + Ct, "GET", "", "Authorization: TapHome " + API_token);
IF(!response.IsSuccess)
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Electricity Meter (4) Electricity Meter Read-only

Cumulative energy consumption (kWh) and instantaneous power demand (kW)

numeric Unit: kWh / kW json_path
Variable: IdTapHome device ID — set to the ID of the device you want to control (find in TapHome app or via /discovery endpoint)

Electricity Meter (4)

Read total consumption
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 59)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Read demand
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 60)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Brightness Sensor (4) Variable Read-only
numeric Unit: lux json_path
Service Attributes
Value Types
Variable: IdTapHome device ID — set to the ID of the device you want to control (find in TapHome app or via /discovery endpoint)

Brightness Sensor (4)

Read
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 2)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Service Attributes
Value Types
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
    var ret := "";
    var i := 0;
    do
        if ! isnull(PARSEJSON(response.content, "$.values[" + i + "].valueTypeId", true))
            ret := ret + PARSEJSON(response.content, "$.values[" + i + "].valueTypeId", true);
            ret := ret + " - " + PARSEJSON(response.content, "$.values[" + i + "].valueTypeName", true);
            ret := ret + "\n";
        end
        i := i + 1;
    loop while i < 10
    RETURN(ret);
END

Variable (4) Variable
numeric json_path
Service Attributes
Value Types
Variable: IdTapHome device ID — set to the ID of the device you want to control (find in TapHome app or via /discovery endpoint)

Variable (4)

Read
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 62)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Write
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/setDeviceValue/" + Id + "?valueTypeId=62&value=" + Va, "GET", "", "Authorization: TapHome " + API_token);
IF(!response.IsSuccess)
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Service Attributes
Value Types
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
    var ret := "";
    var i := 0;
    do
        if ! isnull(PARSEJSON(response.content, "$.values[" + i + "].valueTypeId", true))
            ret := ret + PARSEJSON(response.content, "$.values[" + i + "].valueTypeId", true);
            ret := ret + " - " + PARSEJSON(response.content, "$.values[" + i + "].valueTypeName", true);
            ret := ret + "\n";
        end
        i := i + 1;
    loop while i < 10
    RETURN(ret);
END

RGB Light (4) HSB Light

Full HSB color control — hue, saturation, brightness, and correlated color temperature

numeric json_path
Variable: IdTapHome device ID — set to the ID of the device you want to control (find in TapHome app or via /discovery endpoint)

RGB Light (4)

Read brightness
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 65)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Write brightness
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/setDeviceValue/" + Id + "?valueTypeId=65&value=" + Hb, "GET", "", "Authorization: TapHome " + API_token);
IF(!response.IsSuccess)
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Read hue
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 40)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Write hue
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/setDeviceValue/" + Id + "?valueTypeId=40&value=" + Hd, "GET", "", "Authorization: TapHome " + API_token);
IF(!response.IsSuccess)
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Read saturation
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 41)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Write saturation
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/setDeviceValue/" + Id + "?valueTypeId=41&value=" + Sa, "GET", "", "Authorization: TapHome " + API_token);
IF(!response.IsSuccess)
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Read color temperature
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 89)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Write color temperature
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/setDeviceValue/" + Id + "?valueTypeId=89&value=" + Ct, "GET", "", "Authorization: TapHome " + API_token);
IF(!response.IsSuccess)
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Slide (4) Slide
numeric Unit: % json_path
Variable: IdTapHome device ID — set to the ID of the device you want to control (find in TapHome app or via /discovery endpoint)

Slide (4)

Read blind level
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 46)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Write blind level
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/setDeviceValue/" + Id + "?valueTypeId=46&value=" + Bl, "GET", "", "Authorization: TapHome " + API_token);
IF(!response.IsSuccess)
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Wind Speed Sensor (4) Variable Read-only
numeric Unit: m/s json_path
Service Attributes
Value Types
Variable: IdTapHome device ID — set to the ID of the device you want to control (find in TapHome app or via /discovery endpoint)

Wind Speed Sensor (4)

Read
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 14)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Service Attributes
Value Types
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
    var ret := "";
    var i := 0;
    do
        if ! isnull(PARSEJSON(response.content, "$.values[" + i + "].valueTypeId", true))
            ret := ret + PARSEJSON(response.content, "$.values[" + i + "].valueTypeId", true);
            ret := ret + " - " + PARSEJSON(response.content, "$.values[" + i + "].valueTypeName", true);
            ret := ret + "\n";
        end
        i := i + 1;
    loop while i < 10
    RETURN(ret);
END

Reed Contact (4) Reed Contact Read-only
numeric json_path
Variable: IdTapHome device ID — set to the ID of the device you want to control (find in TapHome app or via /discovery endpoint)

Reed Contact (4)

Read
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 44)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Temperature Sensor (4) Temperature Sensor Read-only

Temperature (°C) and humidity (%) readings

numeric Unit: °C / % json_path
Variable: IdTapHome device ID — set to the ID of the device you want to control (find in TapHome app or via /discovery endpoint)

Temperature Sensor (4)

Read humidity
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 3)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Read temperature
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 5)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Thermostat (4) Thermostat

Current temperature, humidity, and adjustable temperature setpoint

numeric Unit: °C json_path
Variable: IdTapHome device ID — set to the ID of the device you want to control (find in TapHome app or via /discovery endpoint)

Thermostat (4)

Read temperature
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 5)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Read humidity
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 3)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Read desired temperature
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 6)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Write desired temperature
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/setDeviceValue/" + Id + "?valueTypeId=6&value=" + Se, "GET", "", "Authorization: TapHome " + API_token);
IF(!response.IsSuccess)
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Multi-Value Switch (4) Multi-value Switch

Numeric mode selector with values 0-9 for multi-mode device control

numeric json_path
Variable: IdTapHome device ID — set to the ID of the device you want to control (find in TapHome app or via /discovery endpoint)

Multi-Value Switch (4)

Read switch state
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 49)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Write switch state
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/setDeviceValue/" + Id + "?valueTypeId=49&value=" + Mu, "GET", "", "Authorization: TapHome " + API_token);
IF(!response.IsSuccess)
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Blind (4) Blind

Position level (%) and tilt angle control for blinds and shutters

numeric Unit: % json_path
Variable: IdTapHome device ID — set to the ID of the device you want to control (find in TapHome app or via /discovery endpoint)

Blind (4)

Read blind level
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 46)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Write blind level
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/setDeviceValue/" + Id + "?valueTypeId=46&value=" + Bl, "GET", "", "Authorization: TapHome " + API_token);
IF(!response.IsSuccess)
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Read blind slope
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 10)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Write blind slope
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/setDeviceValue/" + Id + "?valueTypeId=10&value=" + Bs, "GET", "", "Authorization: TapHome " + API_token);
IF(!response.IsSuccess)
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Analog Input (5) Analog Input Read-only
numeric json_path
Variable: IdTapHome device ID — set to the ID of the device you want to control (find in TapHome app or via /discovery endpoint)

Analog Input (5)

Read input level
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 55)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Analog Output (5) Dimmer

Continuous output level (0-100 %) for dimmers, valve actuators, or analog output devices

numeric Unit: % json_path
Variable: IdTapHome device ID — set to the ID of the device you want to control (find in TapHome app or via /discovery endpoint)

Analog Output (5)

Read level
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 42)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Write level
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/setDeviceValue/" + Id + "?valueTypeId=42&value=" + Le, "GET", "", "Authorization: TapHome " + API_token);
IF(!response.IsSuccess)
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Switch (5) Switch
numeric json_path
Values / States: ON · OFF
Variable: IdTapHome device ID — set to the ID of the device you want to control (find in TapHome app or via /discovery endpoint)

Switch (5)

Read switch state
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 48)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Write switch state
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/setDeviceValue/" + Id + "?valueTypeId=48&value=" + St, "GET", "", "Authorization: TapHome " + API_token);
IF(!response.IsSuccess)
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Dual White Light (5) White Light

Brightness and correlated color temperature (CCT) control for tunable white lighting

numeric json_path
Variable: IdTapHome device ID — set to the ID of the device you want to control (find in TapHome app or via /discovery endpoint)

Dual White Light (5)

Read brightness
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 65)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Write brightness
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/setDeviceValue/" + Id + "?valueTypeId=65&value=" + Hb, "GET", "", "Authorization: TapHome " + API_token);
IF(!response.IsSuccess)
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Read color temperature
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 89)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Write color temperature
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/setDeviceValue/" + Id + "?valueTypeId=89&value=" + Ct, "GET", "", "Authorization: TapHome " + API_token);
IF(!response.IsSuccess)
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Electricity Meter (5) Electricity Meter Read-only

Cumulative energy consumption (kWh) and instantaneous power demand (kW)

numeric Unit: kWh / kW json_path
Variable: IdTapHome device ID — set to the ID of the device you want to control (find in TapHome app or via /discovery endpoint)

Electricity Meter (5)

Read total consumption
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 59)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Read demand
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 60)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Brightness Sensor (5) Variable Read-only
numeric Unit: lux json_path
Service Attributes
Value Types
Variable: IdTapHome device ID — set to the ID of the device you want to control (find in TapHome app or via /discovery endpoint)

Brightness Sensor (5)

Read
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 2)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Service Attributes
Value Types
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
    var ret := "";
    var i := 0;
    do
        if ! isnull(PARSEJSON(response.content, "$.values[" + i + "].valueTypeId", true))
            ret := ret + PARSEJSON(response.content, "$.values[" + i + "].valueTypeId", true);
            ret := ret + " - " + PARSEJSON(response.content, "$.values[" + i + "].valueTypeName", true);
            ret := ret + "\n";
        end
        i := i + 1;
    loop while i < 10
    RETURN(ret);
END

Variable (5) Variable
numeric json_path
Service Attributes
Value Types
Variable: IdTapHome device ID — set to the ID of the device you want to control (find in TapHome app or via /discovery endpoint)

Variable (5)

Read
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 62)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Write
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/setDeviceValue/" + Id + "?valueTypeId=62&value=" + Va, "GET", "", "Authorization: TapHome " + API_token);
IF(!response.IsSuccess)
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Service Attributes
Value Types
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
    var ret := "";
    var i := 0;
    do
        if ! isnull(PARSEJSON(response.content, "$.values[" + i + "].valueTypeId", true))
            ret := ret + PARSEJSON(response.content, "$.values[" + i + "].valueTypeId", true);
            ret := ret + " - " + PARSEJSON(response.content, "$.values[" + i + "].valueTypeName", true);
            ret := ret + "\n";
        end
        i := i + 1;
    loop while i < 10
    RETURN(ret);
END

RGB Light (5) HSB Light

Full HSB color control — hue, saturation, brightness, and correlated color temperature

numeric json_path
Variable: IdTapHome device ID — set to the ID of the device you want to control (find in TapHome app or via /discovery endpoint)

RGB Light (5)

Read brightness
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 65)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Write brightness
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/setDeviceValue/" + Id + "?valueTypeId=65&value=" + Hb, "GET", "", "Authorization: TapHome " + API_token);
IF(!response.IsSuccess)
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Read hue
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 40)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Write hue
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/setDeviceValue/" + Id + "?valueTypeId=40&value=" + Hd, "GET", "", "Authorization: TapHome " + API_token);
IF(!response.IsSuccess)
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Read saturation
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 41)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Write saturation
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/setDeviceValue/" + Id + "?valueTypeId=41&value=" + Sa, "GET", "", "Authorization: TapHome " + API_token);
IF(!response.IsSuccess)
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Read color temperature
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 89)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Write color temperature
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/setDeviceValue/" + Id + "?valueTypeId=89&value=" + Ct, "GET", "", "Authorization: TapHome " + API_token);
IF(!response.IsSuccess)
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Slide (5) Slide
numeric Unit: % json_path
Variable: IdTapHome device ID — set to the ID of the device you want to control (find in TapHome app or via /discovery endpoint)

Slide (5)

Read blind level
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 46)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Write blind level
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/setDeviceValue/" + Id + "?valueTypeId=46&value=" + Bl, "GET", "", "Authorization: TapHome " + API_token);
IF(!response.IsSuccess)
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Wind Speed Sensor (5) Variable Read-only
numeric Unit: m/s json_path
Service Attributes
Value Types
Variable: IdTapHome device ID — set to the ID of the device you want to control (find in TapHome app or via /discovery endpoint)

Wind Speed Sensor (5)

Read
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 14)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Service Attributes
Value Types
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
    var ret := "";
    var i := 0;
    do
        if ! isnull(PARSEJSON(response.content, "$.values[" + i + "].valueTypeId", true))
            ret := ret + PARSEJSON(response.content, "$.values[" + i + "].valueTypeId", true);
            ret := ret + " - " + PARSEJSON(response.content, "$.values[" + i + "].valueTypeName", true);
            ret := ret + "\n";
        end
        i := i + 1;
    loop while i < 10
    RETURN(ret);
END

Reed Contact (5) Reed Contact Read-only
numeric json_path
Variable: IdTapHome device ID — set to the ID of the device you want to control (find in TapHome app or via /discovery endpoint)

Reed Contact (5)

Read
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 44)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Temperature Sensor (5) Temperature Sensor Read-only

Temperature (°C) and humidity (%) readings

numeric Unit: °C / % json_path
Variable: IdTapHome device ID — set to the ID of the device you want to control (find in TapHome app or via /discovery endpoint)

Temperature Sensor (5)

Read humidity
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 3)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Read temperature
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 5)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Thermostat (5) Thermostat

Current temperature, humidity, and adjustable temperature setpoint

numeric Unit: °C json_path
Variable: IdTapHome device ID — set to the ID of the device you want to control (find in TapHome app or via /discovery endpoint)

Thermostat (5)

Read temperature
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 5)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Read humidity
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 3)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Read desired temperature
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 6)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Write desired temperature
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/setDeviceValue/" + Id + "?valueTypeId=6&value=" + Se, "GET", "", "Authorization: TapHome " + API_token);
IF(!response.IsSuccess)
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Multi-Value Switch (5) Multi-value Switch

Numeric mode selector with values 0-9 for multi-mode device control

numeric json_path
Variable: IdTapHome device ID — set to the ID of the device you want to control (find in TapHome app or via /discovery endpoint)

Multi-Value Switch (5)

Read switch state
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 49)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Write switch state
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/setDeviceValue/" + Id + "?valueTypeId=49&value=" + Mu, "GET", "", "Authorization: TapHome " + API_token);
IF(!response.IsSuccess)
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Blind (5) Blind

Position level (%) and tilt angle control for blinds and shutters

numeric Unit: % json_path
Variable: IdTapHome device ID — set to the ID of the device you want to control (find in TapHome app or via /discovery endpoint)

Blind (5)

Read blind level
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 46)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Write blind level
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/setDeviceValue/" + Id + "?valueTypeId=46&value=" + Bl, "GET", "", "Authorization: TapHome " + API_token);
IF(!response.IsSuccess)
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Read blind slope
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 10)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Write blind slope
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/setDeviceValue/" + Id + "?valueTypeId=10&value=" + Bs, "GET", "", "Authorization: TapHome " + API_token);
IF(!response.IsSuccess)
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Analog Input (6) Analog Input Read-only
numeric json_path
Variable: IdTapHome device ID — set to the ID of the device you want to control (find in TapHome app or via /discovery endpoint)

Analog Input (6)

Read input level
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 55)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Analog Output (6) Dimmer

Continuous output level (0-100 %) for dimmers, valve actuators, or analog output devices

numeric Unit: % json_path
Variable: IdTapHome device ID — set to the ID of the device you want to control (find in TapHome app or via /discovery endpoint)

Analog Output (6)

Read level
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 42)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Write level
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/setDeviceValue/" + Id + "?valueTypeId=42&value=" + Le, "GET", "", "Authorization: TapHome " + API_token);
IF(!response.IsSuccess)
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Switch (6) Switch
numeric json_path
Values / States: ON · OFF
Variable: IdTapHome device ID — set to the ID of the device you want to control (find in TapHome app or via /discovery endpoint)

Switch (6)

Read switch state
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 48)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Write switch state
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/setDeviceValue/" + Id + "?valueTypeId=48&value=" + St, "GET", "", "Authorization: TapHome " + API_token);
IF(!response.IsSuccess)
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Dual White Light (6) White Light

Brightness and correlated color temperature (CCT) control for tunable white lighting

numeric json_path
Variable: IdTapHome device ID — set to the ID of the device you want to control (find in TapHome app or via /discovery endpoint)

Dual White Light (6)

Read brightness
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 65)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Write brightness
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/setDeviceValue/" + Id + "?valueTypeId=65&value=" + Hb, "GET", "", "Authorization: TapHome " + API_token);
IF(!response.IsSuccess)
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Read color temperature
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 89)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Write color temperature
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/setDeviceValue/" + Id + "?valueTypeId=89&value=" + Ct, "GET", "", "Authorization: TapHome " + API_token);
IF(!response.IsSuccess)
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Electricity Meter (6) Electricity Meter Read-only

Cumulative energy consumption (kWh) and instantaneous power demand (kW)

numeric Unit: kWh / kW json_path
Variable: IdTapHome device ID — set to the ID of the device you want to control (find in TapHome app or via /discovery endpoint)

Electricity Meter (6)

Read total consumption
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 59)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Read demand
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 60)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Brightness Sensor (6) Variable Read-only
numeric Unit: lux json_path
Service Attributes
Value Types
Variable: IdTapHome device ID — set to the ID of the device you want to control (find in TapHome app or via /discovery endpoint)

Brightness Sensor (6)

Read
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 2)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Service Attributes
Value Types
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
    var ret := "";
    var i := 0;
    do
        if ! isnull(PARSEJSON(response.content, "$.values[" + i + "].valueTypeId", true))
            ret := ret + PARSEJSON(response.content, "$.values[" + i + "].valueTypeId", true);
            ret := ret + " - " + PARSEJSON(response.content, "$.values[" + i + "].valueTypeName", true);
            ret := ret + "\n";
        end
        i := i + 1;
    loop while i < 10
    RETURN(ret);
END

Variable (6) Variable
numeric json_path
Service Attributes
Value Types
Variable: IdTapHome device ID — set to the ID of the device you want to control (find in TapHome app or via /discovery endpoint)

Variable (6)

Read
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 62)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Write
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/setDeviceValue/" + Id + "?valueTypeId=62&value=" + Va, "GET", "", "Authorization: TapHome " + API_token);
IF(!response.IsSuccess)
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Service Attributes
Value Types
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
    var ret := "";
    var i := 0;
    do
        if ! isnull(PARSEJSON(response.content, "$.values[" + i + "].valueTypeId", true))
            ret := ret + PARSEJSON(response.content, "$.values[" + i + "].valueTypeId", true);
            ret := ret + " - " + PARSEJSON(response.content, "$.values[" + i + "].valueTypeName", true);
            ret := ret + "\n";
        end
        i := i + 1;
    loop while i < 10
    RETURN(ret);
END

RGB Light (6) HSB Light

Full HSB color control — hue, saturation, brightness, and correlated color temperature

numeric json_path
Variable: IdTapHome device ID — set to the ID of the device you want to control (find in TapHome app or via /discovery endpoint)

RGB Light (6)

Read brightness
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 65)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Write brightness
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/setDeviceValue/" + Id + "?valueTypeId=65&value=" + Hb, "GET", "", "Authorization: TapHome " + API_token);
IF(!response.IsSuccess)
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Read hue
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 40)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Write hue
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/setDeviceValue/" + Id + "?valueTypeId=40&value=" + Hd, "GET", "", "Authorization: TapHome " + API_token);
IF(!response.IsSuccess)
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Read saturation
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 41)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Write saturation
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/setDeviceValue/" + Id + "?valueTypeId=41&value=" + Sa, "GET", "", "Authorization: TapHome " + API_token);
IF(!response.IsSuccess)
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Read color temperature
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 89)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Write color temperature
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/setDeviceValue/" + Id + "?valueTypeId=89&value=" + Ct, "GET", "", "Authorization: TapHome " + API_token);
IF(!response.IsSuccess)
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Slide (6) Slide
numeric Unit: % json_path
Variable: IdTapHome device ID — set to the ID of the device you want to control (find in TapHome app or via /discovery endpoint)

Slide (6)

Read blind level
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 46)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Write blind level
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/setDeviceValue/" + Id + "?valueTypeId=46&value=" + Bl, "GET", "", "Authorization: TapHome " + API_token);
IF(!response.IsSuccess)
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Wind Speed Sensor (6) Variable Read-only
numeric Unit: m/s json_path
Service Attributes
Value Types
Variable: IdTapHome device ID — set to the ID of the device you want to control (find in TapHome app or via /discovery endpoint)

Wind Speed Sensor (6)

Read
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 14)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Service Attributes
Value Types
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
    var ret := "";
    var i := 0;
    do
        if ! isnull(PARSEJSON(response.content, "$.values[" + i + "].valueTypeId", true))
            ret := ret + PARSEJSON(response.content, "$.values[" + i + "].valueTypeId", true);
            ret := ret + " - " + PARSEJSON(response.content, "$.values[" + i + "].valueTypeName", true);
            ret := ret + "\n";
        end
        i := i + 1;
    loop while i < 10
    RETURN(ret);
END

Reed Contact (6) Reed Contact Read-only
numeric json_path
Variable: IdTapHome device ID — set to the ID of the device you want to control (find in TapHome app or via /discovery endpoint)

Reed Contact (6)

Read
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 44)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Temperature Sensor (6) Temperature Sensor Read-only

Temperature (°C) and humidity (%) readings

numeric Unit: °C / % json_path
Variable: IdTapHome device ID — set to the ID of the device you want to control (find in TapHome app or via /discovery endpoint)

Temperature Sensor (6)

Read humidity
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 3)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Read temperature
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 5)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Thermostat (6) Thermostat

Current temperature, humidity, and adjustable temperature setpoint

numeric Unit: °C json_path
Variable: IdTapHome device ID — set to the ID of the device you want to control (find in TapHome app or via /discovery endpoint)

Thermostat (6)

Read temperature
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 5)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Read humidity
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 3)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Read desired temperature
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 6)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Write desired temperature
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/setDeviceValue/" + Id + "?valueTypeId=6&value=" + Se, "GET", "", "Authorization: TapHome " + API_token);
IF(!response.IsSuccess)
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Multi-Value Switch (6) Multi-value Switch

Numeric mode selector with values 0-9 for multi-mode device control

numeric json_path
Variable: IdTapHome device ID — set to the ID of the device you want to control (find in TapHome app or via /discovery endpoint)

Multi-Value Switch (6)

Read switch state
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 49)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Write switch state
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/setDeviceValue/" + Id + "?valueTypeId=49&value=" + Mu, "GET", "", "Authorization: TapHome " + API_token);
IF(!response.IsSuccess)
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Blind (6) Blind

Position level (%) and tilt angle control for blinds and shutters

numeric Unit: % json_path
Variable: IdTapHome device ID — set to the ID of the device you want to control (find in TapHome app or via /discovery endpoint)

Blind (6)

Read blind level
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 46)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Write blind level
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/setDeviceValue/" + Id + "?valueTypeId=46&value=" + Bl, "GET", "", "Authorization: TapHome " + API_token);
IF(!response.IsSuccess)
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Read blind slope
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 10)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Write blind slope
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/setDeviceValue/" + Id + "?valueTypeId=10&value=" + Bs, "GET", "", "Authorization: TapHome " + API_token);
IF(!response.IsSuccess)
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Analog Input (7) Analog Input Read-only
numeric json_path
Variable: IdTapHome device ID — set to the ID of the device you want to control (find in TapHome app or via /discovery endpoint)

Analog Input (7)

Read input level
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 55)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Analog Output (7) Dimmer

Continuous output level (0-100 %) for dimmers, valve actuators, or analog output devices

numeric Unit: % json_path
Variable: IdTapHome device ID — set to the ID of the device you want to control (find in TapHome app or via /discovery endpoint)

Analog Output (7)

Read level
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 42)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Write level
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/setDeviceValue/" + Id + "?valueTypeId=42&value=" + Le, "GET", "", "Authorization: TapHome " + API_token);
IF(!response.IsSuccess)
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Switch (7) Switch
numeric json_path
Values / States: ON · OFF
Variable: IdTapHome device ID — set to the ID of the device you want to control (find in TapHome app or via /discovery endpoint)

Switch (7)

Read switch state
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 48)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Write switch state
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/setDeviceValue/" + Id + "?valueTypeId=48&value=" + St, "GET", "", "Authorization: TapHome " + API_token);
IF(!response.IsSuccess)
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Dual White Light (7) White Light

Brightness and correlated color temperature (CCT) control for tunable white lighting

numeric json_path
Variable: IdTapHome device ID — set to the ID of the device you want to control (find in TapHome app or via /discovery endpoint)

Dual White Light (7)

Read brightness
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 65)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Write brightness
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/setDeviceValue/" + Id + "?valueTypeId=65&value=" + Hb, "GET", "", "Authorization: TapHome " + API_token);
IF(!response.IsSuccess)
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Read color temperature
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 89)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Write color temperature
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/setDeviceValue/" + Id + "?valueTypeId=89&value=" + Ct, "GET", "", "Authorization: TapHome " + API_token);
IF(!response.IsSuccess)
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Electricity Meter (7) Electricity Meter Read-only

Cumulative energy consumption (kWh) and instantaneous power demand (kW)

numeric Unit: kWh / kW json_path
Variable: IdTapHome device ID — set to the ID of the device you want to control (find in TapHome app or via /discovery endpoint)

Electricity Meter (7)

Read total consumption
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 59)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Read demand
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 60)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Brightness Sensor (7) Variable Read-only
numeric Unit: lux json_path
Service Attributes
Value Types
Variable: IdTapHome device ID — set to the ID of the device you want to control (find in TapHome app or via /discovery endpoint)

Brightness Sensor (7)

Read
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 2)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Service Attributes
Value Types
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
    var ret := "";
    var i := 0;
    do
        if ! isnull(PARSEJSON(response.content, "$.values[" + i + "].valueTypeId", true))
            ret := ret + PARSEJSON(response.content, "$.values[" + i + "].valueTypeId", true);
            ret := ret + " - " + PARSEJSON(response.content, "$.values[" + i + "].valueTypeName", true);
            ret := ret + "\n";
        end
        i := i + 1;
    loop while i < 10
    RETURN(ret);
END

Variable (7) Variable
numeric json_path
Service Attributes
Value Types
Variable: IdTapHome device ID — set to the ID of the device you want to control (find in TapHome app or via /discovery endpoint)

Variable (7)

Read
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 62)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Write
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/setDeviceValue/" + Id + "?valueTypeId=62&value=" + Va, "GET", "", "Authorization: TapHome " + API_token);
IF(!response.IsSuccess)
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Service Attributes
Value Types
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
    var ret := "";
    var i := 0;
    do
        if ! isnull(PARSEJSON(response.content, "$.values[" + i + "].valueTypeId", true))
            ret := ret + PARSEJSON(response.content, "$.values[" + i + "].valueTypeId", true);
            ret := ret + " - " + PARSEJSON(response.content, "$.values[" + i + "].valueTypeName", true);
            ret := ret + "\n";
        end
        i := i + 1;
    loop while i < 10
    RETURN(ret);
END

RGB Light (7) HSB Light

Full HSB color control — hue, saturation, brightness, and correlated color temperature

numeric json_path
Variable: IdTapHome device ID — set to the ID of the device you want to control (find in TapHome app or via /discovery endpoint)

RGB Light (7)

Read brightness
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 65)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Write brightness
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/setDeviceValue/" + Id + "?valueTypeId=65&value=" + Hb, "GET", "", "Authorization: TapHome " + API_token);
IF(!response.IsSuccess)
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Read hue
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 40)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Write hue
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/setDeviceValue/" + Id + "?valueTypeId=40&value=" + Hd, "GET", "", "Authorization: TapHome " + API_token);
IF(!response.IsSuccess)
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Read saturation
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 41)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Write saturation
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/setDeviceValue/" + Id + "?valueTypeId=41&value=" + Sa, "GET", "", "Authorization: TapHome " + API_token);
IF(!response.IsSuccess)
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Read color temperature
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 89)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Write color temperature
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/setDeviceValue/" + Id + "?valueTypeId=89&value=" + Ct, "GET", "", "Authorization: TapHome " + API_token);
IF(!response.IsSuccess)
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Slide (7) Slide
numeric Unit: % json_path
Variable: IdTapHome device ID — set to the ID of the device you want to control (find in TapHome app or via /discovery endpoint)

Slide (7)

Read blind level
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 46)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Write blind level
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/setDeviceValue/" + Id + "?valueTypeId=46&value=" + Bl, "GET", "", "Authorization: TapHome " + API_token);
IF(!response.IsSuccess)
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Wind Speed Sensor (7) Variable Read-only
numeric Unit: m/s json_path
Service Attributes
Value Types
Variable: IdTapHome device ID — set to the ID of the device you want to control (find in TapHome app or via /discovery endpoint)

Wind Speed Sensor (7)

Read
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 14)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Service Attributes
Value Types
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
    var ret := "";
    var i := 0;
    do
        if ! isnull(PARSEJSON(response.content, "$.values[" + i + "].valueTypeId", true))
            ret := ret + PARSEJSON(response.content, "$.values[" + i + "].valueTypeId", true);
            ret := ret + " - " + PARSEJSON(response.content, "$.values[" + i + "].valueTypeName", true);
            ret := ret + "\n";
        end
        i := i + 1;
    loop while i < 10
    RETURN(ret);
END

Reed Contact (7) Reed Contact Read-only
numeric json_path
Variable: IdTapHome device ID — set to the ID of the device you want to control (find in TapHome app or via /discovery endpoint)

Reed Contact (7)

Read
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 44)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Temperature Sensor (7) Temperature Sensor Read-only

Temperature (°C) and humidity (%) readings

numeric Unit: °C / % json_path
Variable: IdTapHome device ID — set to the ID of the device you want to control (find in TapHome app or via /discovery endpoint)

Temperature Sensor (7)

Read humidity
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 3)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Read temperature
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 5)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Thermostat (7) Thermostat

Current temperature, humidity, and adjustable temperature setpoint

numeric Unit: °C json_path
Variable: IdTapHome device ID — set to the ID of the device you want to control (find in TapHome app or via /discovery endpoint)

Thermostat (7)

Read temperature
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 5)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Read humidity
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 3)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Read desired temperature
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 6)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Write desired temperature
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/setDeviceValue/" + Id + "?valueTypeId=6&value=" + Se, "GET", "", "Authorization: TapHome " + API_token);
IF(!response.IsSuccess)
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Multi-Value Switch (7) Multi-value Switch

Numeric mode selector with values 0-9 for multi-mode device control

numeric json_path
Variable: IdTapHome device ID — set to the ID of the device you want to control (find in TapHome app or via /discovery endpoint)

Multi-Value Switch (7)

Read switch state
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 49)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Write switch state
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/setDeviceValue/" + Id + "?valueTypeId=49&value=" + Mu, "GET", "", "Authorization: TapHome " + API_token);
IF(!response.IsSuccess)
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Blind (7) Blind

Position level (%) and tilt angle control for blinds and shutters

numeric Unit: % json_path
Variable: IdTapHome device ID — set to the ID of the device you want to control (find in TapHome app or via /discovery endpoint)

Blind (7)

Read blind level
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 46)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Write blind level
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/setDeviceValue/" + Id + "?valueTypeId=46&value=" + Bl, "GET", "", "Authorization: TapHome " + API_token);
IF(!response.IsSuccess)
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Read blind slope
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 10)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Write blind slope
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/setDeviceValue/" + Id + "?valueTypeId=10&value=" + Bs, "GET", "", "Authorization: TapHome " + API_token);
IF(!response.IsSuccess)
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Analog Input (8) Analog Input Read-only
numeric json_path
Variable: IdTapHome device ID — set to the ID of the device you want to control (find in TapHome app or via /discovery endpoint)

Analog Input (8)

Read input level
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 55)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Analog Output (8) Dimmer

Continuous output level (0-100 %) for dimmers, valve actuators, or analog output devices

numeric Unit: % json_path
Variable: IdTapHome device ID — set to the ID of the device you want to control (find in TapHome app or via /discovery endpoint)

Analog Output (8)

Read level
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 42)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Write level
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/setDeviceValue/" + Id + "?valueTypeId=42&value=" + Le, "GET", "", "Authorization: TapHome " + API_token);
IF(!response.IsSuccess)
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Switch (8) Switch
numeric json_path
Values / States: ON · OFF
Variable: IdTapHome device ID — set to the ID of the device you want to control (find in TapHome app or via /discovery endpoint)

Switch (8)

Read switch state
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 48)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Write switch state
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/setDeviceValue/" + Id + "?valueTypeId=48&value=" + St, "GET", "", "Authorization: TapHome " + API_token);
IF(!response.IsSuccess)
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Dual White Light (8) White Light

Brightness and correlated color temperature (CCT) control for tunable white lighting

numeric json_path
Variable: IdTapHome device ID — set to the ID of the device you want to control (find in TapHome app or via /discovery endpoint)

Dual White Light (8)

Read brightness
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 65)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Write brightness
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/setDeviceValue/" + Id + "?valueTypeId=65&value=" + Hb, "GET", "", "Authorization: TapHome " + API_token);
IF(!response.IsSuccess)
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Read color temperature
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 89)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Write color temperature
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/setDeviceValue/" + Id + "?valueTypeId=89&value=" + Ct, "GET", "", "Authorization: TapHome " + API_token);
IF(!response.IsSuccess)
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Electricity Meter (8) Electricity Meter Read-only

Cumulative energy consumption (kWh) and instantaneous power demand (kW)

numeric Unit: kWh / kW json_path
Variable: IdTapHome device ID — set to the ID of the device you want to control (find in TapHome app or via /discovery endpoint)

Electricity Meter (8)

Read total consumption
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 59)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Read demand
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 60)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Brightness Sensor (8) Variable Read-only
numeric Unit: lux json_path
Service Attributes
Value Types
Variable: IdTapHome device ID — set to the ID of the device you want to control (find in TapHome app or via /discovery endpoint)

Brightness Sensor (8)

Read
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 2)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Service Attributes
Value Types
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
    var ret := "";
    var i := 0;
    do
        if ! isnull(PARSEJSON(response.content, "$.values[" + i + "].valueTypeId", true))
            ret := ret + PARSEJSON(response.content, "$.values[" + i + "].valueTypeId", true);
            ret := ret + " - " + PARSEJSON(response.content, "$.values[" + i + "].valueTypeName", true);
            ret := ret + "\n";
        end
        i := i + 1;
    loop while i < 10
    RETURN(ret);
END

Variable (8) Variable
numeric json_path
Service Attributes
Value Types
Variable: IdTapHome device ID — set to the ID of the device you want to control (find in TapHome app or via /discovery endpoint)

Variable (8)

Read
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 62)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Write
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/setDeviceValue/" + Id + "?valueTypeId=62&value=" + Va, "GET", "", "Authorization: TapHome " + API_token);
IF(!response.IsSuccess)
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Service Attributes
Value Types
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
    var ret := "";
    var i := 0;
    do
        if ! isnull(PARSEJSON(response.content, "$.values[" + i + "].valueTypeId", true))
            ret := ret + PARSEJSON(response.content, "$.values[" + i + "].valueTypeId", true);
            ret := ret + " - " + PARSEJSON(response.content, "$.values[" + i + "].valueTypeName", true);
            ret := ret + "\n";
        end
        i := i + 1;
    loop while i < 10
    RETURN(ret);
END

RGB Light (8) HSB Light

Full HSB color control — hue, saturation, brightness, and correlated color temperature

numeric json_path
Variable: IdTapHome device ID — set to the ID of the device you want to control (find in TapHome app or via /discovery endpoint)

RGB Light (8)

Read brightness
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 65)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Write brightness
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/setDeviceValue/" + Id + "?valueTypeId=65&value=" + Hb, "GET", "", "Authorization: TapHome " + API_token);
IF(!response.IsSuccess)
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Read hue
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 40)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Write hue
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/setDeviceValue/" + Id + "?valueTypeId=40&value=" + Hd, "GET", "", "Authorization: TapHome " + API_token);
IF(!response.IsSuccess)
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Read saturation
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 41)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Write saturation
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/setDeviceValue/" + Id + "?valueTypeId=41&value=" + Sa, "GET", "", "Authorization: TapHome " + API_token);
IF(!response.IsSuccess)
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Read color temperature
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 89)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Write color temperature
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/setDeviceValue/" + Id + "?valueTypeId=89&value=" + Ct, "GET", "", "Authorization: TapHome " + API_token);
IF(!response.IsSuccess)
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Slide (8) Slide
numeric Unit: % json_path
Variable: IdTapHome device ID — set to the ID of the device you want to control (find in TapHome app or via /discovery endpoint)

Slide (8)

Read blind level
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 46)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Write blind level
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/setDeviceValue/" + Id + "?valueTypeId=46&value=" + Bl, "GET", "", "Authorization: TapHome " + API_token);
IF(!response.IsSuccess)
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Wind Speed Sensor (8) Variable Read-only
numeric Unit: m/s json_path
Service Attributes
Value Types
Variable: IdTapHome device ID — set to the ID of the device you want to control (find in TapHome app or via /discovery endpoint)

Wind Speed Sensor (8)

Read
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 14)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Service Attributes
Value Types
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
    var ret := "";
    var i := 0;
    do
        if ! isnull(PARSEJSON(response.content, "$.values[" + i + "].valueTypeId", true))
            ret := ret + PARSEJSON(response.content, "$.values[" + i + "].valueTypeId", true);
            ret := ret + " - " + PARSEJSON(response.content, "$.values[" + i + "].valueTypeName", true);
            ret := ret + "\n";
        end
        i := i + 1;
    loop while i < 10
    RETURN(ret);
END

Reed Contact (8) Reed Contact Read-only
numeric json_path
Variable: IdTapHome device ID — set to the ID of the device you want to control (find in TapHome app or via /discovery endpoint)

Reed Contact (8)

Read
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 44)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Temperature Sensor (8) Temperature Sensor Read-only

Temperature (°C) and humidity (%) readings

numeric Unit: °C / % json_path
Variable: IdTapHome device ID — set to the ID of the device you want to control (find in TapHome app or via /discovery endpoint)

Temperature Sensor (8)

Read humidity
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 3)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Read temperature
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 5)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Thermostat (8) Thermostat

Current temperature, humidity, and adjustable temperature setpoint

numeric Unit: °C json_path
Variable: IdTapHome device ID — set to the ID of the device you want to control (find in TapHome app or via /discovery endpoint)

Thermostat (8)

Read temperature
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 5)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Read humidity
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 3)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Read desired temperature
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 6)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Write desired temperature
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/setDeviceValue/" + Id + "?valueTypeId=6&value=" + Se, "GET", "", "Authorization: TapHome " + API_token);
IF(!response.IsSuccess)
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Multi-Value Switch (8) Multi-value Switch

Numeric mode selector with values 0-9 for multi-mode device control

numeric json_path
Variable: IdTapHome device ID — set to the ID of the device you want to control (find in TapHome app or via /discovery endpoint)

Multi-Value Switch (8)

Read switch state
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 49)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Write switch state
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/setDeviceValue/" + Id + "?valueTypeId=49&value=" + Mu, "GET", "", "Authorization: TapHome " + API_token);
IF(!response.IsSuccess)
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Blind (8) Blind

Position level (%) and tilt angle control for blinds and shutters

numeric Unit: % json_path
Variable: IdTapHome device ID — set to the ID of the device you want to control (find in TapHome app or via /discovery endpoint)

Blind (8)

Read blind level
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 46)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Write blind level
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/setDeviceValue/" + Id + "?valueTypeId=46&value=" + Bl, "GET", "", "Authorization: TapHome " + API_token);
IF(!response.IsSuccess)
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Read blind slope
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 10)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Write blind slope
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/setDeviceValue/" + Id + "?valueTypeId=10&value=" + Bs, "GET", "", "Authorization: TapHome " + API_token);
IF(!response.IsSuccess)
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Analog Input (9) Analog Input Read-only
numeric json_path
Variable: IdTapHome device ID — set to the ID of the device you want to control (find in TapHome app or via /discovery endpoint)

Analog Input (9)

Read input level
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 55)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Analog Output (9) Dimmer

Continuous output level (0-100 %) for dimmers, valve actuators, or analog output devices

numeric Unit: % json_path
Variable: IdTapHome device ID — set to the ID of the device you want to control (find in TapHome app or via /discovery endpoint)

Analog Output (9)

Read level
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 42)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Write level
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/setDeviceValue/" + Id + "?valueTypeId=42&value=" + Le, "GET", "", "Authorization: TapHome " + API_token);
IF(!response.IsSuccess)
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Switch (9) Switch
numeric json_path
Values / States: ON · OFF
Variable: IdTapHome device ID — set to the ID of the device you want to control (find in TapHome app or via /discovery endpoint)

Switch (9)

Read switch state
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 48)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Write switch state
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/setDeviceValue/" + Id + "?valueTypeId=48&value=" + St, "GET", "", "Authorization: TapHome " + API_token);
IF(!response.IsSuccess)
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Dual White Light (9) White Light

Brightness and correlated color temperature (CCT) control for tunable white lighting

numeric json_path
Variable: IdTapHome device ID — set to the ID of the device you want to control (find in TapHome app or via /discovery endpoint)

Dual White Light (9)

Read brightness
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 65)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Write brightness
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/setDeviceValue/" + Id + "?valueTypeId=65&value=" + Hb, "GET", "", "Authorization: TapHome " + API_token);
IF(!response.IsSuccess)
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Read color temperature
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 89)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Write color temperature
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/setDeviceValue/" + Id + "?valueTypeId=89&value=" + Ct, "GET", "", "Authorization: TapHome " + API_token);
IF(!response.IsSuccess)
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Electricity Meter (9) Electricity Meter Read-only

Cumulative energy consumption (kWh) and instantaneous power demand (kW)

numeric Unit: kWh / kW json_path
Variable: IdTapHome device ID — set to the ID of the device you want to control (find in TapHome app or via /discovery endpoint)

Electricity Meter (9)

Read total consumption
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 59)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Read demand
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 60)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Brightness Sensor (9) Variable Read-only
numeric Unit: lux json_path
Service Attributes
Value Types
Variable: IdTapHome device ID — set to the ID of the device you want to control (find in TapHome app or via /discovery endpoint)

Brightness Sensor (9)

Read
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 2)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Service Attributes
Value Types
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
    var ret := "";
    var i := 0;
    do
        if ! isnull(PARSEJSON(response.content, "$.values[" + i + "].valueTypeId", true))
            ret := ret + PARSEJSON(response.content, "$.values[" + i + "].valueTypeId", true);
            ret := ret + " - " + PARSEJSON(response.content, "$.values[" + i + "].valueTypeName", true);
            ret := ret + "\n";
        end
        i := i + 1;
    loop while i < 10
    RETURN(ret);
END

Variable (9) Variable
numeric json_path
Service Attributes
Value Types
Variable: IdTapHome device ID — set to the ID of the device you want to control (find in TapHome app or via /discovery endpoint)

Variable (9)

Read
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 62)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Write
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/setDeviceValue/" + Id + "?valueTypeId=62&value=" + Va, "GET", "", "Authorization: TapHome " + API_token);
IF(!response.IsSuccess)
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Service Attributes
Value Types
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
    var ret := "";
    var i := 0;
    do
        if ! isnull(PARSEJSON(response.content, "$.values[" + i + "].valueTypeId", true))
            ret := ret + PARSEJSON(response.content, "$.values[" + i + "].valueTypeId", true);
            ret := ret + " - " + PARSEJSON(response.content, "$.values[" + i + "].valueTypeName", true);
            ret := ret + "\n";
        end
        i := i + 1;
    loop while i < 10
    RETURN(ret);
END

RGB Light (9) HSB Light

Full HSB color control — hue, saturation, brightness, and correlated color temperature

numeric json_path
Variable: IdTapHome device ID — set to the ID of the device you want to control (find in TapHome app or via /discovery endpoint)

RGB Light (9)

Read brightness
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 65)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Write brightness
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/setDeviceValue/" + Id + "?valueTypeId=65&value=" + Hb, "GET", "", "Authorization: TapHome " + API_token);
IF(!response.IsSuccess)
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Read hue
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 40)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Write hue
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/setDeviceValue/" + Id + "?valueTypeId=40&value=" + Hd, "GET", "", "Authorization: TapHome " + API_token);
IF(!response.IsSuccess)
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Read saturation
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 41)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Write saturation
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/setDeviceValue/" + Id + "?valueTypeId=41&value=" + Sa, "GET", "", "Authorization: TapHome " + API_token);
IF(!response.IsSuccess)
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Read color temperature
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 89)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Write color temperature
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/setDeviceValue/" + Id + "?valueTypeId=89&value=" + Ct, "GET", "", "Authorization: TapHome " + API_token);
IF(!response.IsSuccess)
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Slide (9) Slide
numeric Unit: % json_path
Variable: IdTapHome device ID — set to the ID of the device you want to control (find in TapHome app or via /discovery endpoint)

Slide (9)

Read blind level
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 46)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Write blind level
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/setDeviceValue/" + Id + "?valueTypeId=46&value=" + Bl, "GET", "", "Authorization: TapHome " + API_token);
IF(!response.IsSuccess)
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Wind Speed Sensor (9) Variable Read-only
numeric Unit: m/s json_path
Service Attributes
Value Types
Variable: IdTapHome device ID — set to the ID of the device you want to control (find in TapHome app or via /discovery endpoint)

Wind Speed Sensor (9)

Read
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 14)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Service Attributes
Value Types
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
    var ret := "";
    var i := 0;
    do
        if ! isnull(PARSEJSON(response.content, "$.values[" + i + "].valueTypeId", true))
            ret := ret + PARSEJSON(response.content, "$.values[" + i + "].valueTypeId", true);
            ret := ret + " - " + PARSEJSON(response.content, "$.values[" + i + "].valueTypeName", true);
            ret := ret + "\n";
        end
        i := i + 1;
    loop while i < 10
    RETURN(ret);
END

Reed Contact (9) Reed Contact Read-only
numeric json_path
Variable: IdTapHome device ID — set to the ID of the device you want to control (find in TapHome app or via /discovery endpoint)

Reed Contact (9)

Read
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 44)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Temperature Sensor (9) Temperature Sensor Read-only

Temperature (°C) and humidity (%) readings

numeric Unit: °C / % json_path
Variable: IdTapHome device ID — set to the ID of the device you want to control (find in TapHome app or via /discovery endpoint)

Temperature Sensor (9)

Read humidity
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 3)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Read temperature
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 5)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Thermostat (9) Thermostat

Current temperature, humidity, and adjustable temperature setpoint

numeric Unit: °C json_path
Variable: IdTapHome device ID — set to the ID of the device you want to control (find in TapHome app or via /discovery endpoint)

Thermostat (9)

Read temperature
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 5)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Read humidity
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 3)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Read desired temperature
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 6)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Write desired temperature
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/setDeviceValue/" + Id + "?valueTypeId=6&value=" + Se, "GET", "", "Authorization: TapHome " + API_token);
IF(!response.IsSuccess)
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Multi-Value Switch (9) Multi-value Switch

Numeric mode selector with values 0-9 for multi-mode device control

numeric json_path
Variable: IdTapHome device ID — set to the ID of the device you want to control (find in TapHome app or via /discovery endpoint)

Multi-Value Switch (9)

Read switch state
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 49)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Write switch state
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/setDeviceValue/" + Id + "?valueTypeId=49&value=" + Mu, "GET", "", "Authorization: TapHome " + API_token);
IF(!response.IsSuccess)
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Blind (9) Blind

Position level (%) and tilt angle control for blinds and shutters

numeric Unit: % json_path
Variable: IdTapHome device ID — set to the ID of the device you want to control (find in TapHome app or via /discovery endpoint)

Blind (9)

Read blind level
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 46)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Write blind level
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/setDeviceValue/" + Id + "?valueTypeId=46&value=" + Bl, "GET", "", "Authorization: TapHome " + API_token);
IF(!response.IsSuccess)
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Read blind slope
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 10)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Write blind slope
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/setDeviceValue/" + Id + "?valueTypeId=10&value=" + Bs, "GET", "", "Authorization: TapHome " + API_token);
IF(!response.IsSuccess)
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Analog Input (10) Analog Input Read-only
numeric json_path
Variable: IdTapHome device ID — set to the ID of the device you want to control (find in TapHome app or via /discovery endpoint)

Analog Input (10)

Read input level
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 55)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Analog Output (10) Dimmer

Continuous output level (0-100 %) for dimmers, valve actuators, or analog output devices

numeric Unit: % json_path
Variable: IdTapHome device ID — set to the ID of the device you want to control (find in TapHome app or via /discovery endpoint)

Analog Output (10)

Read level
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 42)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Write level
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/setDeviceValue/" + Id + "?valueTypeId=42&value=" + Le, "GET", "", "Authorization: TapHome " + API_token);
IF(!response.IsSuccess)
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Switch (10) Switch
numeric json_path
Values / States: ON · OFF
Variable: IdTapHome device ID — set to the ID of the device you want to control (find in TapHome app or via /discovery endpoint)

Switch (10)

Read switch state
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 48)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Write switch state
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/setDeviceValue/" + Id + "?valueTypeId=48&value=" + St, "GET", "", "Authorization: TapHome " + API_token);
IF(!response.IsSuccess)
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Dual White Light (10) White Light

Brightness and correlated color temperature (CCT) control for tunable white lighting

numeric json_path
Variable: IdTapHome device ID — set to the ID of the device you want to control (find in TapHome app or via /discovery endpoint)

Dual White Light (10)

Read brightness
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 65)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Write brightness
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/setDeviceValue/" + Id + "?valueTypeId=65&value=" + Hb, "GET", "", "Authorization: TapHome " + API_token);
IF(!response.IsSuccess)
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Read color temperature
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 89)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Write color temperature
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/setDeviceValue/" + Id + "?valueTypeId=89&value=" + Ct, "GET", "", "Authorization: TapHome " + API_token);
IF(!response.IsSuccess)
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Electricity Meter (10) Electricity Meter Read-only

Cumulative energy consumption (kWh) and instantaneous power demand (kW)

numeric Unit: kWh / kW json_path
Variable: IdTapHome device ID — set to the ID of the device you want to control (find in TapHome app or via /discovery endpoint)

Electricity Meter (10)

Read total consumption
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 59)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Read demand
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 60)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Brightness Sensor (10) Variable Read-only
numeric Unit: lux json_path
Service Attributes
Value Types
Variable: IdTapHome device ID — set to the ID of the device you want to control (find in TapHome app or via /discovery endpoint)

Brightness Sensor (10)

Read
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 2)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Service Attributes
Value Types
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
    var ret := "";
    var i := 0;
    do
        if ! isnull(PARSEJSON(response.content, "$.values[" + i + "].valueTypeId", true))
            ret := ret + PARSEJSON(response.content, "$.values[" + i + "].valueTypeId", true);
            ret := ret + " - " + PARSEJSON(response.content, "$.values[" + i + "].valueTypeName", true);
            ret := ret + "\n";
        end
        i := i + 1;
    loop while i < 10
    RETURN(ret);
END

Variable (10) Variable
numeric json_path
Service Attributes
Value Types
Variable: IdTapHome device ID — set to the ID of the device you want to control (find in TapHome app or via /discovery endpoint)

Variable (10)

Read
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 62)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Write
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/setDeviceValue/" + Id + "?valueTypeId=62&value=" + Va, "GET", "", "Authorization: TapHome " + API_token);
IF(!response.IsSuccess)
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Service Attributes
Value Types
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
    var ret := "";
    var i := 0;
    do
        if ! isnull(PARSEJSON(response.content, "$.values[" + i + "].valueTypeId", true))
            ret := ret + PARSEJSON(response.content, "$.values[" + i + "].valueTypeId", true);
            ret := ret + " - " + PARSEJSON(response.content, "$.values[" + i + "].valueTypeName", true);
            ret := ret + "\n";
        end
        i := i + 1;
    loop while i < 10
    RETURN(ret);
END

RGB Light (10) HSB Light

Full HSB color control — hue, saturation, brightness, and correlated color temperature

numeric json_path
Variable: IdTapHome device ID — set to the ID of the device you want to control (find in TapHome app or via /discovery endpoint)

RGB Light (10)

Read brightness
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 65)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Write brightness
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/setDeviceValue/" + Id + "?valueTypeId=65&value=" + Hb, "GET", "", "Authorization: TapHome " + API_token);
IF(!response.IsSuccess)
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Read hue
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 40)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Write hue
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/setDeviceValue/" + Id + "?valueTypeId=40&value=" + Hd, "GET", "", "Authorization: TapHome " + API_token);
IF(!response.IsSuccess)
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Read saturation
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 41)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Write saturation
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/setDeviceValue/" + Id + "?valueTypeId=41&value=" + Sa, "GET", "", "Authorization: TapHome " + API_token);
IF(!response.IsSuccess)
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Read color temperature
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 89)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Write color temperature
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/setDeviceValue/" + Id + "?valueTypeId=89&value=" + Ct, "GET", "", "Authorization: TapHome " + API_token);
IF(!response.IsSuccess)
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Slide (10) Slide
numeric Unit: % json_path
Variable: IdTapHome device ID — set to the ID of the device you want to control (find in TapHome app or via /discovery endpoint)

Slide (10)

Read blind level
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 46)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Write blind level
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/setDeviceValue/" + Id + "?valueTypeId=46&value=" + Bl, "GET", "", "Authorization: TapHome " + API_token);
IF(!response.IsSuccess)
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Wind Speed Sensor (10) Variable Read-only
numeric Unit: m/s json_path
Service Attributes
Value Types
Variable: IdTapHome device ID — set to the ID of the device you want to control (find in TapHome app or via /discovery endpoint)

Wind Speed Sensor (10)

Read
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 14)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Service Attributes
Value Types
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
    var ret := "";
    var i := 0;
    do
        if ! isnull(PARSEJSON(response.content, "$.values[" + i + "].valueTypeId", true))
            ret := ret + PARSEJSON(response.content, "$.values[" + i + "].valueTypeId", true);
            ret := ret + " - " + PARSEJSON(response.content, "$.values[" + i + "].valueTypeName", true);
            ret := ret + "\n";
        end
        i := i + 1;
    loop while i < 10
    RETURN(ret);
END

Reed Contact (10) Reed Contact Read-only
numeric json_path
Variable: IdTapHome device ID — set to the ID of the device you want to control (find in TapHome app or via /discovery endpoint)

Reed Contact (10)

Read
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 44)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Temperature Sensor (10) Temperature Sensor Read-only

Temperature (°C) and humidity (%) readings

numeric Unit: °C / % json_path
Variable: IdTapHome device ID — set to the ID of the device you want to control (find in TapHome app or via /discovery endpoint)

Temperature Sensor (10)

Read humidity
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 3)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Read temperature
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 5)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Thermostat (10) Thermostat

Current temperature, humidity, and adjustable temperature setpoint

numeric Unit: °C json_path
Variable: IdTapHome device ID — set to the ID of the device you want to control (find in TapHome app or via /discovery endpoint)

Thermostat (10)

Read temperature
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 5)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Read humidity
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 3)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Read desired temperature
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 6)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Write desired temperature
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/setDeviceValue/" + Id + "?valueTypeId=6&value=" + Se, "GET", "", "Authorization: TapHome " + API_token);
IF(!response.IsSuccess)
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Multi-Value Switch (10) Multi-value Switch

Numeric mode selector with values 0-9 for multi-mode device control

numeric json_path
Variable: IdTapHome device ID — set to the ID of the device you want to control (find in TapHome app or via /discovery endpoint)

Multi-Value Switch (10)

Read switch state
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 49)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Write switch state
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/setDeviceValue/" + Id + "?valueTypeId=49&value=" + Mu, "GET", "", "Authorization: TapHome " + API_token);
IF(!response.IsSuccess)
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Blind (10) Blind

Position level (%) and tilt angle control for blinds and shutters

numeric Unit: % json_path
Variable: IdTapHome device ID — set to the ID of the device you want to control (find in TapHome app or via /discovery endpoint)

Blind (10)

Read blind level
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 46)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Write blind level
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/setDeviceValue/" + Id + "?valueTypeId=46&value=" + Bl, "GET", "", "Authorization: TapHome " + API_token);
IF(!response.IsSuccess)
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Read blind slope
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 10)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Write blind slope
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/setDeviceValue/" + Id + "?valueTypeId=10&value=" + Bs, "GET", "", "Authorization: TapHome " + API_token);
IF(!response.IsSuccess)
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Analog Input (11) Analog Input Read-only
numeric json_path
Variable: IdTapHome device ID — set to the ID of the device you want to control (find in TapHome app or via /discovery endpoint)

Analog Input (11)

Read input level
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 55)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Analog Output (11) Dimmer

Continuous output level (0-100 %) for dimmers, valve actuators, or analog output devices

numeric Unit: % json_path
Variable: IdTapHome device ID — set to the ID of the device you want to control (find in TapHome app or via /discovery endpoint)

Analog Output (11)

Read level
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 42)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Write level
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/setDeviceValue/" + Id + "?valueTypeId=42&value=" + Le, "GET", "", "Authorization: TapHome " + API_token);
IF(!response.IsSuccess)
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Switch (11) Switch
numeric json_path
Values / States: ON · OFF
Variable: IdTapHome device ID — set to the ID of the device you want to control (find in TapHome app or via /discovery endpoint)

Switch (11)

Read switch state
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 48)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Write switch state
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/setDeviceValue/" + Id + "?valueTypeId=48&value=" + St, "GET", "", "Authorization: TapHome " + API_token);
IF(!response.IsSuccess)
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Dual White Light (11) White Light

Brightness and correlated color temperature (CCT) control for tunable white lighting

numeric json_path
Variable: IdTapHome device ID — set to the ID of the device you want to control (find in TapHome app or via /discovery endpoint)

Dual White Light (11)

Read brightness
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 65)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Write brightness
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/setDeviceValue/" + Id + "?valueTypeId=65&value=" + Hb, "GET", "", "Authorization: TapHome " + API_token);
IF(!response.IsSuccess)
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Read color temperature
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 89)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Write color temperature
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/setDeviceValue/" + Id + "?valueTypeId=89&value=" + Ct, "GET", "", "Authorization: TapHome " + API_token);
IF(!response.IsSuccess)
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Electricity Meter (11) Electricity Meter Read-only

Cumulative energy consumption (kWh) and instantaneous power demand (kW)

numeric Unit: kWh / kW json_path
Variable: IdTapHome device ID — set to the ID of the device you want to control (find in TapHome app or via /discovery endpoint)

Electricity Meter (11)

Read total consumption
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 59)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Read demand
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 60)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Brightness Sensor (11) Variable Read-only
numeric Unit: lux json_path
Service Attributes
Value Types
Variable: IdTapHome device ID — set to the ID of the device you want to control (find in TapHome app or via /discovery endpoint)

Brightness Sensor (11)

Read
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 2)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Service Attributes
Value Types
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
    var ret := "";
    var i := 0;
    do
        if ! isnull(PARSEJSON(response.content, "$.values[" + i + "].valueTypeId", true))
            ret := ret + PARSEJSON(response.content, "$.values[" + i + "].valueTypeId", true);
            ret := ret + " - " + PARSEJSON(response.content, "$.values[" + i + "].valueTypeName", true);
            ret := ret + "\n";
        end
        i := i + 1;
    loop while i < 10
    RETURN(ret);
END

Variable (11) Variable
numeric json_path
Service Attributes
Value Types
Variable: IdTapHome device ID — set to the ID of the device you want to control (find in TapHome app or via /discovery endpoint)

Variable (11)

Read
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 62)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Write
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/setDeviceValue/" + Id + "?valueTypeId=62&value=" + Va, "GET", "", "Authorization: TapHome " + API_token);
IF(!response.IsSuccess)
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Service Attributes
Value Types
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
    var ret := "";
    var i := 0;
    do
        if ! isnull(PARSEJSON(response.content, "$.values[" + i + "].valueTypeId", true))
            ret := ret + PARSEJSON(response.content, "$.values[" + i + "].valueTypeId", true);
            ret := ret + " - " + PARSEJSON(response.content, "$.values[" + i + "].valueTypeName", true);
            ret := ret + "\n";
        end
        i := i + 1;
    loop while i < 10
    RETURN(ret);
END

RGB Light (11) HSB Light

Full HSB color control — hue, saturation, brightness, and correlated color temperature

numeric json_path
Variable: IdTapHome device ID — set to the ID of the device you want to control (find in TapHome app or via /discovery endpoint)

RGB Light (11)

Read brightness
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 65)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Write brightness
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/setDeviceValue/" + Id + "?valueTypeId=65&value=" + Hb, "GET", "", "Authorization: TapHome " + API_token);
IF(!response.IsSuccess)
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Read hue
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 40)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Write hue
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/setDeviceValue/" + Id + "?valueTypeId=40&value=" + Hd, "GET", "", "Authorization: TapHome " + API_token);
IF(!response.IsSuccess)
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Read saturation
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 41)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Write saturation
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/setDeviceValue/" + Id + "?valueTypeId=41&value=" + Sa, "GET", "", "Authorization: TapHome " + API_token);
IF(!response.IsSuccess)
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Read color temperature
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 89)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Write color temperature
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/setDeviceValue/" + Id + "?valueTypeId=89&value=" + Ct, "GET", "", "Authorization: TapHome " + API_token);
IF(!response.IsSuccess)
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Slide (11) Slide
numeric Unit: % json_path
Variable: IdTapHome device ID — set to the ID of the device you want to control (find in TapHome app or via /discovery endpoint)

Slide (11)

Read blind level
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 46)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Write blind level
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/setDeviceValue/" + Id + "?valueTypeId=46&value=" + Bl, "GET", "", "Authorization: TapHome " + API_token);
IF(!response.IsSuccess)
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Wind Speed Sensor (11) Variable Read-only
numeric Unit: m/s json_path
Service Attributes
Value Types
Variable: IdTapHome device ID — set to the ID of the device you want to control (find in TapHome app or via /discovery endpoint)

Wind Speed Sensor (11)

Read
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 14)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Service Attributes
Value Types
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
    var ret := "";
    var i := 0;
    do
        if ! isnull(PARSEJSON(response.content, "$.values[" + i + "].valueTypeId", true))
            ret := ret + PARSEJSON(response.content, "$.values[" + i + "].valueTypeId", true);
            ret := ret + " - " + PARSEJSON(response.content, "$.values[" + i + "].valueTypeName", true);
            ret := ret + "\n";
        end
        i := i + 1;
    loop while i < 10
    RETURN(ret);
END

Reed Contact (11) Reed Contact Read-only
numeric json_path
Variable: IdTapHome device ID — set to the ID of the device you want to control (find in TapHome app or via /discovery endpoint)

Reed Contact (11)

Read
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 44)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Temperature Sensor (11) Temperature Sensor Read-only

Temperature (°C) and humidity (%) readings

numeric Unit: °C / % json_path
Variable: IdTapHome device ID — set to the ID of the device you want to control (find in TapHome app or via /discovery endpoint)

Temperature Sensor (11)

Read humidity
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 3)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Read temperature
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 5)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Thermostat (11) Thermostat

Current temperature, humidity, and adjustable temperature setpoint

numeric Unit: °C json_path
Variable: IdTapHome device ID — set to the ID of the device you want to control (find in TapHome app or via /discovery endpoint)

Thermostat (11)

Read temperature
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 5)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Read humidity
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 3)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Read desired temperature
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 6)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Write desired temperature
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/setDeviceValue/" + Id + "?valueTypeId=6&value=" + Se, "GET", "", "Authorization: TapHome " + API_token);
IF(!response.IsSuccess)
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Multi-Value Switch (11) Multi-value Switch

Numeric mode selector with values 0-9 for multi-mode device control

numeric json_path
Variable: IdTapHome device ID — set to the ID of the device you want to control (find in TapHome app or via /discovery endpoint)

Multi-Value Switch (11)

Read switch state
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 49)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Write switch state
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/setDeviceValue/" + Id + "?valueTypeId=49&value=" + Mu, "GET", "", "Authorization: TapHome " + API_token);
IF(!response.IsSuccess)
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Blind (11) Blind

Position level (%) and tilt angle control for blinds and shutters

numeric Unit: % json_path
Variable: IdTapHome device ID — set to the ID of the device you want to control (find in TapHome app or via /discovery endpoint)

Blind (11)

Read blind level
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 46)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Write blind level
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/setDeviceValue/" + Id + "?valueTypeId=46&value=" + Bl, "GET", "", "Authorization: TapHome " + API_token);
IF(!response.IsSuccess)
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Read blind slope
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 10)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Write blind slope
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/setDeviceValue/" + Id + "?valueTypeId=10&value=" + Bs, "GET", "", "Authorization: TapHome " + API_token);
IF(!response.IsSuccess)
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Analog Input (12) Analog Input Read-only
numeric json_path
Variable: IdTapHome device ID — set to the ID of the device you want to control (find in TapHome app or via /discovery endpoint)

Analog Input (12)

Read input level
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 55)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Analog Output (12) Dimmer

Continuous output level (0-100 %) for dimmers, valve actuators, or analog output devices

numeric Unit: % json_path
Variable: IdTapHome device ID — set to the ID of the device you want to control (find in TapHome app or via /discovery endpoint)

Analog Output (12)

Read level
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 42)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Write level
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/setDeviceValue/" + Id + "?valueTypeId=42&value=" + Le, "GET", "", "Authorization: TapHome " + API_token);
IF(!response.IsSuccess)
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Switch (12) Switch
numeric json_path
Values / States: ON · OFF
Variable: IdTapHome device ID — set to the ID of the device you want to control (find in TapHome app or via /discovery endpoint)

Switch (12)

Read switch state
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 48)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Write switch state
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/setDeviceValue/" + Id + "?valueTypeId=48&value=" + St, "GET", "", "Authorization: TapHome " + API_token);
IF(!response.IsSuccess)
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Dual White Light (12) White Light

Brightness and correlated color temperature (CCT) control for tunable white lighting

numeric json_path
Variable: IdTapHome device ID — set to the ID of the device you want to control (find in TapHome app or via /discovery endpoint)

Dual White Light (12)

Read brightness
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 65)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Write brightness
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/setDeviceValue/" + Id + "?valueTypeId=65&value=" + Hb, "GET", "", "Authorization: TapHome " + API_token);
IF(!response.IsSuccess)
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Read color temperature
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 89)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Write color temperature
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/setDeviceValue/" + Id + "?valueTypeId=89&value=" + Ct, "GET", "", "Authorization: TapHome " + API_token);
IF(!response.IsSuccess)
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Electricity Meter (12) Electricity Meter Read-only

Cumulative energy consumption (kWh) and instantaneous power demand (kW)

numeric Unit: kWh / kW json_path
Variable: IdTapHome device ID — set to the ID of the device you want to control (find in TapHome app or via /discovery endpoint)

Electricity Meter (12)

Read total consumption
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 59)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Read demand
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 60)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Brightness Sensor (12) Variable Read-only
numeric Unit: lux json_path
Service Attributes
Value Types
Variable: IdTapHome device ID — set to the ID of the device you want to control (find in TapHome app or via /discovery endpoint)

Brightness Sensor (12)

Read
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 2)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Service Attributes
Value Types
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
    var ret := "";
    var i := 0;
    do
        if ! isnull(PARSEJSON(response.content, "$.values[" + i + "].valueTypeId", true))
            ret := ret + PARSEJSON(response.content, "$.values[" + i + "].valueTypeId", true);
            ret := ret + " - " + PARSEJSON(response.content, "$.values[" + i + "].valueTypeName", true);
            ret := ret + "\n";
        end
        i := i + 1;
    loop while i < 10
    RETURN(ret);
END

Variable (12) Variable
numeric json_path
Service Attributes
Value Types
Variable: IdTapHome device ID — set to the ID of the device you want to control (find in TapHome app or via /discovery endpoint)

Variable (12)

Read
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 62)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Write
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/setDeviceValue/" + Id + "?valueTypeId=62&value=" + Va, "GET", "", "Authorization: TapHome " + API_token);
IF(!response.IsSuccess)
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Service Attributes
Value Types
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
    var ret := "";
    var i := 0;
    do
        if ! isnull(PARSEJSON(response.content, "$.values[" + i + "].valueTypeId", true))
            ret := ret + PARSEJSON(response.content, "$.values[" + i + "].valueTypeId", true);
            ret := ret + " - " + PARSEJSON(response.content, "$.values[" + i + "].valueTypeName", true);
            ret := ret + "\n";
        end
        i := i + 1;
    loop while i < 10
    RETURN(ret);
END

RGB Light (12) HSB Light

Full HSB color control — hue, saturation, brightness, and correlated color temperature

numeric json_path
Variable: IdTapHome device ID — set to the ID of the device you want to control (find in TapHome app or via /discovery endpoint)

RGB Light (12)

Read brightness
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 65)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Write brightness
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/setDeviceValue/" + Id + "?valueTypeId=65&value=" + Hb, "GET", "", "Authorization: TapHome " + API_token);
IF(!response.IsSuccess)
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Read hue
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 40)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Write hue
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/setDeviceValue/" + Id + "?valueTypeId=40&value=" + Hd, "GET", "", "Authorization: TapHome " + API_token);
IF(!response.IsSuccess)
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Read saturation
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 41)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Write saturation
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/setDeviceValue/" + Id + "?valueTypeId=41&value=" + Sa, "GET", "", "Authorization: TapHome " + API_token);
IF(!response.IsSuccess)
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Read color temperature
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 89)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Write color temperature
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/setDeviceValue/" + Id + "?valueTypeId=89&value=" + Ct, "GET", "", "Authorization: TapHome " + API_token);
IF(!response.IsSuccess)
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Slide (12) Slide
numeric Unit: % json_path
Variable: IdTapHome device ID — set to the ID of the device you want to control (find in TapHome app or via /discovery endpoint)

Slide (12)

Read blind level
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 46)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Write blind level
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/setDeviceValue/" + Id + "?valueTypeId=46&value=" + Bl, "GET", "", "Authorization: TapHome " + API_token);
IF(!response.IsSuccess)
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Wind Speed Sensor (12) Variable Read-only
numeric Unit: m/s json_path
Service Attributes
Value Types
Variable: IdTapHome device ID — set to the ID of the device you want to control (find in TapHome app or via /discovery endpoint)

Wind Speed Sensor (12)

Read
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 14)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Service Attributes
Value Types
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
    var ret := "";
    var i := 0;
    do
        if ! isnull(PARSEJSON(response.content, "$.values[" + i + "].valueTypeId", true))
            ret := ret + PARSEJSON(response.content, "$.values[" + i + "].valueTypeId", true);
            ret := ret + " - " + PARSEJSON(response.content, "$.values[" + i + "].valueTypeName", true);
            ret := ret + "\n";
        end
        i := i + 1;
    loop while i < 10
    RETURN(ret);
END

Reed Contact (12) Reed Contact Read-only
numeric json_path
Variable: IdTapHome device ID — set to the ID of the device you want to control (find in TapHome app or via /discovery endpoint)

Reed Contact (12)

Read
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 44)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Temperature Sensor (12) Temperature Sensor Read-only

Temperature (°C) and humidity (%) readings

numeric Unit: °C / % json_path
Variable: IdTapHome device ID — set to the ID of the device you want to control (find in TapHome app or via /discovery endpoint)

Temperature Sensor (12)

Read humidity
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 3)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Read temperature
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 5)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Thermostat (12) Thermostat

Current temperature, humidity, and adjustable temperature setpoint

numeric Unit: °C json_path
Variable: IdTapHome device ID — set to the ID of the device you want to control (find in TapHome app or via /discovery endpoint)

Thermostat (12)

Read temperature
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 5)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Read humidity
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 3)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Read desired temperature
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 6)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Write desired temperature
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/setDeviceValue/" + Id + "?valueTypeId=6&value=" + Se, "GET", "", "Authorization: TapHome " + API_token);
IF(!response.IsSuccess)
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Multi-Value Switch (12) Multi-value Switch

Numeric mode selector with values 0-9 for multi-mode device control

numeric json_path
Variable: IdTapHome device ID — set to the ID of the device you want to control (find in TapHome app or via /discovery endpoint)

Multi-Value Switch (12)

Read switch state
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 49)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Write switch state
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/setDeviceValue/" + Id + "?valueTypeId=49&value=" + Mu, "GET", "", "Authorization: TapHome " + API_token);
IF(!response.IsSuccess)
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Blind (12) Blind

Position level (%) and tilt angle control for blinds and shutters

numeric Unit: % json_path
Variable: IdTapHome device ID — set to the ID of the device you want to control (find in TapHome app or via /discovery endpoint)

Blind (12)

Read blind level
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 46)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Write blind level
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/setDeviceValue/" + Id + "?valueTypeId=46&value=" + Bl, "GET", "", "Authorization: TapHome " + API_token);
IF(!response.IsSuccess)
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Read blind slope
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 10)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Write blind slope
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/setDeviceValue/" + Id + "?valueTypeId=10&value=" + Bs, "GET", "", "Authorization: TapHome " + API_token);
IF(!response.IsSuccess)
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Analog Input (13) Analog Input Read-only
numeric json_path
Variable: IdTapHome device ID — set to the ID of the device you want to control (find in TapHome app or via /discovery endpoint)

Analog Input (13)

Read input level
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 55)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Analog Output (13) Dimmer

Continuous output level (0-100 %) for dimmers, valve actuators, or analog output devices

numeric Unit: % json_path
Variable: IdTapHome device ID — set to the ID of the device you want to control (find in TapHome app or via /discovery endpoint)

Analog Output (13)

Read level
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 42)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Write level
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/setDeviceValue/" + Id + "?valueTypeId=42&value=" + Le, "GET", "", "Authorization: TapHome " + API_token);
IF(!response.IsSuccess)
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Switch (13) Switch
numeric json_path
Values / States: ON · OFF
Variable: IdTapHome device ID — set to the ID of the device you want to control (find in TapHome app or via /discovery endpoint)

Switch (13)

Read switch state
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 48)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Write switch state
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/setDeviceValue/" + Id + "?valueTypeId=48&value=" + St, "GET", "", "Authorization: TapHome " + API_token);
IF(!response.IsSuccess)
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Dual White Light (13) White Light

Brightness and correlated color temperature (CCT) control for tunable white lighting

numeric json_path
Variable: IdTapHome device ID — set to the ID of the device you want to control (find in TapHome app or via /discovery endpoint)

Dual White Light (13)

Read brightness
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 65)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Write brightness
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/setDeviceValue/" + Id + "?valueTypeId=65&value=" + Hb, "GET", "", "Authorization: TapHome " + API_token);
IF(!response.IsSuccess)
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Read color temperature
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 89)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Write color temperature
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/setDeviceValue/" + Id + "?valueTypeId=89&value=" + Ct, "GET", "", "Authorization: TapHome " + API_token);
IF(!response.IsSuccess)
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Electricity Meter (13) Electricity Meter Read-only

Cumulative energy consumption (kWh) and instantaneous power demand (kW)

numeric Unit: kWh / kW json_path
Variable: IdTapHome device ID — set to the ID of the device you want to control (find in TapHome app or via /discovery endpoint)

Electricity Meter (13)

Read total consumption
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 59)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Read demand
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 60)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Brightness Sensor (13) Variable Read-only
numeric Unit: lux json_path
Service Attributes
Value Types
Variable: IdTapHome device ID — set to the ID of the device you want to control (find in TapHome app or via /discovery endpoint)

Brightness Sensor (13)

Read
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 2)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Service Attributes
Value Types
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
    var ret := "";
    var i := 0;
    do
        if ! isnull(PARSEJSON(response.content, "$.values[" + i + "].valueTypeId", true))
            ret := ret + PARSEJSON(response.content, "$.values[" + i + "].valueTypeId", true);
            ret := ret + " - " + PARSEJSON(response.content, "$.values[" + i + "].valueTypeName", true);
            ret := ret + "\n";
        end
        i := i + 1;
    loop while i < 10
    RETURN(ret);
END

Variable (13) Variable
numeric json_path
Service Attributes
Value Types
Variable: IdTapHome device ID — set to the ID of the device you want to control (find in TapHome app or via /discovery endpoint)

Variable (13)

Read
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 62)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Write
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/setDeviceValue/" + Id + "?valueTypeId=62&value=" + Va, "GET", "", "Authorization: TapHome " + API_token);
IF(!response.IsSuccess)
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Service Attributes
Value Types
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
    var ret := "";
    var i := 0;
    do
        if ! isnull(PARSEJSON(response.content, "$.values[" + i + "].valueTypeId", true))
            ret := ret + PARSEJSON(response.content, "$.values[" + i + "].valueTypeId", true);
            ret := ret + " - " + PARSEJSON(response.content, "$.values[" + i + "].valueTypeName", true);
            ret := ret + "\n";
        end
        i := i + 1;
    loop while i < 10
    RETURN(ret);
END

RGB Light (13) HSB Light

Full HSB color control — hue, saturation, brightness, and correlated color temperature

numeric json_path
Variable: IdTapHome device ID — set to the ID of the device you want to control (find in TapHome app or via /discovery endpoint)

RGB Light (13)

Read brightness
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 65)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Write brightness
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/setDeviceValue/" + Id + "?valueTypeId=65&value=" + Hb, "GET", "", "Authorization: TapHome " + API_token);
IF(!response.IsSuccess)
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Read hue
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 40)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Write hue
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/setDeviceValue/" + Id + "?valueTypeId=40&value=" + Hd, "GET", "", "Authorization: TapHome " + API_token);
IF(!response.IsSuccess)
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Read saturation
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 41)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Write saturation
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/setDeviceValue/" + Id + "?valueTypeId=41&value=" + Sa, "GET", "", "Authorization: TapHome " + API_token);
IF(!response.IsSuccess)
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Read color temperature
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 89)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Write color temperature
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/setDeviceValue/" + Id + "?valueTypeId=89&value=" + Ct, "GET", "", "Authorization: TapHome " + API_token);
IF(!response.IsSuccess)
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Slide (13) Slide
numeric Unit: % json_path
Variable: IdTapHome device ID — set to the ID of the device you want to control (find in TapHome app or via /discovery endpoint)

Slide (13)

Read blind level
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 46)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Write blind level
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/setDeviceValue/" + Id + "?valueTypeId=46&value=" + Bl, "GET", "", "Authorization: TapHome " + API_token);
IF(!response.IsSuccess)
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Wind Speed Sensor (13) Variable Read-only
numeric Unit: m/s json_path
Service Attributes
Value Types
Variable: IdTapHome device ID — set to the ID of the device you want to control (find in TapHome app or via /discovery endpoint)

Wind Speed Sensor (13)

Read
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 14)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Service Attributes
Value Types
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
    var ret := "";
    var i := 0;
    do
        if ! isnull(PARSEJSON(response.content, "$.values[" + i + "].valueTypeId", true))
            ret := ret + PARSEJSON(response.content, "$.values[" + i + "].valueTypeId", true);
            ret := ret + " - " + PARSEJSON(response.content, "$.values[" + i + "].valueTypeName", true);
            ret := ret + "\n";
        end
        i := i + 1;
    loop while i < 10
    RETURN(ret);
END

Reed Contact (13) Reed Contact Read-only
numeric json_path
Variable: IdTapHome device ID — set to the ID of the device you want to control (find in TapHome app or via /discovery endpoint)

Reed Contact (13)

Read
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 44)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Temperature Sensor (13) Temperature Sensor Read-only

Temperature (°C) and humidity (%) readings

numeric Unit: °C / % json_path
Variable: IdTapHome device ID — set to the ID of the device you want to control (find in TapHome app or via /discovery endpoint)

Temperature Sensor (13)

Read humidity
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 3)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Read temperature
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 5)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Thermostat (13) Thermostat

Current temperature, humidity, and adjustable temperature setpoint

numeric Unit: °C json_path
Variable: IdTapHome device ID — set to the ID of the device you want to control (find in TapHome app or via /discovery endpoint)

Thermostat (13)

Read temperature
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 5)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Read humidity
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 3)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Read desired temperature
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 6)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Write desired temperature
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/setDeviceValue/" + Id + "?valueTypeId=6&value=" + Se, "GET", "", "Authorization: TapHome " + API_token);
IF(!response.IsSuccess)
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Multi-Value Switch (13) Multi-value Switch

Numeric mode selector with values 0-9 for multi-mode device control

numeric json_path
Variable: IdTapHome device ID — set to the ID of the device you want to control (find in TapHome app or via /discovery endpoint)

Multi-Value Switch (13)

Read switch state
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 49)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Write switch state
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/setDeviceValue/" + Id + "?valueTypeId=49&value=" + Mu, "GET", "", "Authorization: TapHome " + API_token);
IF(!response.IsSuccess)
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Blind (13) Blind

Position level (%) and tilt angle control for blinds and shutters

numeric Unit: % json_path
Variable: IdTapHome device ID — set to the ID of the device you want to control (find in TapHome app or via /discovery endpoint)

Blind (13)

Read blind level
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 46)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Write blind level
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/setDeviceValue/" + Id + "?valueTypeId=46&value=" + Bl, "GET", "", "Authorization: TapHome " + API_token);
IF(!response.IsSuccess)
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Read blind slope
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 10)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Write blind slope
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/setDeviceValue/" + Id + "?valueTypeId=10&value=" + Bs, "GET", "", "Authorization: TapHome " + API_token);
IF(!response.IsSuccess)
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Analog Input (14) Analog Input Read-only
numeric json_path
Variable: IdTapHome device ID — set to the ID of the device you want to control (find in TapHome app or via /discovery endpoint)

Analog Input (14)

Read input level
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 55)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Analog Output (14) Dimmer

Continuous output level (0-100 %) for dimmers, valve actuators, or analog output devices

numeric Unit: % json_path
Variable: IdTapHome device ID — set to the ID of the device you want to control (find in TapHome app or via /discovery endpoint)

Analog Output (14)

Read level
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 42)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Write level
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/setDeviceValue/" + Id + "?valueTypeId=42&value=" + Le, "GET", "", "Authorization: TapHome " + API_token);
IF(!response.IsSuccess)
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Switch (14) Switch
numeric json_path
Values / States: ON · OFF
Variable: IdTapHome device ID — set to the ID of the device you want to control (find in TapHome app or via /discovery endpoint)

Switch (14)

Read switch state
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 48)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Write switch state
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/setDeviceValue/" + Id + "?valueTypeId=48&value=" + St, "GET", "", "Authorization: TapHome " + API_token);
IF(!response.IsSuccess)
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Dual White Light (14) White Light

Brightness and correlated color temperature (CCT) control for tunable white lighting

numeric json_path
Variable: IdTapHome device ID — set to the ID of the device you want to control (find in TapHome app or via /discovery endpoint)

Dual White Light (14)

Read brightness
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 65)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Write brightness
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/setDeviceValue/" + Id + "?valueTypeId=65&value=" + Hb, "GET", "", "Authorization: TapHome " + API_token);
IF(!response.IsSuccess)
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Read color temperature
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 89)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Write color temperature
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/setDeviceValue/" + Id + "?valueTypeId=89&value=" + Ct, "GET", "", "Authorization: TapHome " + API_token);
IF(!response.IsSuccess)
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Electricity Meter (14) Electricity Meter Read-only

Cumulative energy consumption (kWh) and instantaneous power demand (kW)

numeric Unit: kWh / kW json_path
Variable: IdTapHome device ID — set to the ID of the device you want to control (find in TapHome app or via /discovery endpoint)

Electricity Meter (14)

Read total consumption
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 59)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Read demand
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 60)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Brightness Sensor (14) Variable Read-only
numeric Unit: lux json_path
Service Attributes
Value Types
Variable: IdTapHome device ID — set to the ID of the device you want to control (find in TapHome app or via /discovery endpoint)

Brightness Sensor (14)

Read
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 2)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Service Attributes
Value Types
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
    var ret := "";
    var i := 0;
    do
        if ! isnull(PARSEJSON(response.content, "$.values[" + i + "].valueTypeId", true))
            ret := ret + PARSEJSON(response.content, "$.values[" + i + "].valueTypeId", true);
            ret := ret + " - " + PARSEJSON(response.content, "$.values[" + i + "].valueTypeName", true);
            ret := ret + "\n";
        end
        i := i + 1;
    loop while i < 10
    RETURN(ret);
END

Variable (14) Variable
numeric json_path
Service Attributes
Value Types
Variable: IdTapHome device ID — set to the ID of the device you want to control (find in TapHome app or via /discovery endpoint)

Variable (14)

Read
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 62)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Write
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/setDeviceValue/" + Id + "?valueTypeId=62&value=" + Va, "GET", "", "Authorization: TapHome " + API_token);
IF(!response.IsSuccess)
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Service Attributes
Value Types
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
    var ret := "";
    var i := 0;
    do
        if ! isnull(PARSEJSON(response.content, "$.values[" + i + "].valueTypeId", true))
            ret := ret + PARSEJSON(response.content, "$.values[" + i + "].valueTypeId", true);
            ret := ret + " - " + PARSEJSON(response.content, "$.values[" + i + "].valueTypeName", true);
            ret := ret + "\n";
        end
        i := i + 1;
    loop while i < 10
    RETURN(ret);
END

RGB Light (14) HSB Light

Full HSB color control — hue, saturation, brightness, and correlated color temperature

numeric json_path
Variable: IdTapHome device ID — set to the ID of the device you want to control (find in TapHome app or via /discovery endpoint)

RGB Light (14)

Read brightness
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 65)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Write brightness
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/setDeviceValue/" + Id + "?valueTypeId=65&value=" + Hb, "GET", "", "Authorization: TapHome " + API_token);
IF(!response.IsSuccess)
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Read hue
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 40)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Write hue
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/setDeviceValue/" + Id + "?valueTypeId=40&value=" + Hd, "GET", "", "Authorization: TapHome " + API_token);
IF(!response.IsSuccess)
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Read saturation
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 41)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Write saturation
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/setDeviceValue/" + Id + "?valueTypeId=41&value=" + Sa, "GET", "", "Authorization: TapHome " + API_token);
IF(!response.IsSuccess)
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Read color temperature
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 89)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Write color temperature
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/setDeviceValue/" + Id + "?valueTypeId=89&value=" + Ct, "GET", "", "Authorization: TapHome " + API_token);
IF(!response.IsSuccess)
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Slide (14) Slide
numeric Unit: % json_path
Variable: IdTapHome device ID — set to the ID of the device you want to control (find in TapHome app or via /discovery endpoint)

Slide (14)

Read blind level
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 46)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Write blind level
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/setDeviceValue/" + Id + "?valueTypeId=46&value=" + Bl, "GET", "", "Authorization: TapHome " + API_token);
IF(!response.IsSuccess)
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Wind Speed Sensor (14) Variable Read-only
numeric Unit: m/s json_path
Service Attributes
Value Types
Variable: IdTapHome device ID — set to the ID of the device you want to control (find in TapHome app or via /discovery endpoint)

Wind Speed Sensor (14)

Read
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 14)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Service Attributes
Value Types
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
    var ret := "";
    var i := 0;
    do
        if ! isnull(PARSEJSON(response.content, "$.values[" + i + "].valueTypeId", true))
            ret := ret + PARSEJSON(response.content, "$.values[" + i + "].valueTypeId", true);
            ret := ret + " - " + PARSEJSON(response.content, "$.values[" + i + "].valueTypeName", true);
            ret := ret + "\n";
        end
        i := i + 1;
    loop while i < 10
    RETURN(ret);
END

Reed Contact (14) Reed Contact Read-only
numeric json_path
Variable: IdTapHome device ID — set to the ID of the device you want to control (find in TapHome app or via /discovery endpoint)

Reed Contact (14)

Read
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 44)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Temperature Sensor (14) Temperature Sensor Read-only

Temperature (°C) and humidity (%) readings

numeric Unit: °C / % json_path
Variable: IdTapHome device ID — set to the ID of the device you want to control (find in TapHome app or via /discovery endpoint)

Temperature Sensor (14)

Read humidity
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 3)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Read temperature
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 5)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Thermostat (14) Thermostat

Current temperature, humidity, and adjustable temperature setpoint

numeric Unit: °C json_path
Variable: IdTapHome device ID — set to the ID of the device you want to control (find in TapHome app or via /discovery endpoint)

Thermostat (14)

Read temperature
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 5)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Read humidity
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 3)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Read desired temperature
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 6)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Write desired temperature
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/setDeviceValue/" + Id + "?valueTypeId=6&value=" + Se, "GET", "", "Authorization: TapHome " + API_token);
IF(!response.IsSuccess)
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Multi-Value Switch (14) Multi-value Switch

Numeric mode selector with values 0-9 for multi-mode device control

numeric json_path
Variable: IdTapHome device ID — set to the ID of the device you want to control (find in TapHome app or via /discovery endpoint)

Multi-Value Switch (14)

Read switch state
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 49)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Write switch state
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/setDeviceValue/" + Id + "?valueTypeId=49&value=" + Mu, "GET", "", "Authorization: TapHome " + API_token);
IF(!response.IsSuccess)
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Blind (14) Blind

Position level (%) and tilt angle control for blinds and shutters

numeric Unit: % json_path
Variable: IdTapHome device ID — set to the ID of the device you want to control (find in TapHome app or via /discovery endpoint)

Blind (14)

Read blind level
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 46)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Write blind level
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/setDeviceValue/" + Id + "?valueTypeId=46&value=" + Bl, "GET", "", "Authorization: TapHome " + API_token);
IF(!response.IsSuccess)
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Read blind slope
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 10)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Write blind slope
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/setDeviceValue/" + Id + "?valueTypeId=10&value=" + Bs, "GET", "", "Authorization: TapHome " + API_token);
IF(!response.IsSuccess)
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Analog Input (15) Analog Input Read-only
numeric json_path
Variable: IdTapHome device ID — set to the ID of the device you want to control (find in TapHome app or via /discovery endpoint)

Analog Input (15)

Read input level
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 55)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Analog Output (15) Dimmer

Continuous output level (0-100 %) for dimmers, valve actuators, or analog output devices

numeric Unit: % json_path
Variable: IdTapHome device ID — set to the ID of the device you want to control (find in TapHome app or via /discovery endpoint)

Analog Output (15)

Read level
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 42)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Write level
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/setDeviceValue/" + Id + "?valueTypeId=42&value=" + Le, "GET", "", "Authorization: TapHome " + API_token);
IF(!response.IsSuccess)
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Switch (15) Switch
numeric json_path
Values / States: ON · OFF
Variable: IdTapHome device ID — set to the ID of the device you want to control (find in TapHome app or via /discovery endpoint)

Switch (15)

Read switch state
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 48)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Write switch state
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/setDeviceValue/" + Id + "?valueTypeId=48&value=" + St, "GET", "", "Authorization: TapHome " + API_token);
IF(!response.IsSuccess)
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Dual White Light (15) White Light

Brightness and correlated color temperature (CCT) control for tunable white lighting

numeric json_path
Variable: IdTapHome device ID — set to the ID of the device you want to control (find in TapHome app or via /discovery endpoint)

Dual White Light (15)

Read brightness
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 65)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Write brightness
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/setDeviceValue/" + Id + "?valueTypeId=65&value=" + Hb, "GET", "", "Authorization: TapHome " + API_token);
IF(!response.IsSuccess)
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Read color temperature
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 89)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Write color temperature
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/setDeviceValue/" + Id + "?valueTypeId=89&value=" + Ct, "GET", "", "Authorization: TapHome " + API_token);
IF(!response.IsSuccess)
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Electricity Meter (15) Electricity Meter Read-only

Cumulative energy consumption (kWh) and instantaneous power demand (kW)

numeric Unit: kWh / kW json_path
Variable: IdTapHome device ID — set to the ID of the device you want to control (find in TapHome app or via /discovery endpoint)

Electricity Meter (15)

Read total consumption
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 59)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Read demand
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 60)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Brightness Sensor (15) Variable Read-only
numeric Unit: lux json_path
Service Attributes
Value Types
Variable: IdTapHome device ID — set to the ID of the device you want to control (find in TapHome app or via /discovery endpoint)

Brightness Sensor (15)

Read
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 2)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Service Attributes
Value Types
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
    var ret := "";
    var i := 0;
    do
        if ! isnull(PARSEJSON(response.content, "$.values[" + i + "].valueTypeId", true))
            ret := ret + PARSEJSON(response.content, "$.values[" + i + "].valueTypeId", true);
            ret := ret + " - " + PARSEJSON(response.content, "$.values[" + i + "].valueTypeName", true);
            ret := ret + "\n";
        end
        i := i + 1;
    loop while i < 10
    RETURN(ret);
END

Variable (15) Variable
numeric json_path
Service Attributes
Value Types
Variable: IdTapHome device ID — set to the ID of the device you want to control (find in TapHome app or via /discovery endpoint)

Variable (15)

Read
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 62)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Write
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/setDeviceValue/" + Id + "?valueTypeId=62&value=" + Va, "GET", "", "Authorization: TapHome " + API_token);
IF(!response.IsSuccess)
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Service Attributes
Value Types
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
    var ret := "";
    var i := 0;
    do
        if ! isnull(PARSEJSON(response.content, "$.values[" + i + "].valueTypeId", true))
            ret := ret + PARSEJSON(response.content, "$.values[" + i + "].valueTypeId", true);
            ret := ret + " - " + PARSEJSON(response.content, "$.values[" + i + "].valueTypeName", true);
            ret := ret + "\n";
        end
        i := i + 1;
    loop while i < 10
    RETURN(ret);
END

RGB Light (15) HSB Light

Full HSB color control — hue, saturation, brightness, and correlated color temperature

numeric json_path
Variable: IdTapHome device ID — set to the ID of the device you want to control (find in TapHome app or via /discovery endpoint)

RGB Light (15)

Read brightness
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 65)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Write brightness
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/setDeviceValue/" + Id + "?valueTypeId=65&value=" + Hb, "GET", "", "Authorization: TapHome " + API_token);
IF(!response.IsSuccess)
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Read hue
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 40)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Write hue
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/setDeviceValue/" + Id + "?valueTypeId=40&value=" + Hd, "GET", "", "Authorization: TapHome " + API_token);
IF(!response.IsSuccess)
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Read saturation
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 41)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Write saturation
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/setDeviceValue/" + Id + "?valueTypeId=41&value=" + Sa, "GET", "", "Authorization: TapHome " + API_token);
IF(!response.IsSuccess)
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Read color temperature
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 89)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Write color temperature
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/setDeviceValue/" + Id + "?valueTypeId=89&value=" + Ct, "GET", "", "Authorization: TapHome " + API_token);
IF(!response.IsSuccess)
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Slide (15) Slide
numeric Unit: % json_path
Variable: IdTapHome device ID — set to the ID of the device you want to control (find in TapHome app or via /discovery endpoint)

Slide (15)

Read blind level
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 46)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Write blind level
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/setDeviceValue/" + Id + "?valueTypeId=46&value=" + Bl, "GET", "", "Authorization: TapHome " + API_token);
IF(!response.IsSuccess)
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Wind Speed Sensor (15) Variable Read-only
numeric Unit: m/s json_path
Service Attributes
Value Types
Variable: IdTapHome device ID — set to the ID of the device you want to control (find in TapHome app or via /discovery endpoint)

Wind Speed Sensor (15)

Read
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 14)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Service Attributes
Value Types
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
    var ret := "";
    var i := 0;
    do
        if ! isnull(PARSEJSON(response.content, "$.values[" + i + "].valueTypeId", true))
            ret := ret + PARSEJSON(response.content, "$.values[" + i + "].valueTypeId", true);
            ret := ret + " - " + PARSEJSON(response.content, "$.values[" + i + "].valueTypeName", true);
            ret := ret + "\n";
        end
        i := i + 1;
    loop while i < 10
    RETURN(ret);
END

Reed Contact (15) Reed Contact Read-only
numeric json_path
Variable: IdTapHome device ID — set to the ID of the device you want to control (find in TapHome app or via /discovery endpoint)

Reed Contact (15)

Read
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 44)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Temperature Sensor (15) Temperature Sensor Read-only

Temperature (°C) and humidity (%) readings

numeric Unit: °C / % json_path
Variable: IdTapHome device ID — set to the ID of the device you want to control (find in TapHome app or via /discovery endpoint)

Temperature Sensor (15)

Read humidity
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 3)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Read temperature
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 5)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Thermostat (15) Thermostat

Current temperature, humidity, and adjustable temperature setpoint

numeric Unit: °C json_path
Variable: IdTapHome device ID — set to the ID of the device you want to control (find in TapHome app or via /discovery endpoint)

Thermostat (15)

Read temperature
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 5)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Read humidity
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 3)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Read desired temperature
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 6)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Write desired temperature
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/setDeviceValue/" + Id + "?valueTypeId=6&value=" + Se, "GET", "", "Authorization: TapHome " + API_token);
IF(!response.IsSuccess)
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Multi-Value Switch (15) Multi-value Switch

Numeric mode selector with values 0-9 for multi-mode device control

numeric json_path
Variable: IdTapHome device ID — set to the ID of the device you want to control (find in TapHome app or via /discovery endpoint)

Multi-Value Switch (15)

Read switch state
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 49)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Write switch state
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/setDeviceValue/" + Id + "?valueTypeId=49&value=" + Mu, "GET", "", "Authorization: TapHome " + API_token);
IF(!response.IsSuccess)
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Blind (15) Blind

Position level (%) and tilt angle control for blinds and shutters

numeric Unit: % json_path
Variable: IdTapHome device ID — set to the ID of the device you want to control (find in TapHome app or via /discovery endpoint)

Blind (15)

Read blind level
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 46)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Write blind level
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/setDeviceValue/" + Id + "?valueTypeId=46&value=" + Bl, "GET", "", "Authorization: TapHome " + API_token);
IF(!response.IsSuccess)
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Read blind slope
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/getDeviceValue/" + Id, "GET", "", "Authorization: TapHome " + API_token);
IF(response.IsSuccess)
 var value := PARSEJSON(response.content, "$.values[?(@.valueTypeId == 10)].value", true);
 IF ISNULL(value)
 	ADDERROR("Incorrect device type for ID " + Id);
	RETURN(NaN);
 ELSE
 	RETURN(TODOUBLE(value));
 END
ELSE
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Write blind slope
VAR response := SENDHTTPREQUEST("/api/taphomeapi/v1/setDeviceValue/" + Id + "?valueTypeId=10&value=" + Bs, "GET", "", "Authorization: TapHome " + API_token);
IF(!response.IsSuccess)
 ADDERROR("Response:" + response.StatusCode + "|" + PARSEJSON(response.content, "$.title") + " - " + PARSEJSON(response.content, "$.detail"));
 RETURN(NaN);
END
Connection: Packet Parser → HTTP
Possible improvements (10)
  • Device Status — DeviceStatus (read-only) available on all devices via discovery but not polled by template
  • Operation Mode — OperationMode (manual/automatic) — system property visible in getDeviceValue response
  • Manual Timeout — ManualTimeout — system property visible in getDeviceValue response
  • Analog Output Desired Value — AnalogOutputDesiredValue — separate from actual AnalogOutputValue (42)
  • Hue Brightness Desired Value — HueBrightnessDesiredValue — desired vs actual brightness for lighting
  • Multi-Value Switch Desired State — MultiValueSwitchDesiredState — desired vs actual state for MVS
  • Blinds Is Moving — BlindsIsMoving — motion detection for blind/slide devices
  • Device Discovery — Full device list with supported value types — available via module SA but not per-device
  • Location Info — Core location metadata and connectivity status
  • Webhook Push Notifications — Real-time state change notifications via HTTP POST — 300ms throttle, alternative to polling

Sources

  • TapHome API Official Documentation
    taphome.com 2026-03-28
  • TapHome HA Integration — ValueType Reference
    github.com 2026-03-28
  • TapHome HA Integration — API Client Implementation
    github.com 2026-03-28