Page 1 of 1

Samsung Smartthings and Domoticz

Posted: Wednesday 05 February 2020 9:21
by Trigun
Hi Guys,

I have a new Samsung TV(QE55Q70R) which works with the Samsung smartthings app.
Nice solution but I already have a great system that has all my devices in it and works great, Domoticz :)

Can anyone tell me if there is a solution to connect my tv(perhaps via smartthings) to my Domoticz system?

I have searched the internet but all solutions seem te be outdated or not applicable to my tv.

many thanks in advance!

Re: Samsung Smartthings and Domoticz

Posted: Wednesday 05 February 2020 11:19
by FireWizard
Hi,

Have you seen this: https://www.pakstech.com/blog/control-tv-node-red/

For Node Red, more than one node is available and with MQTT you can connect NR to Domoticz.

Regards

Re: Samsung Smartthings and Domoticz

Posted: Wednesday 05 February 2020 11:36
by Trigun
WOW!! this definitely looks promising!

What the end goal is, is to create a scene in Domotics called "Movie Time" therefore I need to be able to turn the TV on but also start the Plex app. or select the right source.

would this be a possibility with Node-red?

many thanks!

Re: Samsung Smartthings and Domoticz

Posted: Wednesday 05 February 2020 12:01
by mark.sellwood
Can you turn your TV on with the SmartThings App? I have a 2 year old TV that only responds to SmartThings once you have turned it on with the remote.

Re: Samsung Smartthings and Domoticz

Posted: Wednesday 05 February 2020 12:34
by Trigun
mark.sellwood wrote: Wednesday 05 February 2020 12:01 Can you turn your TV on with the SmartThings App? I have a 2 year old TV that only responds to SmartThings once you have turned it on with the remote.
Yes I can turn it on and off with the app

Re: Samsung Smartthings and Domoticz

Posted: Wednesday 05 February 2020 13:41
by FireWizard
Hi,

@Trigun.

You can try to connect Node Red with Plex.
A node exists: https://flows.nodered.org/node/node-red-contrib-plex-ws

Regards

Re: Samsung Smartthings and Domoticz

Posted: Wednesday 05 February 2020 14:57
by Trigun
FireWizard wrote: Wednesday 05 February 2020 13:41 Regards
Ok, thnx! The intention was to actually launch the app from the tv.

but thnx anyway!

Re: Samsung Smartthings and Domoticz

Posted: Wednesday 04 March 2020 14:29
by Trigun
ok, I had a look at node red. I must say that I have no experience with nodered at all.
it does seem like a good solution when using MQTT but I have no idea where to start. even the internet tells me different things to do.

is there anyone experienced with nodered to help me on my way?

thnx!

Re: Samsung Smartthings and Domoticz

Posted: Wednesday 23 December 2020 10:43
by pgielen
https://robothuis.nl/2020/11/02/koppel- ... -domoticz/

The original is in Dutch but there is a Google translate button in the menu.

Re: Samsung Smartthings and Domoticz

Posted: Wednesday 30 December 2020 20:02
by PatrickSt91
I'm using this library: https://github.com/PatrickSt1991/pysmartthings

It's a fork of the original: https://github.com/andrewsayre/pysmartthings

With that I made python script and connected it to a domoticz virtual switch.

My script turns on the TV if it's off, when it's on changes the source to HDMI2 to start my PS4.

You could use that library to do the same for you.

If you need any help let me know

Re: Samsung Smartthings and Domoticz

Posted: Sunday 14 February 2021 12:35
by djalexnl
Can you share some simple python examples here so we can learn from it?

Re: Samsung Smartthings and Domoticz

Posted: Sunday 21 February 2021 10:24
by tontze
Is mqtt only way to connect node-red and domoticz ?

Re: Samsung Smartthings and Domoticz

Posted: Sunday 21 February 2021 13:17
by waaren
tontze wrote: Sunday 21 February 2021 10:24 Is mqtt only way to connect node-red and domoticz ?
No. You can also send HTTP Requests (GET and POST)

Re: Samsung Smartthings and Domoticz

Posted: Sunday 21 February 2021 14:20
by tontze
waaren wrote: Sunday 21 February 2021 13:17
tontze wrote: Sunday 21 February 2021 10:24 Is mqtt only way to connect node-red and domoticz ?
No. You can also send HTTP Requests (GET and POST)
Figured, but isnt this problematic with device states ? IE. you need to poll device states time to time to keep them synced in domoticz ?

Re: Samsung Smartthings and Domoticz

Posted: Sunday 21 February 2021 19:28
by PatrickSt91
djalexnl wrote: Sunday 14 February 2021 12:35 Can you share some simple python examples here so we can learn from it?
Sure, sorry for the late reply.

Code: Select all

#!/usr/bin/env python2

# https://github.com/andrewsayre/pysmartthings
# for ps4 only -> result = await device.set_input_source("HDMI")

import aiohttp
import asyncio
import pysmartthings
import sys

tokenSmartThings = '**************************************'

async def print_devices():
    async with aiohttp.ClientSession() as session:
        api = pysmartthings.SmartThings(session, tokenSmartThings)
        devices = await api.devices() // Calling all devices currently in your smartthins app.
	#print(devices)
        device = devices[0]  // device[0] is the device I need, in your case it can be anything.. just check print(devices)
        #print(device.capabilities)
        result = await device.switch_on() //Turn On TV
        assert result == True
        await device.status.refresh()  //Refresh TV, I'm not sure why I do this but it works
        result = await device.set_input_source("HDMI2") //Change to HDMI2
        assert result == True
        
def main():
    loop = asyncio.get_event_loop()
    loop.run_until_complete(print_devices())
    loop.close()

if __name__ == '__main__':
    main()