Git Product home page Git Product logo

samsung-remote-mqtt's Introduction

samsung-remote-mqtt

A mqtt bridge for samsung smart tv.

Get the Binary

You can build it on your own (you will need golang installed):

go build -a -installsuffix cgo ./cmd/samsung-remote-mqtt/

Or you can download the release binaries: here

usage

./samsung-remote-mqtt -broker tcp://127.0.0.1:1883 -tv-host TV_HOST_NAME -tv-host-mac TV_HOST_MAC_ADDRESS

Enable the Homeassitant discovery support

./samsung-remote-mqtt -broker tcp://127.0.0.1:1883 -tv-host TV_HOST_NAME -home-assistant

Trigger command execution

To execute a command:

mosquitto_pub -t "cmnd/samsung-remote/info" -m ""

Read the result:

mosquitto_sub -t "cmnd/samsung-remote/info/result"

Topics and Payload

Topic Payload Description
%prefix%/info - Get information about the tv.
%prefix%/wake-up - Wakes up the Tv - it only works if the MAC-Address was configured!
%prefix%/send-key KEY_VOLUP Send the key to samsung remote
%prefix%/send-text SomeText Send the given text to samsung remote
%prefix%/move X Y Go with the cursor to position samsung remote
%prefix%/right-click - Perform a right click at samsung remote
%prefix%/left-click - Perform a left click samsung remote
%prefix%/browser https://github.com/rainu/samsung-remote-mqtt Open the browser with the given url.
%prefix%/app/start appId Starts the app by the given appId.
%prefix%/app/start/%name% appData Starts the app by the given name with the given data. For example, you can start the YouTube app and play a video directly (set data to "v=HvncJgJbqOc")
%prefix%/app/stop appId Stops the app by the given appId.
%prefix%/app/status appId Get the the app status by the given appId.
%prefix%/app/installed - Get a list of all installed apps.

All actions will send an answer to the corresponding result topic. The result topic is the incoming topic plus "result". For example: The result of %prefix%/info will send to %prefix%/info/result

Before and after each action the state will publish to the state topic. The state topic is the incoming topic plus "state". For example: The state of %prefix%/info will send to %prefix%/info/state

samsung-remote-mqtt's People

Contributors

rainu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

samsung-remote-mqtt's Issues

[OpenWRT arm64 UE55TU7022K] Connection lost to samsung remote. Try to reconnect.

I've installed this bridge on my Belkin RT3200 router with OpenWRT snapshot.
TV model is UE55TU7022K.
There are a lot of connection issues in logs and my remote work unstable.
Is there any idea what is the problem?
TV is connected to the router via cable, connection is stable.

Thu Jun 2 20:04:03 2022 daemon.err samsung-remote-mqtt-linux-arm64: 2022-06-02T20:04:03.229Z DEBUG [email protected]/net.go:238 [net] logic waiting for msg on ibound
Thu Jun 2 20:04:04 2022 daemon.err samsung-remote-mqtt-linux-arm64: 2022-06-02T20:04:04.907Z DEBUG samsung-remote-mqtt/main.go:159 Connection lost to samsung remote. Try to reconnect. {"error": "write tcp 192.168.1.1:54718->192.168.1.113:8002: write: broken pipe"}
Thu Jun 2 20:04:04 2022 daemon.err samsung-remote-mqtt-linux-arm64: 2022-06-02T20:04:04.909Z ERROR samsung-remote-mqtt/main.go:100 Error while connecting to samsung tv: %s {"error": "error while connecting: dial tcp 192.168.1.113:8002: connect: connection refused"}
Thu Jun 2 20:04:05 2022 daemon.err samsung-remote-mqtt-linux-arm64: 2022-06-02T20:04:05.911Z ERROR samsung-remote-mqtt/main.go:100 Error while connecting to samsung tv: %s {"error": "error while connecting: dial tcp 192.168.1.113:8002: connect: connection refused"}
Thu Jun 2 20:04:08 2022 daemon.err samsung-remote-mqtt-linux-arm64: 2022-06-02T20:04:08.219Z DEBUG [email protected]/ping.go:49 [pinger] ping check 4.991671569
Thu Jun 2 20:04:13 2022 daemon.err samsung-remote-mqtt-linux-arm64: 2022-06-02T20:04:13.219Z DEBUG [email protected]/ping.go:49 [pinger] ping check 9.991715425
Thu Jun 2 20:04:13 2022 daemon.err samsung-remote-mqtt-linux-arm64: 2022-06-02T20:04:13.226Z DEBUG [email protected]/client.go:570 [client] enter Publish
Thu Jun 2 20:04:13 2022 daemon.err samsung-remote-mqtt-linux-arm64: 2022-06-02T20:04:13.227Z DEBUG [email protected]/client.go:601 [client] sending publish message, topic: samsungtv/remote/tv/status
Thu Jun 2 20:04:13 2022 daemon.err samsung-remote-mqtt-linux-arm64: 2022-06-02T20:04:13.228Z DEBUG [email protected]/net.go:198 [net] obound wrote msg, id: 1
Thu Jun 2 20:04:13 2022 daemon.err samsung-remote-mqtt-linux-arm64: 2022-06-02T20:04:13.228Z DEBUG [email protected]/net.go:170 [net] outgoing waiting for an outbound message
Thu Jun 2 20:04:13 2022 daemon.err samsung-remote-mqtt-linux-arm64: 2022-06-02T20:04:13.228Z DEBUG [email protected]/net.go:135 [net] Received Message
Thu Jun 2 20:04:13 2022 daemon.err samsung-remote-mqtt-linux-arm64: 2022-06-02T20:04:13.228Z DEBUG [email protected]/net.go:242 [net] logic got msg on ibound
Thu Jun 2 20:04:13 2022 daemon.err samsung-remote-mqtt-linux-arm64: 2022-06-02T20:04:13.228Z DEBUG [email protected]/memstore.go:113 [store] memorystore del: message 1 was deleted
Thu Jun 2 20:04:13 2022 daemon.err samsung-remote-mqtt-linux-arm64: 2022-06-02T20:04:13.229Z DEBUG [email protected]/net.go:282 [net] received puback, id: 1
Thu Jun 2 20:04:13 2022 daemon.err samsung-remote-mqtt-linux-arm64: 2022-06-02T20:04:13.229Z DEBUG [email protected]/net.go:238 [net] logic waiting for msg on ibound
Thu Jun 2 20:04:18 2022 daemon.err samsung-remote-mqtt-linux-arm64: 2022-06-02T20:04:18.219Z DEBUG [email protected]/ping.go:49 [pinger] ping check 4.991156313
Thu Jun 2 20:04:23 2022 daemon.err samsung-remote-mqtt-linux-arm64: 2022-06-02T20:04:23.219Z DEBUG [email protected]/ping.go:49 [pinger] ping check 9.99135188
Thu Jun 2 20:04:23 2022 daemon.err samsung-remote-mqtt-linux-arm64: 2022-06-02T20:04:23.227Z DEBUG [email protected]/client.go:570 [client] enter Publish
Thu Jun 2 20:04:23 2022 daemon.err samsung-remote-mqtt-linux-arm64: 2022-06-02T20:04:23.227Z DEBUG [email protected]/client.go:601 [client] sending publish message, topic: samsungtv/remote/tv/status
Thu Jun 2 20:04:23 2022 daemon.err samsung-remote-mqtt-linux-arm64: 2022-06-02T20:04:23.227Z DEBUG [email protected]/net.go:198 [net] obound wrote msg, id: 1
Thu Jun 2 20:04:23 2022 daemon.err samsung-remote-mqtt-linux-arm64: 2022-06-02T20:04:23.227Z DEBUG [email protected]/net.go:170 [net] outgoing waiting for an outbound message
Thu Jun 2 20:04:23 2022 daemon.err samsung-remote-mqtt-linux-arm64: 2022-06-02T20:04:23.228Z DEBUG [email protected]/net.go:135 [net] Received Message
Thu Jun 2 20:04:23 2022 daemon.err samsung-remote-mqtt-linux-arm64: 2022-06-02T20:04:23.229Z DEBUG [email protected]/net.go:242 [net] logic got msg on ibound
Thu Jun 2 20:04:23 2022 daemon.err samsung-remote-mqtt-linux-arm64: 2022-06-02T20:04:23.229Z DEBUG [email protected]/memstore.go:113 [store] memorystore del: message 1 was deleted
Thu Jun 2 20:04:23 2022 daemon.err samsung-remote-mqtt-linux-arm64: 2022-06-02T20:04:23.229Z DEBUG [email protected]/net.go:282 [net] received puback, id: 1
Thu Jun 2 20:04:23 2022 daemon.err samsung-remote-mqtt-linux-arm64: 2022-06-02T20:04:23.229Z DEBUG [email protected]/net.go:238 [net] logic waiting for msg on ibound
Thu Jun 2 20:04:28 2022 daemon.err samsung-remote-mqtt-linux-arm64: 2022-06-02T20:04:28.219Z DEBUG [email protected]/ping.go:49 [pinger] ping check 4.991368904
Thu Jun 2 20:04:29 2022 daemon.err samsung-remote-mqtt-linux-arm64: 2022-06-02T20:04:29.235Z DEBUG samsung-remote-mqtt/main.go:159 Connection lost to samsung remote. Try to reconnect. {"error": "write tcp 192.168.1.1:54728->192.168.1.113:8002: write: broken pipe"}
Thu Jun 2 20:04:33 2022 daemon.err samsung-remote-mqtt-linux-arm64: 2022-06-02T20:04:33.219Z DEBUG [email protected]/ping.go:49 [pinger] ping check 9.99145474
Thu Jun 2 20:04:33 2022 daemon.err samsung-remote-mqtt-linux-arm64: 2022-06-02T20:04:33.227Z DEBUG [email protected]/client.go:570 [client] enter Publish
Thu Jun 2 20:04:33 2022 daemon.err samsung-remote-mqtt-linux-arm64: 2022-06-02T20:04:33.227Z DEBUG [email protected]/client.go:601 [client] sending publish message, topic: samsungtv/remote/tv/status
Thu Jun 2 20:04:33 2022 daemon.err samsung-remote-mqtt-linux-arm64: 2022-06-02T20:04:33.228Z DEBUG [email protected]/net.go:198 [net] obound wrote msg, id: 1
Thu Jun 2 20:04:33 2022 daemon.err samsung-remote-mqtt-linux-arm64: 2022-06-02T20:04:33.228Z DEBUG [email protected]/net.go:170 [net] outgoing waiting for an outbound message
Thu Jun 2 20:04:33 2022 daemon.err samsung-remote-mqtt-linux-arm64: 2022-06-02T20:04:33.229Z DEBUG [email protected]/net.go:135 [net] Received Message
Thu Jun 2 20:04:33 2022 daemon.err samsung-remote-mqtt-linux-arm64: 2022-06-02T20:04:33.229Z DEBUG [email protected]/net.go:242 [net] logic got msg on ibound
Thu Jun 2 20:04:33 2022 daemon.err samsung-remote-mqtt-linux-arm64: 2022-06-02T20:04:33.229Z DEBUG [email protected]/memstore.go:113 [store] memorystore del: message 1 was deleted
Thu Jun 2 20:04:33 2022 daemon.err samsung-remote-mqtt-linux-arm64: 2022-06-02T20:04:33.230Z DEBUG [email protected]/net.go:282 [net] received puback, id: 1
Thu Jun 2 20:04:33 2022 daemon.err samsung-remote-mqtt-linux-arm64: 2022-06-02T20:04:33.230Z DEBUG [email protected]/net.go:238 [net] logic waiting for msg on ibound
Thu Jun 2 20:04:38 2022 daemon.err samsung-remote-mqtt-linux-arm64: 2022-06-02T20:04:38.219Z DEBUG [email protected]/ping.go:49 [pinger] ping check 4.991505976
Thu Jun 2 20:04:43 2022 daemon.err samsung-remote-mqtt-linux-arm64: 2022-06-02T20:04:43.219Z DEBUG [email protected]/ping.go:49 [pinger] ping check 9.991051676

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.