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

Sending Notifications #32

Open
lukesav1 opened this issue Mar 6, 2020 · 3 comments
Open

Sending Notifications #32

lukesav1 opened this issue Mar 6, 2020 · 3 comments

Comments

@lukesav1
Copy link

lukesav1 commented Mar 6, 2020

Hi,
Im not sure if this is already possible but it would be great if you could configure the module to send notifications to other modules (such as MMM-ProfileSwitcher).

Ive seen a module that does this but it conflicts with this one and this one is way more useful!
Any feedback would be great.

Luke

@ottopaulsen
Copy link
Owner

Hi Luke

Thanks for using the module, and thanks for the suggestion.
I think we need some kind of notification functionality, yes.
There are many alternatives here, so I am wondering what is required.

  1. Configure notification sent with values for a specific topic. Send every time it changes.

  2. Configure a notification sent when a topic is =, < or > a specific value. Send every time the value is received, or send only once (more complicated)?

  3. Are there any special requirements to the formatting of the payload, or is a JSON with topic and value ok?

  4. Other ideas?

Please, anyone, feel free to discuss.

@lukesav1
Copy link
Author

Hi ottopaulsen

I see this function as a simple notification sender based on MQTT topic, every time the received topic = declared topic then the payload is sent with the declared notification key.

I have no special requirements in terms of formatting/post processing etc and i cant think of any that couldnt be handled in the destination modue...... but if anyone has different ideas??

Exactly like splattner's module "MMM-MQTT-Notification":

topic: 'Topic1', // Topic to look for
notificationKey: 'CUSTOM_NOTIFICATION' // Key of the Notification to be Send

What do you think?

Luke

@cowboysdude
Copy link

Simply tell this module to broadcast it's payload and any module can get the info.
IE:

socketNotificationReceived: function(notification, payload) {
if (notification === "WEATHER_RESULT") {
this.sendNotification('WEATHER_RESULT', payload); // this broadcasts your payload so other modules can get it.
this.processWeather(payload); // this processes your payload for use in the current module
}
this.updateDom();
},``

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