|
|
|
@@ -68,8 +68,8 @@
|
|
|
|
|
$MQTT_COMMAND "$AUTODISCOVERY_PREFIX/switch/$DEVICE_NAME/rtsp_server/config" ${MOSQUITTOPUBOPTS} ${MOSQUITTOOPTS} -r -m "{\"name\": \"$DEVICE_NAME RTSP Server\", \"unique_id\": \"$MAC_SIMPLE-rtsp-server\", $DEVICE_INFO, \"icon\": \"mdi:cctv\", \"state_topic\": \"$TOPIC/rtsp_server\", \"command_topic\": \"$TOPIC/rtsp_server/set\"}"
|
|
|
|
|
|
|
|
|
|
# Motor up/down/left/right
|
|
|
|
|
$MQTT_COMMAND "$AUTODISCOVERY_PREFIX/cover/$DEVICE_NAME/motor_up_down/config" ${MOSQUITTOPUBOPTS} ${MOSQUITTOOPTS} -r -m "{\"name\": \"$DEVICE_NAME Move Up/Down\", \"unique_id\": \"$MAC_SIMPLE-move-up-down\", $DEVICE_INFO, \"set_position_topic\": \"$TOPIC/motors/vertical/set\", \"position_topic\": \"$TOPIC/motors/vertical\", \"command_topic\": \"$TOPIC/motors/vertical/set\", \"payload_close\": \"down\", \"payload_open\": \"up\", \"optimistic\": \"false\", \"value_template\": \"{{ ((value|int)/($MAX_Y/$STEP))|round }}\", \"set_position_template\": \"{{ ((position|int)*($MAX_Y/$STEP))|round }}\"}"
|
|
|
|
|
$MQTT_COMMAND "$AUTODISCOVERY_PREFIX/cover/$DEVICE_NAME/motor_left_right/config" ${MOSQUITTOPUBOPTS} ${MOSQUITTOOPTS} -r -m "{\"name\": \"$DEVICE_NAME Move Left/Right\", \"unique_id\": \"$MAC_SIMPLE-move-left-right\", $DEVICE_INFO, \"set_position_topic\": \"$TOPIC/motors/horizontal/set\", \"position_topic\": \"$TOPIC/motors/horizontal\", \"command_topic\": \"$TOPIC/motors/horizontal/set\", \"payload_close\": \"right\", \"payload_open\": \"left\", \"optimistic\": \"false\", \"value_template\": \"{{ ((value|int)/($MAX_X/$STEP))|round }}\", \"set_position_template\": \"{{ ((position|int)*($MAX_X/$STEP))|round }}\"}"
|
|
|
|
|
$MQTT_COMMAND "$AUTODISCOVERY_PREFIX/cover/$DEVICE_NAME/motor_up_down/config" ${MOSQUITTOPUBOPTS} ${MOSQUITTOOPTS} -r -m "{\"name\": \"$DEVICE_NAME move up/down\", \"unique_id\": \"$MAC_SIMPLE-move-up-down\", $DEVICE_INFO, \"set_position_topic\": \"$TOPIC/motors/vertical/set\", \"position_topic\": \"$TOPIC/motors/vertical\", \"command_topic\": \"$TOPIC/motors/vertical/set\", \"payload_close\": \"down\", \"payload_open\": \"up\", \"optimistic\": \"false\", \"position_template\": \"{{ ((value|int)/($MAX_Y/$STEP))|round }}\", \"set_position_template\": \"{{ ((position|int)*($MAX_Y/$STEP))|round }}\"}"
|
|
|
|
|
$MQTT_COMMAND "$AUTODISCOVERY_PREFIX/cover/$DEVICE_NAME/motor_left_right/config" ${MOSQUITTOPUBOPTS} ${MOSQUITTOOPTS} -r -m "{\"name\": \"$DEVICE_NAME move left/right\", \"unique_id\": \"$MAC_SIMPLE-move-left-right\", $DEVICE_INFO, \"set_position_topic\": \"$TOPIC/motors/horizontal/set\", \"position_topic\": \"$TOPIC/motors/horizontal\", \"command_topic\": \"$TOPIC/motors/horizontal/set\", \"payload_close\": \"right\", \"payload_open\": \"left\", \"optimistic\": \"false\", \"position_template\": \"{{ ((value|int)/($MAX_X/$STEP))|round }}\", \"set_position_template\": \"{{ ((position|int)*($MAX_X/$STEP))|round }}\"}"
|
|
|
|
|
|
|
|
|
|
# Recording on/off switch
|
|
|
|
|
$MQTT_COMMAND "$AUTODISCOVERY_PREFIX/switch/$DEVICE_NAME/recording/config" ${MOSQUITTOPUBOPTS} ${MOSQUITTOOPTS} -r -m "{\"name\": \"$DEVICE_NAME Recording\", \"unique_id\": \"$MAC_SIMPLE-recording\", $DEVICE_INFO, \"icon\": \"mdi:video\", \"state_topic\": \"$TOPIC/recording\", \"command_topic\": \"$TOPIC/recording/set\"}"
|
|
|
|
|