cflurin / homebridge-mqtt

Homebridge-mqtt is a Plugin for Homebridge.
Apache License 2.0
229 stars 39 forks source link

No Message from MotionSensor #68

Closed marcelkordek closed 5 years ago

marcelkordek commented 6 years ago

Hi, if my MotionSensor triggers MotionDetected I don't receive a message on topic homebridge/from/set. How can I fix this?

Thanks, Marcel

cflurin commented 6 years ago

Please have a look here: https://github.com/cflurin/homebridge-mqtt/wiki/How-to-report-issues

marcelkordek commented 6 years ago

Hi cflurin, sorry here are the Details:

Versions

Config

{"name":"Doorbell","service":"MotionSensor"}

Description

After my Doorbell rings, it send a message to homebridge/to/set -> {"name":"Doorbell","characteristic":"MotionDetected","value":true} to trigger the MotionDetected in Homekit. Every time my Doorbell rings I receive a notification from Homekit with an Image from my IP-Camera (same 'room').

But I don't receive a message at homebridge/from/set when my Doorbell rings.

Log

[2018-5-28 10:18:27] [mqtt] Number of cached Accessories: 7
[2018-5-28 10:18:27] [mqtt] clientId = homebridge-mqtt_*****
[2018-5-28 10:18:27] [mqtt] Connecting..
[2018-5-28 10:18:27] Homebridge is running on port *****.
[2018-5-28 10:18:27] [mqtt] connected (url = mqtt://**********)

Thanks, Marcel

cflurin commented 6 years ago

I suppose the doorbell device sends the messages directly to homebridge-mqtt. Where are you expecting homebridge/from/set ? in your doorbell device or e.g. node-red?

Anyway the Characteristic.MotionDetected has only a READ perm (no WRITE), therefore there is no set function.

/**
 * Characteristic "Motion Detected"
 */

Characteristic.MotionDetected = function() {
  Characteristic.call(this, 'Motion Detected', '00000022-0000-1000-8000-0026BB765291');
  this.setProps({
    format: Characteristic.Formats.BOOL,
    perms: [Characteristic.Perms.READ, Characteristic.Perms.NOTIFY]
  });
  this.value = this.getDefaultValue();
};
marcelkordek commented 6 years ago

That's correct my doorbell sends the message directly to homebridge-mqtt ->homebridge/to/set. I'm expecting this in node-red to trigger other actions outside from HomeKit.

For example:

Ok, I understand. As a workaround I could have my Doorbell send two commands, one to homebridge/to/set and the other one to another topic.

Thanks, Marcel

cflurin commented 6 years ago

I also use node-red, all my devices are connected to node-red using different protocols. When I need to send values to HomeKit I sends the messages from node-red.