Xiaomi Dafang - Einzelreadings aus MQTT-Device

Begonnen von loungelizard, 04 März 2018, 08:50:19

Vorheriges Thema - Nächstes Thema

steffen83

Ich wurde gefragt, ob ich den Code auch für MQTT2 habe.
In der Tat, ich habe dies mal umgeändert.

defmod MQTT_DF_Garage MQTT2_DEVICE df-garage
attr MQTT_DF_Garage IODev MQTT2_SERVER
attr MQTT_DF_Garage alexaName Bewegungsmelder_df-garage
attr MQTT_DF_Garage alexaProactiveEvents 1
attr MQTT_DF_Garage autocreate 1
attr MQTT_DF_Garage cmdIcon calibrate:recycling up:control_arrow_up left:control_arrow_left right:control_arrow_right down:control_arrow_down sdcard:sdcard ON
attr MQTT_DF_Garage devStateIcon absent:it_camera@red M;;ON:motion_detector@red M;;OFF:motion_detector@green MT;;OFF:people_sensor@red:motion_tracking+ON MT;;ON:people_sensor@green:motion_tracking+OFF ST;;OFF:telegram@red:motion_send_telegram+ON ST;;ON:telegram@green:motion_send_telegram+OFF
attr MQTT_DF_Garage devicetopic myhome/df-garage
attr MQTT_DF_Garage event-on-change-reading .*
attr MQTT_DF_Garage eventMap /up up:up/\
down down:down/\
left left:left/\
right right:right/\
calibrate calibrate:calibrate/\
remount_sdcard on:sdcard
attr MQTT_DF_Garage genericDeviceType securitysystem
attr MQTT_DF_Garage homebridgeMapping MotionDetected=motion,values=ON:1;;;;OFF:0
attr MQTT_DF_Garage readingList $DEVICETOPIC/night_mode/auto:.* auto_night_mode\
$DEVICETOPIC/leds/blue:.* blue\
$DEVICETOPIC/leds/ir:.* ir\
$DEVICETOPIC/ir_cut:.* ir_cut\
$DEVICETOPIC/motion:.* motion\
$DEVICETOPIC/motion/detection:.* motion_detection\
$DEVICETOPIC/motion/led:.* motion_led\
$DEVICETOPIC/motion/send_mail:.* motion_send_mail\
$DEVICETOPIC/motion/send_telegram:.* motion_send_telegram\
$DEVICETOPIC/motion/snapshot:.* motion_snapshot\
$DEVICETOPIC/motion/tracking:.* motion_tracking\
$DEVICETOPIC/motion/mqtt_publish:.* mqtt_publish\
$DEVICETOPIC/motion/mqtt_snapshot:.* mqtt_snapshot\
$DEVICETOPIC/night_mode:.* night_mode\
$DEVICETOPIC/recording:.* recording\
$DEVICETOPIC/rtsp_server:.* rtsp_server\
$DEVICETOPIC/timelapse:.* timelapse\
$DEVICETOPIC/motion/videoXXX:.* video\
$DEVICETOPIC/leds/yellow:.* yellow\
\
$DEVICETOPIC/motors/horizontal:.* horizontal\
$DEVICETOPIC/motors/vertical:.* vertical\
\
\
$DEVICETOPIC/brightness:.* brightness\
$DEVICETOPIC/light_sensor:.* light_sensor\
$DEVICETOPIC/motor_up_down:.* motor_up_down\
$DEVICETOPIC/motor_left_right:.* motor_left_right\
$DEVICETOPIC/uptime:.* uptime\

attr MQTT_DF_Garage room 2.0 Kamera-> 2.0 Luke,Keller,MQTT2_DEVICE
attr MQTT_DF_Garage setList blue:ON,OFF $DEVICETOPIC/leds/blue/set $EVTPART1\
yellow:ON,OFF $DEVICETOPIC/leds/yellow/set $EVTPART1\
night_mode:ON,OFF $DEVICETOPIC/night_mode/set $EVTPART1\
night_mode_auto:ON,OFF $DEVICETOPIC/night_mode/auto/set $EVTPART1\
ir:ON,OFF $DEVICETOPIC/leds/ir/set $EVTPART1\
ir_cut:ON,OFF $DEVICETOPIC/ir_cut/set $EVTPART1\
motion_detection:ON,OFF $DEVICETOPIC/motion/detection/set $EVTPART1\
motion_led:ON,OFF $DEVICETOPIC/motion/led/set $EVTPART1\
motion_send_mail:ON,OFF $DEVICETOPIC/motion/send_mail/set $EVTPART1\
motion_send_telegram:ON,OFF $DEVICETOPIC/motion/send_telegram/set $EVTPART1\
motion_snapshot:ON,OFF $DEVICETOPIC/motion/snapshot/set $EVTPART1\
mqtt_snapshot:ON,OFF $DEVICETOPIC/motion/mqtt_snapshot/set $EVTPART1\
video:ON,OFF $DEVICETOPIC/motion/video/set $EVTPART1\
rtsp_server:ON,OFF $DEVICETOPIC/rtsp_server/set $EVTPART1\
mqtt_publish:ON,OFF $DEVICETOPIC/motion/mqtt_publish/set $EVTPART1\
motion_tracking:ON,OFF $DEVICETOPIC/motion/tracking/set $EVTPART1\
calibrate:calibrate $DEVICETOPIC/motors/set $EVTPART1\
reboot:ON $DEVICETOPIC/reboot/set $EVTPART1\
remount_sdcard:ON $DEVICETOPIC/remount_sdcard/set $EVTPART1\
recording:ON,OFF $DEVICETOPIC/recording/set $EVTPART1\
timelapse:ON,OFF $DEVICETOPIC/timelapse/set $EVTPART1\
snapshot:ON,OFF $DEVICETOPIC/snapshot/set $EVTPART1\
update:update $DEVICETOPIC/update/set $EVTPART1\
up:up $DEVICETOPIC/motors/vertical/set $EVTPART1\
down:down $DEVICETOPIC/motors/vertical/set $EVTPART1\
left:left $DEVICETOPIC/motors/horizontal/set $EVTPART1\
right:right $DEVICETOPIC/motors/horizontal/set $EVTPART1
attr MQTT_DF_Garage setStateList on off toggle
attr MQTT_DF_Garage stateFormat {my $status = ReadingsAge($name, "auto_night_mode", "");;\
  if ($status > 180) {return "absent"}\
  elsif ($status < 180) {\
  my $motion = ReadingsVal($name,"motion","");;\
my $motion_tracking = ReadingsVal($name,"motion_tracking","");;\
my $motion_send_telegram = ReadingsVal($name,"motion_send_telegram","");;\
my $horizontal = ReadingsVal($name,"horizontal","");;\
my $vertical = ReadingsVal($name,"vertical","");;\
$status = "M;;$motion\nMT;;$motion_tracking\nST;;$motion_send_telegram\n<br>Position $horizontal;;$vertical";;\
return $status;;\
}\
  }
attr MQTT_DF_Garage verbose 0
attr MQTT_DF_Garage webCmd sdcard:calibrate:left:up:down:right

setstate MQTT_DF_Garage M;;OFF\
MT;;ON\
ST;;ON\
<br>Position 1400;;450
setstate MQTT_DF_Garage 2022-01-18 15:56:29 IODev MQTT2_SERVER
setstate MQTT_DF_Garage 2022-01-19 18:52:40 auto_night_mode ON
setstate MQTT_DF_Garage 2022-01-19 18:52:22 blue OFF
setstate MQTT_DF_Garage 2021-03-24 14:55:42 calibrate set calibrate
setstate MQTT_DF_Garage 2021-03-24 14:53:09 down set down
setstate MQTT_DF_Garage 2022-01-19 18:52:45 horizontal 1400
setstate MQTT_DF_Garage 2022-01-19 18:52:37 ir ON
setstate MQTT_DF_Garage 2022-01-19 18:52:39 ir_cut OFF
setstate MQTT_DF_Garage 2021-08-10 12:07:00 left set left
setstate MQTT_DF_Garage 2022-01-18 16:48:09 motion OFF
setstate MQTT_DF_Garage 2022-01-19 18:52:40 motion_detection ON
setstate MQTT_DF_Garage 2022-01-19 18:52:40 motion_led ON
setstate MQTT_DF_Garage 2022-01-19 18:52:42 motion_send_mail OFF
setstate MQTT_DF_Garage 2022-01-19 18:52:42 motion_send_telegram ON
setstate MQTT_DF_Garage 2022-01-19 18:52:41 motion_snapshot OFF
setstate MQTT_DF_Garage 2022-01-19 18:52:43 motion_tracking ON
setstate MQTT_DF_Garage 2022-01-19 18:52:41 mqtt_publish ON
setstate MQTT_DF_Garage 2022-01-19 18:52:41 mqtt_snapshot ON
setstate MQTT_DF_Garage 2022-01-19 18:52:40 night_mode ON
setstate MQTT_DF_Garage 2021-03-25 09:58:47 reboot set ON
setstate MQTT_DF_Garage 2022-01-19 18:52:43 recording OFF
setstate MQTT_DF_Garage 2021-03-24 14:57:21 remount_sdcard set on
setstate MQTT_DF_Garage 2021-03-24 15:03:59 right set right
setstate MQTT_DF_Garage 2022-01-19 18:52:39 rtsp_server ON
setstate MQTT_DF_Garage 2022-01-19 18:52:44 timelapse OFF
setstate MQTT_DF_Garage 2021-03-28 12:17:47 tracking set OFF
setstate MQTT_DF_Garage 2021-03-24 14:50:41 up set
setstate MQTT_DF_Garage 2022-01-19 18:52:45 vertical 450
setstate MQTT_DF_Garage 2022-01-19 18:52:34 yellow OFF

Raspberry Pi 3 (Noobs, aktuelle Fhem und Pilight) | FHEMduino | HM-OCCU-SDK | HM-Sec-SCo | HM-Sec-SD-2 | HM-CC-RT-DN | HM-LC-Bl1PBU-FM

masterpete23

Danke. Hast du an der Dafang etwas "speziell" konfiguriert? Thema Motion Detection ->mqtt?
Funktioniert dies? wie schaut es mit telegram direkt von der CAM aus - ist dies zuverlässig?
Welche sw Version hast du auf der Dafang laufen?

steffen83

Hallo,

nein ich habe selbst nichts spezielles in der Software/Kamera eingestellt. Ich nutzte die neueste Software.

Telegram läuft leider nicht so perfekt wie früher mal. Bei mir schickt er keine BIlder. Höchstens VIdeos oder nur Nachrichten.
Raspberry Pi 3 (Noobs, aktuelle Fhem und Pilight) | FHEMduino | HM-OCCU-SDK | HM-Sec-SCo | HM-Sec-SD-2 | HM-CC-RT-DN | HM-LC-Bl1PBU-FM

masterpete23


steffen83

korrekt. Wenn bei dir das mit dem Telegram funktioniert, würde ich mich über eine RM freuen.
Mich interessiert da besonders Bild bei Alarm (per Telegram)
Raspberry Pi 3 (Noobs, aktuelle Fhem und Pilight) | FHEMduino | HM-OCCU-SDK | HM-Sec-SCo | HM-Sec-SD-2 | HM-CC-RT-DN | HM-LC-Bl1PBU-FM

masterpete23

Danke. Wie ist telegram einzurichten? Das würde ich gerne einmal testen - will aber nix falsch machen.
Dann könnte ich es nochmal feedbacken

steffen83

Das sind ja Einstellungen von der Kamera die musst du dort machen. Im conf Ordner der Teil mit Telegramm.
Raspberry Pi 3 (Noobs, aktuelle Fhem und Pilight) | FHEMduino | HM-OCCU-SDK | HM-Sec-SCo | HM-Sec-SD-2 | HM-CC-RT-DN | HM-LC-Bl1PBU-FM