MQTT notification

Use this forum to discuss possible implementation of a new feature before opening a ticket.
A developer shall edit the topic title with "[xxx]" where xxx is the id of the accompanying tracker id.
Duplicate posts about the same id. +1 posts are not allowed.

Moderators: leecollings, remb0

Post Reply
devros
Posts: 183
Joined: Saturday 29 October 2016 20:55
Target OS: -
Domoticz version:
Contact:

MQTT notification

Post by devros »

Would be great to add support option for MQTT notification. Similar to HTTP but to MQTT chanell. Or I missed something and somehow it works?
User avatar
FireWizard
Posts: 1889
Joined: Tuesday 25 December 2018 12:11
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Voorthuizen (NL)
Contact:

Re: MQTT notification

Post by FireWizard »

Hi,

Can you explain in more detail what you mean with:
add support option for MQTT notification. Similar to HTTP but to MQTT chanell.
What should be notified and when?
What kind of notification should be send?

Regards
devros
Posts: 183
Joined: Saturday 29 October 2016 20:55
Target OS: -
Domoticz version:
Contact:

Re: MQTT notification

Post by devros »

In setting Notification is Custom HTTP/Action, so just add Custom MQTT/Action with similar fields like HTTP action (subject, topics etc...)

I wrote simple python script as workaround
1/ install mosquitto
2/ set custom HTTP action and create this script, copy to /Domoticz/script/python folder
3/ and set URL action to this script://python/message.py #SUBJECT, #MESSAGE

Code: Select all

#!/usr/bin/env python3
import subprocess
import sys
try:
  command = sys.argv[1]
except:
  print("no input")
  command = 'X'
p = subprocess.Popen(["mosquitto_pub",  "-h", "YOUR_MQQT_IP", "-t",  "message", "-m", command])
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest