---
title: Sterowanie telewizorem Samsung poprzez SmartThings
description: Celem niniejszego artykułu jest zaprezentowanie przykładu integracji telewizora Samsung z Systemem Grenton Smart Home z wykorzystaniem Gate Http oraz SmartThings.  Urządzenie, które zostało zastosowan
---

[Przejdź do treści](https://knowledgebase.grenton.com/pl/sterowanie-telewizorem-samsung-poprzez-smartthings#main-content)

- [Polski](https://knowledgebase.grenton.com/pl/sterowanie-telewizorem-samsung-poprzez-smartthings)
- [English](https://knowledgebase.grenton.com/en/sterowanie-telewizorem-poprzez-smarthings)

Polski

Pokaż podmenu do tłumaczenia

[Nowe zgłoszenie](https://knowledgebase.grenton.com/pl/kb-tickets/new?hsLang=pl) [Portal klienta](https://knowledgebase.grenton.com/wsparcie?hsLang=pl)

![Logo\_Grenton\_Main\_2020\_RGB\_v1.0-1.png\]](https://knowledgebase.grenton.com/hs-fs/hubfs/Logo_Grenton_Main_2020_RGB_v1.0-1.png?width=200&height=94&name=Logo_Grenton_Main_2020_RGB_v1.0-1.png)

Otwórz główne menu nawigacji

Zamknij główne menu nawigacji

- - [Polski](https://knowledgebase.grenton.com/pl/sterowanie-telewizorem-samsung-poprzez-smartthings)
    - [English](https://knowledgebase.grenton.com/en/sterowanie-telewizorem-poprzez-smarthings)

  Polski
  
  Pokaż podmenu do tłumaczenia
- [Nowe zgłoszenie](https://knowledgebase.grenton.com/pl/kb-tickets/new)
- [Portal klienta](https://knowledgebase.grenton.com/wsparcie)
- [Szkolenia](https://szkolenia.grenton.pl/)

[Szkolenia](https://szkolenia.grenton.pl/)

 Witaj. Jak możemy Ci pomóc?

- Brak sugerowanych wyników, ponieważ pole wyszukiwania jest puste.

1. [Baza wiedzy](https://knowledgebase.grenton.com/pl?hsLang=pl)
2. [Konfiguracja i Integracje](https://knowledgebase.grenton.com/pl/konfiguracja-i-integracje?hsLang=pl)
3. [Gate HTTP](https://knowledgebase.grenton.com/pl/konfiguracja-i-integracje?hsLang=pl#gate-http)

# Sterowanie telewizorem Samsung poprzez SmartThings

Celem niniejszego artykułu jest zaprezentowanie przykładu integracji telewizora Samsung z Systemem Grenton Smart Home z wykorzystaniem Gate Http oraz SmartThings.

**![Example banner](https://developer.smartthings.com/docs/assets/images/wwst-stacked-rgb-423ac98ea0acbc8ae964c59af4992413.jpg)**

Urządzenie, które zostało zastosowane w tym przykładzie to Telewizor Samsung serii Q70

Integracja ta pozwala nam m. in. na: 

- Włączenie i wyłączenie urządzenia
- Sterowanie głośnością
- Wybór źródła
- Uruchomienie wybranych aplikacji

Do zrealizowania poniższego przykładu potrzebujemy:

- Gate HTTP
- Telewizor Samsung zgodny ze SmartThings

### **Przygotowanie**

1\. Tworzenie tokenu

Korzystając z [linku](https://account.smartthings.com/tokens) utwórz token. Nie zapomnij go zapisać ponieważ wyświetli się tylko raz.

2\. Dodanie urządzenia do SmartThings

Dodaj urządzenie do [SmartThings](https://my.smartthings.com/advanced/devices), a następnie upewnij się, że jest ono ONLINE:

![](https://knowledgebase.grenton.com/hubfs/image-png-Oct-11-2023-11-19-40-8680-AM.png)

3\. Skopiuj DeviceID integrowanego urządzenia:

![](https://knowledgebase.grenton.com/hubfs/image-png-Oct-11-2023-11-24-01-5317-AM.png)

4\. Sprawdzenie działania komunikacji:

Kliknij w nazwę urządzenia. W otwartej stronie mamy możliwość sprawdzenia dostępnych komend oraz przetestowania ich.

![](https://knowledgebase.grenton.com/hubfs/image-png-Oct-11-2023-12-02-45-4751-PM.png)

### **Przygotowanie konfiguracji**

**Tworzenie cech użytkownika:**

1\. Dwukrotnie kliknij w obiekt ***Gate\_HTTP***, aby wejść do ustawień modułu:

2\. Przejdź do zakładki "Cechy użytkownika" i stwórz potrzebne cechy*:*

- ***DeviceID*** - Wartość początkowa: {DeviceID} Typ: string
- ***Token*** - Wartość początkowa: {Token} Typ: string
- ***TVOnOffStatus*** - Wartość początkowa: 0 Typ: number
- ***TVAudioMuteStatus*** - Wartość początkowa: 0 Typ: number
- ***TVAudioVolumeStatus*** - Wartość początkowa: 0 Typ: number
- ***TVSourceStatus*** - Wartość początkowa: 0 Typ: string

Do wartości początkowej cechy ***DeviceID*** wklej DeviceID integrowanego urządzenia. Do wartości początkowej cechy ***Token*** wklej Token.

![](https://knowledgebase.grenton.com/hubfs/image-png-Oct-23-2023-11-53-03-7767-AM.png)

 

 

**Tworzenie obiektów**

1\. Stwórz obiekt ***HttpRequest*** o nazwie ***HttpRequestTVCommand*** i skonfiguruj go w następujący sposób:

![](https://knowledgebase.grenton.com/hubfs/image-png-Oct-23-2023-11-55-16-7617-AM.png)

Host: https://api.smartthings.com

Path: /v1/devices/{DeviceId}/commands -  zamiast {DeviceId} wpisz DeviceId integrowanego urządzenia

  2. Stwórz obiekt ***HttpRequest*** o nazwie ***HttpRequestStatusRefresh*** i skonfiguruj go w następujący sposób:

![](https://knowledgebase.grenton.com/hubfs/image-png-Oct-11-2023-12-08-59-2533-PM.png)

Host: https://api.smartthings.com

Path: /v1/devices/{DeviceId}/commands -  zamiast {DeviceId} wpisz DeviceId integrowanego urządzenia

3\. Stwórz obiekt ***HttpRequest*** o nazwie ***HtttpRequestStatus*** i skonfiguruj go w następujący sposób:

![](https://knowledgebase.grenton.com/hubfs/image-png-Oct-11-2023-12-10-26-2037-PM.png)

Host: https://api.smartthings.com

Path: /v1/devices/{DeviceId}/status -  zamiast {DeviceId} wpisz DeviceId integrowanego urządzenia

4\. Stwórz obiekt ***Timer*** o nazwie ***RefreshTimer***  i skonfiguruj go w następujący sposób:

![](https://knowledgebase.grenton.com/hubfs/image-png-Oct-11-2023-12-11-43-7397-PM.png)

**Tworzenie skryptów:**

1\. Stwórz skrypt o nazwie ***sHttpRequestTVCommandRequest *** z dwoma parametrami:

![](https://knowledgebase.grenton.com/hubfs/image-png-Oct-11-2023-12-16-32-1685-PM.png)

W treść skryptu wklej następujący kod:

```
local reqbody = {}reqbody.commands = {}reqbody.commands[1] = {}reqbody.commands[1]["component"] = "main"if param == "on" or param == "off" then reqbody.commands[1]["capability"] = "switch"reqbody.commands[1]["command"] = paramendif param == "volumeUp" or param == "volumeDown" thenreqbody.commands[1]["capability"] = "audioVolume"reqbody.commands[1]["command"] = paramend if param == "channelUp" or param == "channelDown" thenreqbody.commands[1]["capability"] = "tvChannel"reqbody.commands[1]["command"] = param endif param == "muteSwitch" then     if Gate_HTTP->TVAudioMuteStatus == 1 then     reqbody.commands[1]["capability"] = "audioMute"    reqbody.commands[1]["command"] = "unmute"     else    reqbody.commands[1]["capability"] = "audioMute"    reqbody.commands[1]["command"] = "mute"      endendif param == "setVolume" thenreqbody.commands[1]["capability"] = "audioVolume"reqbody.commands[1]["command"] = paramreqbody.commands[1]["arguments"] = {}reqbody.commands[1]["arguments"][1] = param2end if param == "HDMI3" or param == "HDMI4" thenreqbody.commands[1]["capability"] = "mediaInputSource"reqbody.commands[1]["command"] = "setInputSource"reqbody.commands[1]["arguments"] = {}reqbody.commands[1]["arguments"][1] = paramend if param == "UP" or param == "DOWN" or param == "LEFT" or param == "RIGHT" or param == "HOME" or param == "MENU" or param == "OK"  or param == "BACK" thenreqbody.commands[1]["capability"] = "samsungvd.remoteControl"reqbody.commands[1]["command"] = "send"reqbody.commands[1]["arguments"] = {}reqbody.commands[1]["arguments"][1] = paramendif param == "pause" or param == "fastForward" or param == "rewind" or param == "play" thenreqbody.commands[1]["capability"] = "mediaPlayback"reqbody.commands[1]["command"] = paramendif param == "Netflix" or param == "HBO" or param == "Prime" or param == "YouTube" thenreqbody.commands[1]["capability"] = "custom.launchapp"reqbody.commands[1]["command"] = "launchApp"reqbody.commands[1]["arguments"] = {}    if param == "Netflix" then    reqbody.commands[1]["arguments"][1] = "3201907018807"     end    if param == "HBO" then    reqbody.commands[1]["arguments"][1] = "3201601007230"     end     if param == "Prime" then    reqbody.commands[1]["arguments"][1] = "3201910019365"     end     if param == "YouTube" then    reqbody.commands[1]["arguments"][1] = "111299001912"     end endGate_HTTP->HttpRequestTVCommand->SetRequestBody(reqbody)local key = "Authorization: Bearer "..Gate_HTTP->Token.."\r\n" Gate_HTTP->HttpRequestTVCommand->SetRequestHeaders(key) Gate_HTTP->HttpRequestTVCommand->SendRequest()
```

2\. Stwórz skrypt o nazwie ***sHttpRequestStatus\_request***:

![](https://knowledgebase.grenton.com/hubfs/image-png-Oct-11-2023-12-21-28-4344-PM.png)

Treść skryptu:

```
local key = "Authorization: Bearer "..Gate_HTTP->Token.."\r\n" Gate_HTTP->HtttpRequestStatus->SetRequestHeaders(key) Gate_HTTP->HtttpRequestStatus->SendRequest()
```

3\. Stwórz skrypt o nazwie ***sHttpRequestStatus\_response***:

![](https://knowledgebase.grenton.com/hubfs/image-png-Oct-11-2023-12-23-35-9689-PM.png)

```
local resp = Gate_HTTP->HtttpRequestStatus->ResponseBodyif resp.components.main.switch.switch.value == "on"thenGate_HTTP->TVOnOffStatus = 1elseGate_HTTP->TVOnOffStatus = 0endif resp.components.main.audioMute.mute.value == "muted" thenGate_HTTP->TVAudioMuteStatus = 1elseGate_HTTP->TVAudioMuteStatus = 0endGate_HTTP->TVAudioVolumeStatus = resp.components.main.audioVolume.volume.valueGate_HTTP->TVSourceStatus = resp.components.main.mediaInputSource.inputSource.value
```

4.Stwórz skrypt o nazwie ***sHttpRequestStatusRefresh***:

![](https://knowledgebase.grenton.com/hubfs/image-png-Oct-11-2023-12-24-19-3658-PM.png)

**Przypisanie powiązań:**

1\. Do Zdarzenia ***OnResponse*** obiektu ***HttpRequestTVCommand*** przypisz wykonanie skryptu ***sHttpRequestStatusRefresh*** **![](https://knowledgebase.grenton.com/hubfs/image-png-Oct-11-2023-12-27-49-9926-PM.png)**

2\. Do Zdarzenia ***OnResponse*** obiektu ***HtttpRequestStatus** *przypisz wykonanie skryptu ***sHttpRequestStatus\_response***

***![](https://knowledgebase.grenton.com/hubfs/image-png-Oct-11-2023-12-30-36-4178-PM.png)***

3\. Do Zdarzenia ***OnResponse*** obiektu ***HttpRequestStatusRefresh*** przypisz wykonanie skryptu ***sHttpRequestStatus\_request***

***![](https://knowledgebase.grenton.com/hubfs/image-png-Oct-11-2023-12-31-56-3616-PM.png)***

4\. Do Zdarzenia ***OnTimer*** obiektu ***RefreshTimer*** przypisz wykonanie skryptu ***sHttpRequestStatusRefresh***

***![](https://knowledgebase.grenton.com/hubfs/image-png-Oct-11-2023-12-32-24-4118-PM.png)***

Tak przygotowaną konfigurację wyślij na moduł **Gate Http**

 

**Tworzenie interfejsu myGrenton**

1\. Stwórz widżet ***HEADER*** i skonfiguruj go następująco:

![](https://knowledgebase.grenton.com/hubfs/image-png-Oct-13-2023-07-16-00-4388-AM.png)

2\. Stwórz widżet ***TV\_REMOTE\_CONTROL*** i skonfiguruj go następująco:

![](https://knowledgebase.grenton.com/hubfs/image-png-Oct-26-2023-12-43-00-1372-PM.png)

3\. Stwórz widżet ***HEADER*** i skonfiguruj go następująco:

![](https://knowledgebase.grenton.com/hubfs/image-png-Oct-13-2023-07-18-13-4970-AM.png)

4\. Stwórz widżet ***SLIDER*** i skonfiguruj go następująco:

**![](https://knowledgebase.grenton.com/hubfs/image-png-Oct-13-2023-07-19-40-3593-AM.png)**

5\. Stwórz widżet ***HEADER*** i skonfiguruj go następująco:

**![](https://knowledgebase.grenton.com/hubfs/image-png-Oct-13-2023-07-20-22-1875-AM.png)**

6\. Stwórz widżet ***SENE\_DOUBLE*** i skonfiguruj go następująco:

![](https://knowledgebase.grenton.com/hubfs/image-png-Oct-13-2023-07-26-54-7089-AM.png)

7\. Stwórz widżet ***HEADER*** i skonfiguruj go następująco:

![](https://knowledgebase.grenton.com/hubfs/image-png-Oct-13-2023-07-27-20-3816-AM.png)

8\. Stwórz widżet ***SENE\_DOUBLE*** i skonfiguruj go następująco:

![](https://knowledgebase.grenton.com/hubfs/image-png-Oct-13-2023-07-28-03-3845-AM.png)

Po wysłaniu na telefon, interfejs wygląda następująco.:

![](https://knowledgebase.grenton.com/hs-fs/hubfs/Screenshot_2023-10-16-14-13-26-49_e9727763ed9b249fa74a025049469848-jpg.jpeg?width=344&height=764&name=Screenshot_2023-10-16-14-13-26-49_e9727763ed9b249fa74a025049469848-jpg.jpeg)

Po kliknięciu w widżet Pilot pojawi się okno:

![](https://knowledgebase.grenton.com/hs-fs/hubfs/Screenshot_2023-10-16-14-13-35-49_e9727763ed9b249fa74a025049469848-jpg.jpeg?width=344&height=764&name=Screenshot_2023-10-16-14-13-35-49_e9727763ed9b249fa74a025049469848-jpg.jpeg)

Poniżej film ukazujący działanie integracji

<iframe data-hsv-src="https://play.hubspotvideo.com/v/19862392/id/142136605700" referrerpolicy="origin" sandbox="allow-forms allow-scripts allow-same-origin allow-popups" allow="autoplay; fullscreen;" style="position: absolute !important; width: 100% !important; height: 100% !important; left: 0; top: 0; border: 0 none; pointer-events: initial" title="HubSpot Video" loading="lazy" data-hsv-id="142136605700" data-hsv-style="" data-hsv-width="688" data-hsv-height="387" data-hsv-autoplay="false" data-hsv-loop="false" data-hsv-muted="false" data-hsv-hidden-controls="false" data-hsv-full-width="false"></iframe>

 

- [Wytyczne instalacyjne](https://knowledgebase.grenton.com/pl/wytyczne-instalacyjne?hsLang=pl#main-content)

    - [Jak Wykonać Instalację Elektryczną](https://knowledgebase.grenton.com/pl/wytyczne-instalacyjne?hsLang=pl#jak-wykona%C4%87-instalacj%C4%99-elektryczn%C4%85)
- [Urządzenia referencyjne](https://knowledgebase.grenton.com/pl/urz%C4%85dzenia-referencyjne?hsLang=pl#main-content)

    - [Zintegrowane urządzenia](https://knowledgebase.grenton.com/pl/urz%C4%85dzenia-referencyjne?hsLang=pl#zintegrowane-urz%C4%85dzenia)
- [Najczęstsze Błędy](https://knowledgebase.grenton.com/pl/najcz%C4%99stsze-b%C5%82%C4%99dy?hsLang=pl)
- [Instalacja Elektryczna](https://knowledgebase.grenton.com/pl/instalacja-elektryczna?hsLang=pl)
- [Konfiguracja i Integracje](https://knowledgebase.grenton.com/pl/konfiguracja-i-integracje?hsLang=pl#main-content)

    - [Gate Modbus](https://knowledgebase.grenton.com/pl/konfiguracja-i-integracje?hsLang=pl#gate-modbus)
    - [Videoszkolenia](https://knowledgebase.grenton.com/pl/konfiguracja-i-integracje?hsLang=pl#videoszkolenia)
    - [Aplikacje](https://knowledgebase.grenton.com/pl/konfiguracja-i-integracje?hsLang=pl#aplikacje)
    - [Gate HTTP](https://knowledgebase.grenton.com/pl/konfiguracja-i-integracje?hsLang=pl#gate-http)
    - [Smart Panel](https://knowledgebase.grenton.com/pl/konfiguracja-i-integracje?hsLang=pl#smart-panel)
    - [Konfiguracja](https://knowledgebase.grenton.com/pl/konfiguracja-i-integracje?hsLang=pl#konfiguracja)
    - [Interfejsy myGrenton](https://knowledgebase.grenton.com/pl/konfiguracja-i-integracje?hsLang=pl#interfejsy-mygrenton)
    - [Obiekty wirtualne](https://knowledgebase.grenton.com/pl/konfiguracja-i-integracje?hsLang=pl#obiekty-wirtualne)
    - [Gate Alarm](https://knowledgebase.grenton.com/pl/konfiguracja-i-integracje?hsLang=pl#gate-alarm)
- [Domofon](https://knowledgebase.grenton.com/pl/domofon?hsLang=pl)
- [Najczęściej Zadawane Pytania](https://knowledgebase.grenton.com/pl/najcz%C4%99%C5%9Bciej-zadawane-pytania?hsLang=pl#main-content)

    - [FAQ](https://knowledgebase.grenton.com/pl/najcz%C4%99%C5%9Bciej-zadawane-pytania?hsLang=pl#faq)
    - [O Grenton](https://knowledgebase.grenton.com/pl/najcz%C4%99%C5%9Bciej-zadawane-pytania?hsLang=pl#o-grenton)
- [Cenniki i dokumenty](https://knowledgebase.grenton.com/pl/cenniki-i-dokumenty?hsLang=pl)

[![Grenton logo](https://knowledgebase.grenton.com/hs-fs/hubfs/Logo_Grenton_variants_BIG_2020_plus_RGB_v0.2-02.png?width=400&height=100&name=Logo_Grenton_variants_BIG_2020_plus_RGB_v0.2-02.png "Grenton logo")](http://grenton.com)

<https://www.facebook.com/grenton.smart.home> <https://www.instagram.com/grenton_smart_home/> <https://www.youtube.com/channel/UCFNNI-dgO1cm81kCrSr1bzg> <https://www.linkedin.com/company/grenton>

Copyright © 2026, Grenton Sp.z o.o.

```json
{
  "@context" : "https://schema.org",
  "@type" : "VideoObject",
  "contentUrl" : "https://19862392.fs1.hubspotusercontent-na1.net/hubfs/19862392/WynikPL3.mp4",
  "dateModified" : "2023-10-26T12:30:38.166Z",
  "duration" : "PT12S",
  "height" : 1080,
  "name" : "WynikPL3",
  "thumbnailUrl" : "https://19862392.fs1.hubspotusercontent-na1.net/hubfs/19862392/WynikPL3.mp4/medium.jpg",
  "uploadDate" : "2023-10-26T12:30:29.843Z",
  "width" : 1920
}
```