Skip to content

Conversation

@tjmehta
Copy link

@tjmehta tjmehta commented Dec 31, 2022

There are many cases when working with third-party modules where developers may not know the full MQTT message published to a particular topic. In my case, I am using nanit which broadcasts a RTMP video stream and publishes a timestamps when motion is detected. Publishing timestamps make it impossible for me to match the entire message via motionMessage.

To make message matching more flexible for various scenarios, I added RegExp matching support for MQTT messages.

@Sunoo
Copy link
Collaborator

Sunoo commented Dec 31, 2022

Interesting, something like this has been on my to do list for a while. I’ll take a look at your submission as soon as I can get a chance.

@tjmehta tjmehta force-pushed the mqtt-message-regexp-matching branch from 9263173 to 391c115 Compare December 31, 2022 22:38
@tjmehta
Copy link
Author

tjmehta commented Dec 31, 2022

@tjmehta
Copy link
Author

tjmehta commented Dec 31, 2022

(updated readme and force pushed)

@Sunoo
Copy link
Collaborator

Sunoo commented Dec 31, 2022

That’s in a different branch of this same project: https://github.com/Sunoo/homebridge-camera-ffmpeg/blob/gh-pages/_automation/mqtt.md

if (cameraConfig.mqtt.motionMessageRegExp) {
this.addMqttAction(cameraConfig.mqtt.motionTopic, new RegExp(cameraConfig.mqtt.motionMessageRegExp),
{accessory: accessory, active: true, doorbell: false});
} else {
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should be backwards compatible to default to camera name

@tjmehta tjmehta force-pushed the mqtt-message-regexp-matching branch from 391c115 to 4cfde7d Compare December 31, 2022 22:48
@donavanbecker
Copy link
Contributor

Please rebase to beta-4.1.0 branch

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

Successfully merging this pull request may close these issues.

3 participants