Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How about an example....... #3

Open
cowboysdude opened this issue Oct 9, 2017 · 3 comments
Open

How about an example....... #3

cowboysdude opened this issue Oct 9, 2017 · 3 comments

Comments

@cowboysdude
Copy link

For those of us who have never worked with mqtt before how about an example config so we can see what it should look like?

@dugemaniac
Copy link

@cowboysdude i try this module, and the result was quite satisfying. the idea was to get status of my yeelight (get status from my home assistant)

First we need a mqtt server. im using cloudmqtt.com.

From home assistant, i create automation, that trigger the state change of my yelight, and create an action mqtt.publish

{
"payload_template": "{{ states('light.yeelight_rgb_xxxxxxxxxx') }}",
"topic": "MMM/location"
}

I try to display status of my yeelight lamp to MM.

{
module: 'MMM-mqtt',
position: 'top_right', // This can be any of the regions. Best$
header: 'Status', // This is optional
config: {
// See 'Configuration options' for more information.
mqttServer: 'mqtt://[user]:[pass]@m10.cloudmqtt.com:[port]
loadingText: 'Loading MQTT',
topic: 'MMM/location',
postText: 'Mirror Light : '
}
},

edit MMM-mqtt.js, so the postText goes before the MQTT topic (instead after the topic)

The result as shown

image

image

@cowboysdude
Copy link
Author

Thank you that's a HUGE help!

@cyberdie
Copy link

cyberdie commented Dec 12, 2018

Hi, my payload has multiple key/value pairs.
How should the config look like?
e.g.
'zigbee2mqtt/topic', payload: '{"battery":100,"voltage":3125,"linkquality":18,"smoke":false}'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants