====== Xiaomi Dafang ====== ===== Интеграция с OpenHAB ===== https://community.openhab.org/t/how-to-configure-a-hacked-xiaomi-dafang-to-work-with-openhab/51121/13 .thing Bridge mqtt:broker:mosquitto "Mosquitto" [ host="localhost", port=1883, secure=false, username="USERNAME", password="PASSWORD", clientID="openHAB2" ] { // Xiaomi Dafang Thing topic somecamera "Some Camera" @ "Some Room" { Channels: Type string : system "System" [ commandTopic="home/dafang/set" ] Type string : vertical "Vertical" [ commandTopic="home/dafang/motors/vertical/set" ] Type string : horizontal "Horizonzal" [ commandTopic="home/dafang/motors/horizontal/set" ] Type switch : irleds "IR LEDs" [ stateTopic="home/dafang/leds/ir", commandTopic="home/dafang/leds/ir/set" ] Type switch : ircutoff "IR Cut-Off Filter" [ stateTopic="home/dafang/ir_cut", commandTopic="home/dafang/ir_cut/set" ] Type switch : nightauto "Night Mode Auto" [ stateTopic="home/dafang/night_mode/auto", commandTopic="home/dafang/night_mode/auto/set" ] Type switch : blueled "Blue LED" [ stateTopic="home/dafang/leds/blue", commandTopic="home/dafang/leds/blue/set" ] Type switch : yellowled "Yellow LED" [ stateTopic="home/dafang/leds/yellow", commandTopic="home/dafang/leds/yellow/set" ] Type switch : motion "Motion Detection" [ stateTopic="home/dafang/motion/detection", commandTopic="home/dafang/motion/detection/set" ] Type switch : rtsph264 "RTSP H264 Server" [ stateTopic="home/dafang/rtsp_h264_server", commandTopic="home/dafang/rtsp_h264_server/set" ] Type switch : rtspmjpeg "RTSP MJPEG Server" [ stateTopic="home/dafang/rtsp_mjpeg_server", commandTopic="home/dafang/rtsp_mjpeg_server/set" ] Type switch : motiontrack "Motion Tracking" [ stateTopic="home/dafang/motion/tracking", commandTopic="home/dafang/motion/tracking/set" ] Type switch : motionmail "Motion Send Mail" [ stateTopic="home/dafang/motion/send_mail", commandTopic="home/dafang/motion/send_mail/set" ] Type string : motionled "Motion LED" [ commandTopic="home/dafang/set" ] Type string : motionsnapshot "Motion Snapshot" [ commandTopic="home/dafang/set" ] Type image : motionimage "Motion Image" [ stateTopic="home/dafang/motion/snapshot/image" ] Type string : motionmqtt "Motion MQTT" [ commandTopic="home/dafang/set" ] Type number : brightness "Brightness" [ stateTopic="home/dafang/brightness" ] Type switch : nightmode "Night Mode" [ stateTopic="home/dafang/night_mode", commandTopic="home/dafang/night_mode/set" ] Type string : audiotest "Audio Test" [ commandTopic="home/dafang/set" ] Type string : flipimage "Flip Image" [ commandTopic="home/dafang/set" ] Type string : calibrate "Calibrate Motor" [ commandTopic="home/dafang/set" ] Type string : uptime "Uptime" [ stateTopic="home/dafang", transformationPattern="JSONPATH:$.uptime" ] Type string : ssid "WiFi SSID" [ stateTopic="home/dafang", transformationPattern="JSONPATH:$.ssid" ] Type string : bitrate "WiFi Bitrate" [ stateTopic="home/dafang", transformationPattern="JSONPATH:$.bitrate" ] Type string : rssi "WiFi Signal Strength" [ stateTopic="home/dafang", transformationPattern="JSONPATH:$.signal_level" ] Type string : linkquality "WiFi Link Quality" [ stateTopic="home/dafang", transformationPattern="JSONPATH:$.link_quality" ] Type string : noiselevel "Noise Level" [ stateTopic="home/dafang", transformationPattern="JSONPATH:$.noise_level" ] } } UID: mqtt:topic:mqtt:df3 label: DF3 thingTypeUID: mqtt:topic configuration: {} bridgeUID: mqtt:broker:mqtt channels: - id: system channelTypeUID: mqtt:string label: System description: "" configuration: commandTopic: home/dafang/set - id: vertical channelTypeUID: mqtt:rollershutter label: Vertical description: "" configuration: commandTopic: home/dafang/motors/vertical/set - id: horizontal channelTypeUID: mqtt:rollershutter label: Horizontal description: null configuration: commandTopic: home/dafang/motors/horizontal/set - id: irleds channelTypeUID: mqtt:switch label: IR LEDs description: "" configuration: commandTopic: home/dafang/leds/ir/set stateTopic: home/dafang/leds/ir - id: ircutoff channelTypeUID: mqtt:switch label: IR Cut-Off Filter description: null configuration: commandTopic: home/dafang/ir_cut/set stateTopic: home/dafang/ir_cut - id: nightauto channelTypeUID: mqtt:switch label: Night Mode Auto description: null configuration: commandTopic: home/dafang/night_mode/auto/set stateTopic: home/dafang/night_mode/auto - id: blueled channelTypeUID: mqtt:switch label: Blue LED description: null configuration: commandTopic: home/dafang/leds/blue/set stateTopic: home/dafang/leds/blue - id: yellowled channelTypeUID: mqtt:switch label: Yellow LED description: null configuration: commandTopic: home/dafang/leds/yellow/set stateTopic: home/dafang/leds/yellow - id: motion channelTypeUID: mqtt:switch label: Motion Detection description: null configuration: commandTopic: home/dafang/motion/detection/set stateTopic: home/dafang/motion/detection - id: rtsph264 channelTypeUID: mqtt:switch label: RTSP H264 Server description: null configuration: commandTopic: home/dafang/rtsp_h264_server/set stateTopic: home/dafang/rtsp_h264_server - id: rtspmjpeg channelTypeUID: mqtt:switch label: RTSP MJPEG Server description: "" configuration: commandTopic: home/dafang/rtsp_mjpeg_server/set stateTopic: home/dafang/rtsp_mjpeg_server - id: motiontrack channelTypeUID: mqtt:switch label: Motion Tracking description: "" configuration: commandTopic: home/dafang/motion/tracking/set stateTopic: home/dafang/motion/tracking - id: motionmail channelTypeUID: mqtt:switch label: Motion Send Mail description: "" configuration: commandTopic: home/dafang/motion/send_mail/set stateTopic: home/dafang/motion/send_mail - id: motiontelegram channelTypeUID: mqtt:switch label: Motion Send Telegram description: null configuration: commandTopic: home/dafang/motion/send_telegram/set stateTopic: home/dafang/motion/send_telegram - id: motionled channelTypeUID: mqtt:string label: Motion LED description: "" configuration: commandTopic: home/dafang/set - id: motionsnapshot channelTypeUID: mqtt:string label: Motion Snapshot description: "" configuration: commandTopic: home/dafang/set - id: motionimage channelTypeUID: mqtt:image label: Motion Image description: "" configuration: stateTopic: home/dafang/motion/snapshot/image - id: motionmqtt channelTypeUID: mqtt:string label: Motion MQTT description: "" configuration: commandTopic: home/dafang/set - id: brightness channelTypeUID: mqtt:number label: Brightness description: "" configuration: stateTopic: home/dafang/brightness - id: nightmode channelTypeUID: mqtt:switch label: Night Mode description: "" configuration: commandTopic: home/dafang/night_mode/set stateTopic: home/dafang/night_mode - id: audiotest channelTypeUID: mqtt:string label: Audio Test description: "" configuration: commandTopic: home/dafang/set - id: flipimage channelTypeUID: mqtt:string label: Flip Image description: "" configuration: commandTopic: home/dafang/set - id: calibrate channelTypeUID: mqtt:string label: Calibrate Motor description: "" configuration: commandTopic: home/dafang/set - id: uptime channelTypeUID: mqtt:string label: Uptime description: "" configuration: stateTopic: home/dafang transformationPattern: JSONPATH:$.uptime - id: ssid channelTypeUID: mqtt:string label: WiFi SSID description: null configuration: stateTopic: home/dafang transformationPattern: JSONPATH:$.ssid - id: bitrate channelTypeUID: mqtt:string label: WiFi Bitrate description: null configuration: stateTopic: home/dafang transformationPattern: JSONPATH:$.bitrate - id: rssi channelTypeUID: mqtt:string label: WiFi Signal Strength description: null configuration: stateTopic: home/dafang transformationPattern: JSONPATH:$.signal_level - id: linkquality channelTypeUID: mqtt:string label: WiFi Link Quality description: null configuration: stateTopic: home/dafang transformationPattern: JSONPATH:$.link_quality - id: noiselevel channelTypeUID: mqtt:string label: WiFi Noise Level description: null configuration: stateTopic: home/dafang transformationPattern: JSONPATH:$.noise_level https://10.44.1.12/cgi-bin/currentpic.cgi save_snapshot=true publish_mqtt_message=true .items // Xiaomi Dafang Group g1F_Cam01 "Cam 01" (Cameras, Xiaomi) String Cam01_System "System" (g1F_Cam01) { channel="mqtt:topic:mqtt:df3:system", autoupdate="false"} Rollershutter Cam01_Vertical "Vertical" (g1F_Cam01) { channel="mqtt:topic:mqtt:df3:vertical", autoupdate="false"} Rollershutter Cam01_Horizontal "Horizonzal" (g1F_Cam01) { channel="mqtt:topic:mqtt:df3:horizonzal", autoupdate="false"} Switch Cam01_IR_LEDs "IR LEDs [%s]" (g1F_Cam01) { channel="mqtt:topic:mqtt:df3:irleds" } Switch Cam01_IR_CutOff "IR Cut-Off Filter [%s]" (g1F_Cam01) { channel="mqtt:topic:mqtt:df3:ircutoff" } Switch Cam01_Night_Mode_Auto "Night Mode Auto [%s]" (g1F_Cam01) { channel="mqtt:topic:mqtt:df3:nightauto" } Switch Cam01_Blue_LED "Blue LED [%s]" (g1F_Cam01) { channel="mqtt:topic:mqtt:df3:blueled" } Switch Cam01_Yellow_LED "Yellow LED [%s]" (g1F_Cam01) { channel="mqtt:topic:mqtt:df3:yellowled" } Switch Cam01_Motion_Detection "Motion Detection [%s]" (g1F_Cam01) { channel="mqtt:topic:mqtt:df3:motion" } Switch Cam01_RTSP_H264_Server "RTSP H264 Server [%s]" (g1F_Cam01) { channel="mqtt:topic:mqtt:df3:rtsph264" } Switch Cam01_RTSP_MJPEG_Server "RTSP MJEPG Server [%s]" (g1F_Cam01) { channel="mqtt:topic:mqtt:df3:rtspmjpeg" } Switch Cam01_Motion_Send_Mail "Motion Send Mail [%s]" (g1F_Cam01) { channel="mqtt:topic:mqtt:df3:motionmail" } Switch Cam01_Motion_Send_Telegram "Motion Send Telegram [%s]" (g1F_Cam01) { channel="mqtt:topic:mqtt:df3:motiontelegram" } String Cam01_Motion_LED "Motion LED" (g1F_Cam01) { channel="mqtt:topic:mqtt:df3:motionled" } String Cam01_Motion_Snapshot "Motion Snapshot" (g1F_Cam01) { channel="mqtt:topic:mqtt:df3:motionsnapshot" } String Cam01_Motion_MQTT "Motion MQTT" (g1F_Cam01) { channel="mqtt:topic:mqtt:df3:motionmqtt" } Number Cam01_Brightness "Brightness [%s]" (g1F_Cam01) { channel="mqtt:topic:mqtt:df3:brightness" } Switch Cam01_Night_Mode "Night Mode [%s]" (g1F_Cam01) { channel="mqtt:topic:mqtt:df3:nightmode" } Switch Cam01_Motion_Tracking "Motion Tracking [%s]" (g1F_Cam01) { channel="mqtt:topic:mqtt:df3:motiontrack" } String Cam01_Audio_Test "Audio Test"