www.homeseer.com    
 

Go Back   HomeSeer Message Board > HomeSeer Products & Services > HomeSeer Help

HomeSeer Help Help, How-to's and Documentation

Reply
 
Thread Tools Display Modes
  #1  
Old September 8th, 2017, 10:39 PM
Summerguy Summerguy is online now
Seer Plus
 
Join Date: Aug 2017
Location: Canada
Posts: 83
How to create a fonctionnal MQTT device ?

Hi ,

i am using the MQTT plugin.

I am able to publish command with HS3 . But how do i map those commands to a MQTT device in HS3?

Here are the commands/values i am trying to add to the device :

https://ibb.co/fOt3Oa

thank you !!
Reply With Quote
  #2  
Old September 8th, 2017, 11:39 PM
jon102034050 jon102034050 is offline
Seer Deluxe
 
Join Date: May 2016
Location: MN
Posts: 175
sorry - don't have the answer to this, but I'd like to know the solution as well!
Reply With Quote
  #3  
Old September 9th, 2017, 03:46 AM
Summerguy Summerguy is online now
Seer Plus
 
Join Date: Aug 2017
Location: Canada
Posts: 83
Hi,

I found a workaround.

I had to create a virtual device first. And after that I had to map the ‘’ on’’ and the ‘’ off ‘’ buttons with event ( ex: publish custom topic: lgtv/set/launch com.itkey.plexclient )
.

Not sure it is the official way but it works.

Now I have almost full control of by lg B6 tv, without using the crappy harmony. I even have control of the tv with Alexa.

But I need to figure out how use the Sound tv as a dimmer ( I want to say to Alexa :set tv Sound to 25% etc.


And to completely remove the need of the harmony hub, I would like to be able to get sccès to my tv channels....but I do not see any way to do this since à have a cable box from my cable provider.
Reply With Quote
  #4  
Old September 30th, 2017, 07:51 AM
macrho's Avatar
macrho macrho is offline
Seer Deluxe
 
Join Date: May 2015
Location: Middle of Nowhere
Posts: 264
Is this what you were using: https://github.com/hobbyquaker/lgtv2mqtt
If so, how did you link the addon? I can't get anything to run though the mqtt plugin shows as connected

Quote:
Originally Posted by Summerguy View Post
Hi,

I found a workaround.

I had to create a virtual device first. And after that I had to map the ‘’ on’’ and the ‘’ off ‘’ buttons with event ( ex: publish custom topic: lgtv/set/launch com.itkey.plexclient )
.

Not sure it is the official way but it works.

Now I have almost full control of by lg B6 tv, without using the crappy harmony. I even have control of the tv with Alexa.

But I need to figure out how use the Sound tv as a dimmer ( I want to say to Alexa :set tv Sound to 25% etc.


And to completely remove the need of the harmony hub, I would like to be able to get sccès to my tv channels....but I do not see any way to do this since à have a cable box from my cable provider.
Reply With Quote
  #5  
Old September 30th, 2017, 04:35 PM
Summerguy Summerguy is online now
Seer Plus
 
Join Date: Aug 2017
Location: Canada
Posts: 83
Sorry i am not the better in english but i'll try. And yes this is what i used

I think the key to understand here is that you won't get any device from Mqtt...but you will have access to fonctions.

theses fonctions needs to be mapped to a virtual device.

Ex: create a device, name it ''mute'' ( or what you want), and create those events :

https://ibb.co/moHH6G ( to map the mute button to the on/off of the virual device)


https://ibb.co/h03qRG ( to get the real status of the ''mute'' fonction on you virtual device)...but you will need easy triger plugin for that.
Reply With Quote
  #6  
Old September 30th, 2017, 04:48 PM
Summerguy Summerguy is online now
Seer Plus
 
Join Date: Aug 2017
Location: Canada
Posts: 83
To get the real time status of the mute fonction of the tv ( second picture ),

you will neeed to subscribe to the mute topic of lgtv2mqtt

here is a picture of my subcriptions:

https://imgur.com/1gyMXZZ


this will create a status device only***


To be able to control the fonctions of the tv, you have to create a virtual device ..after that it is up to you if you want you virtual device tpo be linked to the real state of you tv fonctions
Reply With Quote
  #7  
Old September 30th, 2017, 04:50 PM
macrho's Avatar
macrho macrho is offline
Seer Deluxe
 
Join Date: May 2015
Location: Middle of Nowhere
Posts: 264
I understand the logic of the events you show, however, I'm missing the how you can connect to the lgtv2mqtt addon. I was able to pair lgtv2mqtt to my tv.

Code:
I do have mosquitto running:
root@odroid:/usr/lib/node_modules# ps -ef | grep mosquitto
root     23443     1  0 16:45 ?        00:00:00 /bin/sh -c /usr/sbin/mosquitto -c /etc/mosquitto/mosquitto.conf -d
mosquit+ 23444 23443  1 16:45 ?        00:00:00 /usr/sbin/mosquitto -c /etc/mosquitto/mosquitto.conf
I've tried invoking the lgtv2mqtt:

Code:
root@odroid:/usr/lib/node_modules# lgtv2mqtt -t 192.168.1.9
2017-09-30 16:47:17.671   lgtv2mqtt 1.0.0 starting
2017-09-30 16:47:17.678   mqtt trying to connect mqtt://127.0.0.1
2017-09-30 16:47:17.949   tv connected
but I'm unable to get anything to fire

I tried setting up a simple manually triggered event that is:

MQTT: Publish custom topic
Topic: lgtv/set/toast
Message: Hello

but that doesn't work. I'm probably missing something so simple that I'll boot myself once it works
Reply With Quote
  #8  
Old September 30th, 2017, 07:26 PM
Summerguy Summerguy is online now
Seer Plus
 
Join Date: Aug 2017
Location: Canada
Posts: 83
In the settings of the tv , in the general tab , did you set ''mobile tv '' to ''on'' ?

if no, put it on , and retry lgtv2mqtt -t 192.168.1.9
Reply With Quote
  #9  
Old September 30th, 2017, 07:41 PM
macrho's Avatar
macrho macrho is offline
Seer Deluxe
 
Join Date: May 2015
Location: Middle of Nowhere
Posts: 264
Quote:
Originally Posted by Summerguy View Post
In the settings of the tv , in the general tab , did you set ''mobile tv '' to ''on'' ?

if no, put it on , and retry lgtv2mqtt -t 192.168.1.9
Yes, I did put the setting on and did successfully pair the tv with lgtv2mqqt.
Do I need to run it subsequently?
Reply With Quote
  #10  
Old October 1st, 2017, 06:42 AM
macrho's Avatar
macrho macrho is offline
Seer Deluxe
 
Join Date: May 2015
Location: Middle of Nowhere
Posts: 264
I now have it working, turned out that I needed to run lgtv2mqtt like so:

Code:
lgtv2mqtt -t 192.168.1.9 -u mqtt://192.168.1.13
My toast message worked
Reply With Quote
  #11  
Old October 1st, 2017, 02:01 PM
macrho's Avatar
macrho macrho is offline
Seer Deluxe
 
Join Date: May 2015
Location: Middle of Nowhere
Posts: 264
It looks like I can detect power on/off through lgtv/status/foregroundApp
I'm using the contains easy trigger and when it contains a "." then it's on [e.g. com.webos.app.hdmi1] while if it does not, it's off. I sniffed around running:

mosquitto_sub -v -h 192.168.1.13 -p 1883 -t '#'

so far, so good.

I also have a subscription to lgtv/set/toast, which allows me to put a message on the screen. I used to do this through Kodi but as I'm running a Nvidia Shield TV, I might be in youtube or some other app. It works well though it did seem that it wouldn't fire it was far down on the "then" statements in the event

All in all, it's very cool.
Reply With Quote
  #12  
Old October 1st, 2017, 02:37 PM
Summerguy Summerguy is online now
Seer Plus
 
Join Date: Aug 2017
Location: Canada
Posts: 83
Glad you got it right!

Yes the toast feature is really useful!!

If you happen to know how to create a virtual dimming device and map each level of the (100) sound of the Tv on it, without creating 100 events for this, please let me know

For now I think I will have to create those 100 events lol..


Quote:
Originally Posted by macrho View Post
It looks like I can detect power on/off through lgtv/status/foregroundApp
I'm using the contains easy trigger and when it contains a "." then it's on [e.g. com.webos.app.hdmi1] while if it does not, it's off. I sniffed around running:

mosquitto_sub -v -h 192.168.1.13 -p 1883 -t '#'

so far, so good.

I also have a subscription to lgtv/set/toast, which allows me to put a message on the screen. I used to do this through Kodi but as I'm running a Nvidia Shield TV, I might be in youtube or some other app. It works well though it did seem that it wouldn't fire it was far down on the "then" statements in the event

All in all, it's very cool.
Reply With Quote
  #13  
Old October 1st, 2017, 05:45 PM
Summerguy Summerguy is online now
Seer Plus
 
Join Date: Aug 2017
Location: Canada
Posts: 83
Quote:
Originally Posted by macrho View Post
It looks like I can detect power on/off through lgtv/status/foregroundApp
I'm using the contains easy trigger and when it contains a "." then it's on [e.g. com.webos.app.hdmi1] while if it does not, it's off. I sniffed around running:
.
I am not sure what you are talking about with the ''.''

I always see them when i turn of my tv.

that would be a really nice feature
Reply With Quote
  #14  
Old October 2nd, 2017, 02:54 PM
macrho's Avatar
macrho macrho is offline
Seer Deluxe
 
Join Date: May 2015
Location: Middle of Nowhere
Posts: 264
Quote:
Originally Posted by Summerguy View Post
I am not sure what you are talking about with the ''.''

I always see them when i turn of my tv.

that would be a really nice feature
Attached are two images:

detectOff: I monitor the foregroundApp and when it is running, it usually is something like: com.webos.app.hdmi1 So the periods "." in the app name allow me to determine whether or not the TV is actually on or off. When the TV goes off, I believe a (null) is displayed but I have not yet been able to get that to work. Using the "." and contains or does not contain seem to manage the state

Turn TV On: I found that this setting works so I don't have to use WOL to turn the TV on.
Attached Images
  
Reply With Quote
  #15  
Old October 2nd, 2017, 04:15 PM
macrho's Avatar
macrho macrho is offline
Seer Deluxe
 
Join Date: May 2015
Location: Middle of Nowhere
Posts: 264
I take it back, it seems the only way to power on the TV is via WOL.
Reply With Quote
  #16  
Old October 3rd, 2017, 02:23 AM
Summerguy Summerguy is online now
Seer Plus
 
Join Date: Aug 2017
Location: Canada
Posts: 83
Yes i needed to use wol too
Reply With Quote
  #17  
Old October 19th, 2017, 04:20 PM
Summerguy Summerguy is online now
Seer Plus
 
Join Date: Aug 2017
Location: Canada
Posts: 83
Maybe this is something you will like https://github.com/hobbyquaker/lgtv2...ment-338021446
Reply With Quote
  #18  
Old October 31st, 2017, 04:09 PM
Summerguy Summerguy is online now
Seer Plus
 
Join Date: Aug 2017
Location: Canada
Posts: 83
This is how i get instant status for my LG webos 3.0

this is the only way to get instant status ... or WITH scripting lol

sO YOUR ''.'' (DOT) THING WORKS NOW
Attached Images
 

Last edited by Summerguy; October 31st, 2017 at 08:06 PM.
Reply With Quote
  #19  
Old November 3rd, 2017, 10:34 AM
Summerguy Summerguy is online now
Seer Plus
 
Join Date: Aug 2017
Location: Canada
Posts: 83
Doesn’t work anymore for no reason...
Reply With Quote
  #20  
Old November 3rd, 2017, 02:13 PM
Eman Eman is offline
Seer Master
 
Join Date: Mar 2009
Location: UK
Posts: 568
Quote:
Originally Posted by Summerguy View Post
Doesn’t work anymore for no reason...

Get yourself a spare RPI 3 and install raspbian then use Peter Scargill's script from here : https://tech.scargill.net/a-christmas-script/ which will reduce your pain of installing software. It will give you Node-Red, MQTT and more in one go!

After installation log into Node-Red and install this node :
https://flows.nodered.org/node/node-red-contrib-lgtv plus the mqtt nodes
Because you have already got the mqtt HS3 plugin you can do an infinite number of tasks with the three interconnected systems ===> HS3, Node-Red and MQTT. Dream it, it's all there! Your only pain will be to thank the guys who created that software.

Now go on and play!


Examples down below:

Eman.
Attached Images
  
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Project weekend: Using MQTT with HS3 mloebl HomeSeer General Discussion Area 50 June 18th, 2017 09:23 PM
HS3 MQTT Plugin ghurk Script & Plug-In Library 12 February 27th, 2017 07:21 PM
MQTT with raspberry pi gd1210 General Home Automation Hardware Discussion 49 December 30th, 2016 08:52 AM
[c#.Net] MQTT plugin dmurphy Script & Plug-In Library 9 June 12th, 2016 09:13 PM
How to Parse device string and create device values dhellis Script & Plug-In Development 6 October 8th, 2012 02:41 PM


All times are GMT -4. The time now is 03:03 PM.


Copyright HomeSeer Technologies, LLC