MQTT with Eventghost - half way there

Please, could you share your EventGhost configuration for sending MQTT messages to HASS? :slight_smile:

Sorry, I didn’t notice this till now.

Assuming you have Eventghost installed, head to the link below and download the “MQTT Client using Paho/” plugin for Eventghost. Open the file with Eventghost so it installs. After that you can add the MQTT plugin to your Eventghost Configuration Tree, allowing you to Subscribe and Publish to MQTT Topics on the Home-Assistant MQTT server.

I’m assuming all that makes sense. If it doesn’t I’m willing to go into as much detail as needed as long as your patient.

MQTT Plugin:
http://krambriw.net/Release/

2 Likes

Thanks for sharing I’m going to give this a go. Previously I was integrating my Amazon echo via ifttt via pushbullet to send commands to eventghost.

I like how this is all local and bidirectional.

@Orthodoxmonster you seem pretty knowledgeable in EventGhost given you’ve created a MQTT plugin to send commands from EG > HASS.

I’d like to do the same, but I’m trying to be simpler by using HASS’s RESTful API (HTTP Post JSON messages). I have the JSON messages I wish to send and am trying to use Python to send the requests i need from EG > HASS. Only problem is it doesn’t seem to work.

NOOB question. Do I need to install Python on my windows 8.1 machine running EG, so that I can execute Python commands in EG? Nowhere have I read that Python needs to be installed so I assume it’s not necessary.

Oh no, I didn’t write the plugin I found it reading through the Eventghost forum. Did you try using the python script action in Eventghost?

@Orthodoxmonster I managed to figure it out. Find below the Python Script I used to do similar to what you’re doing with MQTT, but instead I’m just using a HTTP call to HASS Rest API. You can easily adapt my code below to run any action on HASS.

What the Python Code below is doing is calling HASS to tell my LG TV to set the volume to 50%. Within EventGhost I have this Python script triggered whenever I turn on my HTPC (given that i’ll control volume via Windows OS volume, rather than the TV directly)

import requests
import json

url = 'http://192.168.86.127:8123/api/services/media_player/volume_set'
header = {'x-ha-access': 'PASSWORD', 'content-type': 'application/json'}
payload = json.dumps({'volume_level': '0.5', 'entity_id': 'media_player.lg_webos_smart_tv'})

r = requests.post(url, headers=header, data=payload)
1 Like

For future readers: the krambriw website seems to be (permanently?) down, but I found the author’s account on the EventGhost forums and he has a link to his Google Drive in his signature, so you can still download the plugin from there.

3 Likes

It took me a while to figure out, but I managed to get this setup working with Let’s Encrypt’s TLS/SSL encryption. If anyone else would like to do the same, I wrote some step-by-step instructions and put them in a gist here: How to set up EventGhost’s MQTT plugin to communicate with Home Assistant using TLS/SSL + Let’s Encrypt certificate

I’ve now got an EventGhost MQTT subscriber listening on a topic to hibernate my PC with a macro when a message is published there. I’ve integrated it with the Wake-on-LAN switch’s turn_off script on my Home Assistant and it’s working quite nicely so far :smile:

Relevant Home Assistant config:

switch:
  - platform: wake_on_lan
    name: PC WOL
    mac_address: !secret pc_mac_address
    host: !secret pc_ip
    turn_off:
      service: mqtt.publish
      data:
        topic: pc_hibernation_topic_name_here
        qos: 1

how to use hassio for control windows 10 without certificate ? in my local network
will it work without tls\ssl and certificates ?

I have tried to install the MQTT plugin in eventghost but when trying to add the plugin eventghost stalls completely. I have tried both on a win 8.1 and a win 7 machine with same result.
Anyone got an idea what can be done?

solved :slight_smile: I just used the plugin version 1.2.2 instead of 1.1.0

Did you find any instructions how to configure or use the EQ MQTT plugin?
When I configure the plugin I get a dialog with “Currently active threads” but only column headers and no entries.
Any idea what I’m missing?

Never mind. Adding a command to start a new MQTT subscription to autostart got me going.

how to find mqtt event?
i configured plugin, but event never show up in log after i publish topic

can someone tell me im missing something?

Hi,

you have to listen to the right topics and levels. E.g. “topic: eventghost” just listens to the single level. If you want to listen to everything on e.g. eventghost you could use “topic: eventghost/#” (see https://www.hivemq.com/blog/mqtt-essentials-part-5-mqtt-topics-best-practices/ for info on levels).

You should use another tool (e.g. MQTT Explorer) to verify the data on your mqtt server.

If all is configured correctly the log should show your mqtt messages.

Kind regard,
Philipp

1 Like

Does anyone still have the plugin? Could you please upload it anywhere?
Thanks :slight_smile:

There is a 1.2.3 version apparently somewhere.

I could only find these:

https://drive.google.com/drive/folders/0B7yeQB9QD-MkQ3NJek04dXNzYzA?resourcekey=0-mQWxBA6wY4F4tyOaiJInyQ

I have a v1.2.3:

1 Like

Cool. Since it’s not an installer I copied over my current plugin folder.

Do you know how I can verify the version?

No afraid not sorry

1 Like