homebridge-camera-ffmpeg
homebridge-camera-ffmpeg copied to clipboard
MQTT doorbellMessage JSON input
Doorbell dahua vto2111d-wp. Can parsing json? When I press the call on the call, then the message comes in json
{ "Action": "Start", "Code": "CallNoAnswered", "Data": { "CallID": "8", "IsEncryptedStream": false, "LocaleTime": "2021-08-25 10:37:35", "LockNum": 2, "SupportPaas": false, "TCPPort": 37777, "UTC": 1629877055.0, "UserID": "9901" }, "Index": 0, "serialNumber": "7E02BF7PAJD7071" }'
I need doorbellMessage= JSON block = "Action": "Start"
"mqtt": {
"doorbellTopic": "DahuaVTO/CallNoAnswered/Event",
"doorbellMessage": "Start"
}
I’m open to adding this, if I can think of a reasonable way to define it in the config without breaking existing users.
Okay, I’ve got an idea on how this might be able to work. I’ll try to do some testing this weekend.
I was just trying to figure out how to do this. I have zigbee2mqtt occupancy sensor publishing this and want to trigger a doorbell. If the doorbellMessage
could accept a "regex" or wildcard pattern it could be easy.
Topic: zigbee2mqtt/Motion Sensor
{"battery":100,"battery_low":false,"linkquality":107,"occupancy":true,"tamper":false,"voltage":3200}
example:
"mqtt": {
"doorbellTopic": "zigbee2mqtt/Motion Sensor",
"doorbellMessage": "*\"occupancy\":true"
}
Parsing it as JSON and letting the user specify a path would be preferred. I have an idea on how to handle it, my life just suddenly got pretty crazy so I haven’t had time or energy to work on it recently.
an easy alternative is using mqtt-launcher + a small python json parser to automatically generate another mqtt msg when receiving the full json.
For ex,mqtt-launcher listen to zigbee2mqtt/Motion Sensor
and publish a zigbee2mqtt/Motion Sensor/report
that contains the trigger you want to see (eg : 'alarm')